@kinotic-ai/system-api 5.0.0-beta.3 → 5.0.0-beta.31

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.cts CHANGED
@@ -1,87 +1,26 @@
1
1
  import { SYSTEM_API_ZONE } from "@kinotic-ai/management-api";
2
+ import { ReconcileState, Reconcilable } from "@kinotic-ai/management-api";
2
3
  /**
3
- * How much of a workload's log output is kept on the node. The workload's own image and
4
- * entrypoint have no say in it: the policy is applied by the VM provider, which owns the
5
- * log files, so a workload cannot fill the node by writing to stdout.
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.
6
7
  */
7
- declare class LogPolicy {
8
- /**
9
- * Size at which the workload's current log file is rotated.
10
- */
11
- maxSizeMb: number;
12
- /**
13
- * How many rotated files are kept alongside the current one. The oldest is discarded
14
- * once this many exist, so a workload's logs occupy at most maxSizeMb * (maxFiles + 1).
15
- */
16
- maxFiles: number;
17
- }
18
- declare enum NetworkMode {
19
- ENABLED = "ENABLED",
20
- /**
21
- * No network access. Nothing outside the VM is reachable, by name or by address, and
22
- * any NetworkPolicy.allowedHosts the workload declares does not apply.
23
- */
24
- DISABLED = "DISABLED"
25
- }
26
- /**
27
- * The network access granted to a workload's VM. The workload's own image and entrypoint
28
- * have no say in it: the policy is applied by the VM provider when the VM is created,
29
- * which is what makes it safe to run code the platform does not trust.
30
- */
31
- declare class NetworkPolicy {
32
- /**
33
- * Whether the VM has network access at all.
34
- */
35
- mode: NetworkMode;
36
- /**
37
- * The outbound destinations the VM may reach, including the api-gateway the workload is
38
- * deployed to talk to. An empty list denies every destination, leaving the VM able to
39
- * resolve names and reach nothing. Applies only when mode is ENABLED.
40
- *
41
- * What an entry may be follows the provider of the node the workload is placed on:
42
- * CLOUD_HYPERVISOR takes IPv4 addresses and CIDRs, enforced by the node's firewall, and
43
- * BOXLITE takes hostnames, enforced on the connection so an unlisted destination is
44
- * unreachable by name and by raw IP alike.
45
- */
46
- allowedHosts: string[];
47
- }
48
- declare enum PortProtocol {
49
- TCP = "TCP",
50
- UDP = "UDP"
51
- }
52
- /**
53
- * A guest port exposed on the host for a workload's VM.
54
- */
55
- interface PortMapping {
56
- /** Host port to expose. When omitted, the provider assigns one. */
57
- hostPort?: number;
58
- /** Guest port to map to the host. */
59
- guestPort: number;
60
- /** Transport protocol. When omitted, the provider's default applies. */
61
- protocol?: PortProtocol;
62
- /** Host interface to bind on. When omitted, the provider's default applies. */
63
- hostIp?: string;
64
- }
65
- import { Identifiable } from "@kinotic-ai/core";
66
8
  declare enum VmNodeStatusType {
67
9
  ONLINE = "ONLINE",
68
- 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
+ */
69
14
  DRAINING = "DRAINING"
70
15
  }
71
16
  /**
72
- * 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.
73
20
  */
74
- declare class VmNodeStatus {
75
- /**
76
- * Whether the node is taking workloads.
77
- */
78
- type: VmNodeStatusType;
79
- /**
80
- * Why the node is not taking workloads, or null when it is. Set from the node's own report
81
- * of the guarantees it can still make — a data root that stopped enforcing disk limits, or
82
- * a firewall that stopped hiding host credentials from guests.
83
- */
84
- healthMessage: string | null;
21
+ interface VmNodeState {
22
+ /** Whether the node takes workloads. */
23
+ phase: VmNodeStatusType;
85
24
  }
86
25
  declare enum VmProviderType {
87
26
  BOXLITE = "BOXLITE",
@@ -91,7 +30,7 @@ declare enum VmProviderType {
91
30
  * Represents a node in the cluster that is running a VmManager process
92
31
  * and is capable of hosting workloads.
93
32
  */
94
- declare class VmNode implements Identifiable<string> {
33
+ declare class VmNode implements Reconcilable<VmNodeState> {
95
34
  /**
96
35
  * Unique identifier for this node.
97
36
  */
@@ -105,9 +44,17 @@ declare class VmNode implements Identifiable<string> {
105
44
  */
106
45
  hostname: string;
107
46
  /**
108
- * 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.
109
50
  */
110
- 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;
111
58
  /**
112
59
  * The VM provider this node runs every workload on, determined by how the node was
113
60
  * provisioned and reported when it registers.
@@ -126,21 +73,22 @@ declare class VmNode implements Identifiable<string> {
126
73
  */
127
74
  totalDiskMb: number;
128
75
  /**
129
- * 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.
130
78
  */
131
- allocatedCpus: number;
79
+ freeCpus: number;
132
80
  /**
133
- * Memory currently allocated to workloads in megabytes.
81
+ * Memory not allocated to any workload, in megabytes.
134
82
  */
135
- allocatedMemoryMb: number;
83
+ freeMemoryMb: number;
136
84
  /**
137
- * Disk space currently allocated to workloads in megabytes.
85
+ * Disk space not allocated to any workload, in megabytes.
138
86
  */
139
- allocatedDiskMb: number;
87
+ freeDiskMb: number;
140
88
  /**
141
89
  * The date and time the node was last seen/heartbeat.
142
90
  */
143
- lastSeen: number | null;
91
+ lastSeen: string | null;
144
92
  /**
145
93
  * Base directory every workload volume mount on this node must live under. Reported by
146
94
  * the node at registration; deployment flows compose host paths under it.
@@ -149,154 +97,6 @@ declare class VmNode implements Identifiable<string> {
149
97
  constructor(id: string, name: string, hostname: string);
150
98
  }
151
99
  /**
152
- * A host directory exposed inside a workload's guest VM.
153
- */
154
- interface VolumeMount {
155
- /** Absolute path on the host to mount into the guest. */
156
- hostPath: string;
157
- /** Absolute path inside the guest where the host path is mounted. */
158
- guestPath: string;
159
- /** When true, the mount is exposed read-only inside the guest. Defaults to false. */
160
- readOnly?: boolean;
161
- /**
162
- * Hard cap in megabytes on what the guest may write through this mount. Unset leaves the
163
- * mount bounded only by the host filesystem it comes from. Applies to writable mounts,
164
- * since a read-only mount is already unwritable.
165
- */
166
- sizeLimitMb?: number;
167
- }
168
- import { Identifiable as Identifiable2 } from "@kinotic-ai/core";
169
- declare enum WorkloadStatus {
170
- PENDING = "PENDING",
171
- STARTING = "STARTING",
172
- RUNNING = "RUNNING",
173
- STOPPING = "STOPPING",
174
- STOPPED = "STOPPED",
175
- FAILED = "FAILED"
176
- }
177
- /**
178
- * Represents a workload to be managed by the VM manager.
179
- * A workload defines the configuration for a micro VM instance.
180
- */
181
- declare class Workload implements Identifiable2<string> {
182
- /**
183
- * Unique identifier for this workload.
184
- */
185
- id: string | null;
186
- /**
187
- * Human-readable name for the workload.
188
- */
189
- name: string;
190
- /**
191
- * Optional description of the workload.
192
- */
193
- description?: string;
194
- /**
195
- * The id of the node this workload is deployed to, assigned by the orchestrator
196
- * during deployment, or set by the caller before deploying to pin the workload to a
197
- * specific node. Null until the workload has been placed.
198
- */
199
- nodeId: string | null;
200
- /**
201
- * The Organization this workload runs on behalf of, and which may view its logs.
202
- * Null for platform workloads (SYSTEM scope).
203
- */
204
- organizationId: string | null;
205
- /**
206
- * The Application this workload runs on behalf of, or null if none.
207
- * When set, organizationId must also be set.
208
- */
209
- applicationId: string | null;
210
- /**
211
- * The image or rootfs to use for the VM.
212
- */
213
- image: string;
214
- /**
215
- * Number of vCPUs allocated to the VM.
216
- */
217
- vcpus: number;
218
- /**
219
- * Memory allocated to the VM in megabytes.
220
- */
221
- memoryMb: number;
222
- /**
223
- * Disk size allocated to the VM in megabytes.
224
- */
225
- diskSizeMb: number;
226
- /**
227
- * The network access granted to this workload's VM.
228
- */
229
- network: NetworkPolicy;
230
- /**
231
- * How much of this workload's log output the node keeps.
232
- */
233
- logPolicy: LogPolicy;
234
- /**
235
- * When true the VM runs detached from the vm-manager process and survives its restarts,
236
- * and calls that start its run (deploy, restart) complete as soon as it is running.
237
- * When false the workload runs in the foreground: it ends when the vm-manager exits,
238
- * and calls that start its run complete only once the run has ended — STOPPED or
239
- * FAILED, with the exit code set.
240
- */
241
- detached: boolean;
242
- /**
243
- * When true the VM and its disk are discarded when the workload stops, so a
244
- * stopped workload cannot be restarted. When false the disk is kept and the
245
- * workload may be restarted in place.
246
- */
247
- autoRemove: boolean;
248
- /**
249
- * Current status of the workload.
250
- */
251
- status: WorkloadStatus;
252
- /**
253
- * The exit status of the workload's process once it has stopped, null while it has not.
254
- * A workload killed by a signal reports 128 plus the signal number, so 137 is a SIGKILL —
255
- * which is what a workload that exceeded its memory limit receives, with no chance to
256
- * shut down first. FAILED alone does not distinguish that from code that threw.
257
- */
258
- exitCode: number | null;
259
- /**
260
- * Optional environment variables to pass to the VM. Persisted verbatim on the workload
261
- * record — put values that must not be readable there in secrets instead.
262
- */
263
- environment: Record<string, string>;
264
- /**
265
- * Optional secret environment variables to pass to the VM, delivered to the guest
266
- * exactly like environment and overriding it on a duplicate key. The persisted workload
267
- * record holds a masked value for every entry — reading a workload back returns the keys
268
- * but never the values, which only the node receives.
269
- */
270
- secrets: Record<string, string>;
271
- /**
272
- * Port mappings that expose guest ports on the host.
273
- */
274
- portMappings: PortMapping[];
275
- /**
276
- * Volume mounts that expose host directories inside the guest VM.
277
- */
278
- volumeMounts: VolumeMount[];
279
- /**
280
- * Overrides the image entrypoint. Empty keeps the image default.
281
- */
282
- entrypoint: string[];
283
- /**
284
- * Overrides the image command (CMD). Empty keeps the image default, unless
285
- * entrypoint is declared — then the image CMD is dropped so the entrypoint
286
- * runs exactly as given.
287
- */
288
- cmd: string[];
289
- /**
290
- * The date and time the workload was created.
291
- */
292
- created: number | null;
293
- /**
294
- * The date and time the workload was last updated.
295
- */
296
- updated: number | null;
297
- constructor(name: string, image: string);
298
- }
299
- /**
300
100
  * DTO sent by a vm-manager process when it registers with the server.
301
101
  * Contains only the information the node knows about itself.
302
102
  */
@@ -335,6 +135,7 @@ declare class VmNodeRegistration {
335
135
  workloadDataDir: string | null;
336
136
  constructor(id: string, name: string, hostname: string);
337
137
  }
138
+ import { WorkloadStatus } from "@kinotic-ai/management-api";
338
139
  /**
339
140
  * A vm-manager node's view of one workload's status, reported to the orchestrator.
340
141
  */
@@ -348,17 +149,51 @@ interface WorkloadStatusReport {
348
149
  /** When the node recorded this status, in epoch milliseconds. */
349
150
  updated: number;
350
151
  }
152
+ /**
153
+ * The provider whose API an LlmConfiguration calls.
154
+ */
155
+ declare enum LlmProviderType {
156
+ /** Anthropic's Messages API, serving the Claude models. */
157
+ ANTHROPIC = "ANTHROPIC",
158
+ /** OpenAI's Chat Completions API, or a server compatible with it. */
159
+ OPENAI = "OPENAI"
160
+ }
161
+ /**
162
+ * A large language model the platform's services call: the provider, the model, where the provider's API is
163
+ * reached and the options each request carries. The API key the provider is called with is held in the secret
164
+ * storage and is never a field of the configuration; apiKeyHeld says whether one is held.
165
+ */
166
+ declare class LlmConfiguration {
167
+ id: string | null;
168
+ /** The name a service selects the configuration by, unique across the platform. */
169
+ name: string;
170
+ provider: LlmProviderType;
171
+ /** The provider's id of the model, such as claude-opus-5-5. */
172
+ model: string;
173
+ /** The base URL of the provider's API, or null for the provider's public API. */
174
+ endpoint: string | null;
175
+ /** The most tokens a response may hold, or null for the calling service's default. */
176
+ maxTokens: number | null;
177
+ /** The sampling temperature, or null for the provider's default. */
178
+ temperature: number | null;
179
+ /** Whether an API key is held for the configuration. */
180
+ apiKeyHeld: boolean;
181
+ created: string | null;
182
+ updated: string | null;
183
+ constructor(name: string, provider: LlmProviderType, model: string);
184
+ }
185
+ import { WatchEvent } from "@kinotic-ai/management-api";
351
186
  import { IKinotic } from "@kinotic-ai/core";
352
- import { CrudServiceProxy, ICrudServiceProxy } from "@kinotic-ai/core";
187
+ import { CrudServiceProxy, ICrudServiceProxy, IterablePage, Page, Pageable } from "@kinotic-ai/core";
353
188
  interface IVmNodeService extends ICrudServiceProxy<VmNode> {
354
189
  /**
355
- * Finds a node with sufficient resources to host a workload with the given requirements.
356
- * @param requiredCpus the number of vCPUs required
357
- * @param requiredMemoryMb the amount of memory required in megabytes
358
- * @param requiredDiskMb the amount of disk space required in megabytes
359
- * @return a Promise resolving to a suitable node, or null if none available
190
+ * Lists what happened to the node, newest first: each change of what it should be and of what it
191
+ * reports, and each mark set beside them, with what caused it.
192
+ * @param nodeId the id of the node
193
+ * @param pageable the page to return
194
+ * @return a Promise resolving to a page of ledger entries, empty when the node is not registered
360
195
  */
361
- findAvailableNode(requiredCpus: number, requiredMemoryMb: number, requiredDiskMb: number): Promise<VmNode | null>;
196
+ findHistory(nodeId: string, pageable: Pageable): Promise<IterablePage<WatchEvent>>;
362
197
  /**
363
198
  * This operation makes all the recent writes immediately available for search.
364
199
  * @return a Promise that resolves when the operation is complete
@@ -367,10 +202,12 @@ interface IVmNodeService extends ICrudServiceProxy<VmNode> {
367
202
  }
368
203
  declare class VmNodeServiceProxy extends CrudServiceProxy<VmNode> implements IVmNodeService {
369
204
  constructor(kinotic: IKinotic);
370
- findAvailableNode(requiredCpus: number, requiredMemoryMb: number, requiredDiskMb: number): Promise<VmNode | null>;
205
+ findHistory(nodeId: string, pageable: Pageable): Promise<IterablePage<WatchEvent>>;
206
+ findHistorySinglePage(nodeId: string, pageable: Pageable): Promise<Page<WatchEvent>>;
371
207
  syncIndex(): Promise<void>;
372
208
  }
373
- import { CrudServiceProxy as CrudServiceProxy2, IKinotic as IKinotic2, ICrudServiceProxy as ICrudServiceProxy2, IterablePage, Page, Pageable } from "@kinotic-ai/core";
209
+ import { Workload, WatchEvent as WatchEvent2 } from "@kinotic-ai/management-api";
210
+ import { CrudServiceProxy as CrudServiceProxy2, IKinotic as IKinotic2, ICrudServiceProxy as ICrudServiceProxy2, IterablePage as IterablePage2, Page as Page2, Pageable as Pageable2 } from "@kinotic-ai/core";
374
211
  interface IWorkloadService extends ICrudServiceProxy2<Workload> {
375
212
  /**
376
213
  * Finds all workloads deployed on the given node.
@@ -378,13 +215,15 @@ interface IWorkloadService extends ICrudServiceProxy2<Workload> {
378
215
  * @param pageable the page to return
379
216
  * @return a Promise resolving to a page of workloads
380
217
  */
381
- findAllForNode(nodeId: string, pageable: Pageable): Promise<IterablePage<Workload>>;
218
+ findAllForNode(nodeId: string, pageable: Pageable2): Promise<IterablePage2<Workload>>;
382
219
  /**
383
- * Counts all workloads deployed on the given node.
384
- * @param nodeId the id of the node to count workloads for
385
- * @return a Promise resolving to the number of workloads
220
+ * Lists what happened to the workload, newest first: each status its run passed through and each
221
+ * mark set beside it, with what caused it.
222
+ * @param workloadId the workload
223
+ * @param pageable the page to return
224
+ * @return a Promise resolving to a page of ledger entries, empty when the workload does not exist
386
225
  */
387
- countForNode(nodeId: string): Promise<number>;
226
+ findHistory(workloadId: string, pageable: Pageable2): Promise<IterablePage2<WatchEvent2>>;
388
227
  /**
389
228
  * This operation makes all the recent writes immediately available for search.
390
229
  * @return a Promise that resolves when the operation is complete
@@ -393,11 +232,13 @@ interface IWorkloadService extends ICrudServiceProxy2<Workload> {
393
232
  }
394
233
  declare class WorkloadServiceProxy extends CrudServiceProxy2<Workload> implements IWorkloadService {
395
234
  constructor(kinotic: IKinotic2);
396
- findAllForNode(nodeId: string, pageable: Pageable): Promise<IterablePage<Workload>>;
397
- findAllForNodeSinglePage(nodeId: string, pageable: Pageable): Promise<Page<Workload>>;
398
- countForNode(nodeId: string): Promise<number>;
235
+ findAllForNode(nodeId: string, pageable: Pageable2): Promise<IterablePage2<Workload>>;
236
+ findAllForNodeSinglePage(nodeId: string, pageable: Pageable2): Promise<Page2<Workload>>;
237
+ findHistory(workloadId: string, pageable: Pageable2): Promise<IterablePage2<WatchEvent2>>;
238
+ findHistorySinglePage(workloadId: string, pageable: Pageable2): Promise<Page2<WatchEvent2>>;
399
239
  syncIndex(): Promise<void>;
400
240
  }
241
+ import { Workload as Workload2 } from "@kinotic-ai/management-api";
401
242
  import { IKinotic as IKinotic3 } from "@kinotic-ai/core";
402
243
  /**
403
244
  * Orchestrates workload deployment across the cluster, acting as the intermediary between
@@ -414,15 +255,7 @@ interface IWorkloadOrchestrationService {
414
255
  * @param workload the workload configuration to deploy
415
256
  * @return a Promise resolving to the deployed workload (including assigned nodeId and id)
416
257
  */
417
- deployWorkload(workload: Workload): Promise<Workload>;
418
- /**
419
- * Restarts a stopped workload in place on the node it is deployed to. Fails unless the
420
- * workload is stopped; a workload stopped with autoRemove true has no VM left to restart.
421
- * Honors the workload's detached flag the same way as {@link deployWorkload}.
422
- * @param workloadId the id of the workload to restart
423
- * @return a Promise resolving to the restarted workload
424
- */
425
- restartWorkload(workloadId: string): Promise<Workload>;
258
+ deployWorkload(workload: Workload2): Promise<Workload2>;
426
259
  /**
427
260
  * Stops a running workload.
428
261
  * @param workloadId the id of the workload to stop
@@ -430,19 +263,40 @@ interface IWorkloadOrchestrationService {
430
263
  */
431
264
  stopWorkload(workloadId: string): Promise<void>;
432
265
  /**
433
- * Destroys a workload, removing it from the node and cleaning up all resources.
266
+ * Destroys a workload's VM on its node, with its disk, and returns its room. A run still open is
267
+ * recorded STOPPED. The record stays as the run's outcome, and its logs stay in the log store,
268
+ * until deleteWorkload.
434
269
  * @param workloadId the id of the workload to destroy
435
- * @return a Promise that resolves when the workload has been destroyed
270
+ * @return a Promise that resolves when the VM has been destroyed
436
271
  */
437
272
  destroyWorkload(workloadId: string): Promise<void>;
273
+ /**
274
+ * Deletes a workload's record and every log line it wrote from the organization's log store, the
275
+ * one way either is removed. A run still open on its node — starting, running, or a stop the node
276
+ * has not answered — is refused: stop or destroy it first.
277
+ * @param workloadId the id of the workload to delete
278
+ * @return a Promise that resolves when the record and its logs are gone, or rejects if the run is
279
+ * still open
280
+ */
281
+ deleteWorkload(workloadId: string): Promise<void>;
282
+ /**
283
+ * Deletes the given workloads' records and every log line they wrote, as deleteWorkload does for
284
+ * one, with the log store asked once per organization. Any run still open refuses the whole batch
285
+ * before anything is deleted.
286
+ * @param workloadIds the ids of the workloads to delete
287
+ * @return a Promise that resolves when the records and their logs are gone, or rejects if any run
288
+ * is still open
289
+ */
290
+ deleteWorkloads(workloadIds: string[]): Promise<void>;
438
291
  }
439
292
  declare class WorkloadOrchestrationService implements IWorkloadOrchestrationService {
440
293
  private readonly serviceProxy;
441
294
  constructor(kinotic: IKinotic3);
442
- deployWorkload(workload: Workload): Promise<Workload>;
443
- restartWorkload(workloadId: string): Promise<Workload>;
295
+ deployWorkload(workload: Workload2): Promise<Workload2>;
444
296
  stopWorkload(workloadId: string): Promise<void>;
445
297
  destroyWorkload(workloadId: string): Promise<void>;
298
+ deleteWorkload(workloadId: string): Promise<void>;
299
+ deleteWorkloads(workloadIds: string[]): Promise<void>;
446
300
  }
447
301
  import { IKinotic as IKinotic4 } from "@kinotic-ai/core";
448
302
  /**
@@ -507,6 +361,22 @@ declare class LoggersDescriptor {
507
361
  groups: Map<string, GroupLoggerLevelsDescriptor>;
508
362
  }
509
363
  /**
364
+ * The CRI patterns that decide what trace logging prints.
365
+ *
366
+ * Each pattern is matched against the fully qualified CRI with Ant wildcards, where `*` matches
367
+ * within one segment and `**` across segments, so
368
+ * `srv://system-api~com.acme.HeartbeatService/*` covers every method of that service and
369
+ * `srv://system-api~com.acme.HeartbeatService/ping` covers only that one.
370
+ * An include wins over an exclude, so `excludes: ['**']` plus the handful of includes worth
371
+ * watching narrows trace logging to those services alone.
372
+ */
373
+ declare class TraceLogProperties {
374
+ /** CRIs kept in trace logging whatever the excludes say. Empty leaves the excludes to decide. */
375
+ includes: string[];
376
+ /** CRIs left out of trace logging, request and reply both, unless an include covers them. */
377
+ excludes: string[];
378
+ }
379
+ /**
510
380
  * Provides the ability to manage loggers
511
381
  */
512
382
  interface ILogManager {
@@ -528,24 +398,46 @@ interface ILogManager {
528
398
  * @param level the {@link LogLevel} to set for the logger with the given name
529
399
  */
530
400
  configureLogLevel(nodeId: string, name: string, level: LogLevel): Promise<void>;
401
+ /**
402
+ * @param nodeId the kinotic node to get the trace log patterns from
403
+ * @return the CRI patterns currently deciding what the node trace logs
404
+ */
405
+ traceLog(nodeId: string): Promise<TraceLogProperties>;
406
+ /**
407
+ * Configures the CRI patterns deciding what the node trace logs, silencing a service that
408
+ * would otherwise bury the log while trace logging is on.
409
+ * The patterns replace whatever the node is using and last until it restarts, which returns it
410
+ * to the `kinotic.traceLog` it was configured with.
411
+ *
412
+ * @param nodeId the kinotic node to set the trace log patterns on
413
+ * @param traceLog the include and exclude patterns to apply
414
+ */
415
+ configureTraceLog(nodeId: string, traceLog: TraceLogProperties): Promise<void>;
531
416
  }
532
417
  import { IKinotic as IKinotic5 } from "@kinotic-ai/core";
533
418
  /**
534
- * A single kinotic-server node in the cluster. Mirrors the server's
535
- * {@code org.kinotic.domain.api.model.cluster.KinoticNodeInfo}.
419
+ * A single server node in the cluster, of the org, system or app server. Mirrors the server's
420
+ * {@code org.kinotic.system.api.model.cluster.KinoticNodeInfo}.
536
421
  */
537
422
  declare class KinoticNodeInfo {
538
423
  nodeId: string;
539
424
  order: number;
540
- local: boolean;
541
- version: string;
425
+ /** The server kind the node runs, such as management, system or app. */
426
+ serverName: string;
427
+ addresses: string[];
428
+ hostNames: string[];
429
+ /** The Kinotic version the node runs; null when the node runs from classes rather than a packaged jar. */
430
+ version: string | null;
431
+ /** 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. */
432
+ telemetryServiceName: string | null;
433
+ /** 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. */
434
+ telemetryServiceInstanceId: string | null;
542
435
  }
543
436
  /**
544
- * The kinotic-server cluster's current topology and state. Mirrors the server's
545
- * {@code org.kinotic.domain.api.model.cluster.KinoticClusterInfo}.
437
+ * The current topology and state of the cluster the org, system and app servers form. Mirrors the
438
+ * server's {@code org.kinotic.system.api.model.cluster.KinoticClusterInfo}.
546
439
  */
547
440
  declare class KinoticClusterInfo {
548
- localNodeId: string;
549
441
  serverNodeCount: number;
550
442
  topologyVersion: number;
551
443
  clusterState: string;
@@ -553,7 +445,7 @@ declare class KinoticClusterInfo {
553
445
  active: boolean;
554
446
  }
555
447
  /**
556
- * Queries the kinotic-server cluster's topology and state.
448
+ * Queries the topology and state of the cluster the org, system and app servers form.
557
449
  */
558
450
  interface IKinoticClusterInfoService {
559
451
  /**
@@ -566,38 +458,183 @@ declare class KinoticClusterInfoService implements IKinoticClusterInfoService {
566
458
  constructor(kinotic: IKinotic5);
567
459
  getClusterInfo(): Promise<KinoticClusterInfo>;
568
460
  }
569
- import { Application, Organization, Project, PendingInviteSummary, UserParticipantIdentity } from "@kinotic-ai/management-api";
570
- import { IKinotic as IKinotic6, Page as Page2, Pageable as Pageable2 } from "@kinotic-ai/core";
461
+ import { Application, Organization, Project, ApplicationParticipantIdentity, OrganizationMember, PendingInviteSummary } from "@kinotic-ai/management-api";
462
+ import { IKinotic as IKinotic6, Page as Page3, Pageable as Pageable3 } from "@kinotic-ai/core";
571
463
  /**
572
- * Cross-organization reads for platform operators. Published in the system zone, which only
464
+ * Cross-organization reads for system users. Published in the system zone, which only
573
465
  * SYSTEM participants may address, so every method takes the target organization explicitly
574
466
  * instead of resolving it from the caller's scope.
575
467
  */
576
468
  interface ISystemOrganizationService {
577
- findOrganizations(pageable: Pageable2): Promise<Page2<Organization>>;
578
- searchOrganizations(searchText: string, pageable: Pageable2): Promise<Page2<Organization>>;
469
+ findOrganizations(pageable: Pageable3): Promise<Page3<Organization>>;
470
+ searchOrganizations(searchText: string, pageable: Pageable3): Promise<Page3<Organization>>;
579
471
  /** Resolves null when no organization has the given id. */
580
472
  findOrganizationById(organizationId: string): Promise<Organization | null>;
581
473
  countOrganizations(): Promise<number>;
582
- findApplications(organizationId: string, pageable: Pageable2): Promise<Page2<Application>>;
583
- findProjects(organizationId: string, pageable: Pageable2): Promise<Page2<Project>>;
584
- /** applicationId null = the organization's members */
585
- findMembers(organizationId: string, applicationId: string | null, pageable: Pageable2): Promise<Page2<UserParticipantIdentity>>;
586
- searchMembers(searchText: string, organizationId: string, applicationId: string | null, pageable: Pageable2): Promise<Page2<UserParticipantIdentity>>;
587
- findPendingInvites(organizationId: string, applicationId: string | null, pageable: Pageable2): Promise<Page2<PendingInviteSummary>>;
474
+ findApplications(organizationId: string, pageable: Pageable3): Promise<Page3<Application>>;
475
+ findProjects(organizationId: string, pageable: Pageable3): Promise<Page3<Project>>;
476
+ findMembers(organizationId: string, pageable: Pageable3): Promise<Page3<OrganizationMember>>;
477
+ searchMembers(searchText: string, organizationId: string, pageable: Pageable3): Promise<Page3<OrganizationMember>>;
478
+ findApplicationUsers(organizationId: string, applicationId: string, pageable: Pageable3): Promise<Page3<ApplicationParticipantIdentity>>;
479
+ searchApplicationUsers(searchText: string, organizationId: string, applicationId: string, pageable: Pageable3): Promise<Page3<ApplicationParticipantIdentity>>;
480
+ findPendingInvites(organizationId: string, applicationId: string | null, pageable: Pageable3): Promise<Page3<PendingInviteSummary>>;
588
481
  }
589
482
  declare class SystemOrganizationService implements ISystemOrganizationService {
590
483
  private readonly serviceProxy;
591
484
  constructor(kinotic: IKinotic6);
592
- findOrganizations(pageable: Pageable2): Promise<Page2<Organization>>;
593
- searchOrganizations(searchText: string, pageable: Pageable2): Promise<Page2<Organization>>;
485
+ findOrganizations(pageable: Pageable3): Promise<Page3<Organization>>;
486
+ searchOrganizations(searchText: string, pageable: Pageable3): Promise<Page3<Organization>>;
594
487
  findOrganizationById(organizationId: string): Promise<Organization | null>;
595
488
  countOrganizations(): Promise<number>;
596
- findApplications(organizationId: string, pageable: Pageable2): Promise<Page2<Application>>;
597
- findProjects(organizationId: string, pageable: Pageable2): Promise<Page2<Project>>;
598
- findMembers(organizationId: string, applicationId: string | null, pageable: Pageable2): Promise<Page2<UserParticipantIdentity>>;
599
- searchMembers(searchText: string, organizationId: string, applicationId: string | null, pageable: Pageable2): Promise<Page2<UserParticipantIdentity>>;
600
- findPendingInvites(organizationId: string, applicationId: string | null, pageable: Pageable2): Promise<Page2<PendingInviteSummary>>;
489
+ findApplications(organizationId: string, pageable: Pageable3): Promise<Page3<Application>>;
490
+ findProjects(organizationId: string, pageable: Pageable3): Promise<Page3<Project>>;
491
+ findMembers(organizationId: string, pageable: Pageable3): Promise<Page3<OrganizationMember>>;
492
+ searchMembers(searchText: string, organizationId: string, pageable: Pageable3): Promise<Page3<OrganizationMember>>;
493
+ findApplicationUsers(organizationId: string, applicationId: string, pageable: Pageable3): Promise<Page3<ApplicationParticipantIdentity>>;
494
+ searchApplicationUsers(searchText: string, organizationId: string, applicationId: string, pageable: Pageable3): Promise<Page3<ApplicationParticipantIdentity>>;
495
+ findPendingInvites(organizationId: string, applicationId: string | null, pageable: Pageable3): Promise<Page3<PendingInviteSummary>>;
496
+ }
497
+ import { MachineParticipantIdentity, MachineProvisionResult, SystemParticipantIdentity } from "@kinotic-ai/management-api";
498
+ import { IKinotic as IKinotic7, Page as Page4, Pageable as Pageable4 } from "@kinotic-ai/core";
499
+ /**
500
+ * The platform's own members: the system users who sign in to the system console, and the
501
+ * SYSTEM-scope machines that connect as platform daemons, such as a worker node's vm-manager.
502
+ * Published in the system zone, which only SYSTEM participants may address; every method works
503
+ * on SYSTEM scope alone, so an organization's users and machines stay that organization's to
504
+ * manage through IMachineService.
505
+ */
506
+ interface ISystemMemberService {
507
+ findUsers(pageable: Pageable4): Promise<Page4<SystemParticipantIdentity>>;
508
+ searchUsers(searchText: string, pageable: Pageable4): Promise<Page4<SystemParticipantIdentity>>;
509
+ /** Lists the platform's machines, disabled ones included. */
510
+ findMachines(pageable: Pageable4): Promise<Page4<MachineParticipantIdentity>>;
511
+ /**
512
+ * Provisions a platform machine and returns it together with its generated client secret.
513
+ * The secret is disclosed exactly once — it cannot be retrieved later.
514
+ */
515
+ createMachine(displayName: string): Promise<MachineProvisionResult>;
516
+ /**
517
+ * Replaces a platform machine's client secret, returning the new secret exactly once. The
518
+ * old secret stops working immediately; a connection the machine already holds lasts until
519
+ * it disconnects.
520
+ */
521
+ rotateSecret(machineId: string): Promise<string>;
522
+ /**
523
+ * Enables or disables a platform machine. A disabled machine is cut off on its next
524
+ * connection, and enabling it restores access with the same credential.
525
+ */
526
+ setMachineEnabled(machineId: string, enabled: boolean): Promise<void>;
527
+ /**
528
+ * Permanently removes a platform machine, including its stored credential. A removed
529
+ * machine's id cannot authenticate again.
530
+ */
531
+ removeMachine(machineId: string): Promise<void>;
532
+ }
533
+ declare class SystemMemberService implements ISystemMemberService {
534
+ private readonly serviceProxy;
535
+ constructor(kinotic: IKinotic7);
536
+ findUsers(pageable: Pageable4): Promise<Page4<SystemParticipantIdentity>>;
537
+ searchUsers(searchText: string, pageable: Pageable4): Promise<Page4<SystemParticipantIdentity>>;
538
+ findMachines(pageable: Pageable4): Promise<Page4<MachineParticipantIdentity>>;
539
+ createMachine(displayName: string): Promise<MachineProvisionResult>;
540
+ rotateSecret(machineId: string): Promise<string>;
541
+ setMachineEnabled(machineId: string, enabled: boolean): Promise<void>;
542
+ removeMachine(machineId: string): Promise<void>;
543
+ }
544
+ import { WatchEvent as WatchEvent3 } from "@kinotic-ai/management-api";
545
+ import { IKinotic as IKinotic8 } from "@kinotic-ai/core";
546
+ import { IterablePage as IterablePage3, Pageable as Pageable5 } from "@kinotic-ai/core";
547
+ /**
548
+ * The ledger of every watched record on the platform.
549
+ */
550
+ interface IWatchEventService {
551
+ /**
552
+ * Lists what happened to every watched record, newest first: each change of what a record should
553
+ * be and of what it reports, each mark set beside them, and each status a run passed through, with
554
+ * what caused it.
555
+ * @param pageable the page to return
556
+ * @return a Promise resolving to a page of ledger entries
557
+ */
558
+ findAll(pageable: Pageable5): Promise<IterablePage3<WatchEvent3>>;
559
+ }
560
+ declare class WatchEventService implements IWatchEventService {
561
+ private readonly serviceProxy;
562
+ constructor(kinotic: IKinotic8);
563
+ findAll(pageable: Pageable5): Promise<IterablePage3<WatchEvent3>>;
564
+ private findAllSinglePage;
565
+ }
566
+ import { IKinotic as IKinotic9, Page as Page5, Pageable as Pageable6 } from "@kinotic-ai/core";
567
+ /**
568
+ * The large language models the platform's services call, each an LlmConfiguration that system users
569
+ * manage and a service selects by name. A configuration's API key is given on save and held in the platform's
570
+ * scope of the secret storage until a save gives another or the configuration is deleted. Published in the
571
+ * system zone, which only SYSTEM participants and the platform's own cluster members may address.
572
+ */
573
+ interface ILlmConfigurationService {
574
+ findAll(pageable: Pageable6): Promise<Page5<LlmConfiguration>>;
575
+ /** Resolves null when no configuration has the given id. */
576
+ findById(id: string): Promise<LlmConfiguration | null>;
577
+ /** Resolves null when no configuration has the given name. */
578
+ findByName(name: string): Promise<LlmConfiguration | null>;
579
+ /**
580
+ * Saves a configuration, new or changed, and makes apiKey, when given, the key it calls its provider with.
581
+ * A null or blank apiKey keeps the key held for the configuration, if any. Its name must be one no other
582
+ * configuration has.
583
+ */
584
+ save(configuration: LlmConfiguration, apiKey: string | null): Promise<LlmConfiguration>;
585
+ /** Deletes the configuration and the API key held for it. */
586
+ deleteById(id: string): Promise<void>;
587
+ }
588
+ declare class LlmConfigurationService implements ILlmConfigurationService {
589
+ private readonly serviceProxy;
590
+ constructor(kinotic: IKinotic9);
591
+ findAll(pageable: Pageable6): Promise<Page5<LlmConfiguration>>;
592
+ findById(id: string): Promise<LlmConfiguration | null>;
593
+ findByName(name: string): Promise<LlmConfiguration | null>;
594
+ save(configuration: LlmConfiguration, apiKey: string | null): Promise<LlmConfiguration>;
595
+ deleteById(id: string): Promise<void>;
596
+ }
597
+ import { JobRun } from "@kinotic-ai/management-api";
598
+ import { IKinotic as IKinotic10 } from "@kinotic-ai/core";
599
+ /**
600
+ * A grind job system users can start on demand, as the console lists it.
601
+ */
602
+ interface SystemJobDescriptor {
603
+ /**
604
+ * The name identifying the job, which is also the name recorded on each of its runs.
605
+ */
606
+ readonly name: string;
607
+ /**
608
+ * The version of the job's definition, recorded on each of its runs.
609
+ */
610
+ readonly version: string | null;
611
+ /**
612
+ * What the job does.
613
+ */
614
+ readonly description: string | null;
615
+ }
616
+ /**
617
+ * Starts the system jobs on demand. A run is owned by the system and executes on the
618
+ * node that started it, and is listed, watched and read through Kinotic.jobMonitoring like any
619
+ * other job run.
620
+ */
621
+ interface ISystemJobService {
622
+ /**
623
+ * Lists the system jobs that can be started, ordered by name.
624
+ */
625
+ findSystemJobs(): Promise<SystemJobDescriptor[]>;
626
+ /**
627
+ * Starts a run of the named system job, resolving with the run once it and its task ledger are
628
+ * recorded; rejects when no system job has the given name.
629
+ * @param name the name of the job to run
630
+ */
631
+ startSystemJob(name: string): Promise<JobRun>;
632
+ }
633
+ declare class SystemJobService implements ISystemJobService {
634
+ private readonly serviceProxy;
635
+ constructor(kinotic: IKinotic10);
636
+ findSystemJobs(): Promise<SystemJobDescriptor[]>;
637
+ startSystemJob(name: string): Promise<JobRun>;
601
638
  }
602
639
  interface ISystemApiExtension {
603
640
  vmNodes: IVmNodeService;
@@ -606,17 +643,23 @@ interface ISystemApiExtension {
606
643
  logManager: ILogManager;
607
644
  clusterInfo: IKinoticClusterInfoService;
608
645
  systemOrganizations: ISystemOrganizationService;
646
+ systemMembers: ISystemMemberService;
647
+ watchEvents: IWatchEventService;
648
+ llmConfigurations: ILlmConfigurationService;
649
+ systemJobs: ISystemJobService;
609
650
  }
610
651
  declare const SystemApiPlugin: KinoticPlugin<ISystemApiExtension>;
611
- import { IKinotic as IKinotic7 } from "@kinotic-ai/core";
652
+ import { IKinotic as IKinotic11 } from "@kinotic-ai/core";
612
653
  declare class LogManager implements ILogManager {
613
654
  private readonly serviceProxy;
614
- constructor(kinotic: IKinotic7);
655
+ constructor(kinotic: IKinotic11);
615
656
  loggers(nodeId: string): Promise<LoggersDescriptor>;
616
657
  loggerLevels(nodeId: string, name: string): Promise<LoggerLevelsDescriptor>;
617
658
  configureLogLevel(nodeId: string, name: string, level: LogLevel): Promise<void>;
659
+ traceLog(nodeId: string): Promise<TraceLogProperties>;
660
+ configureTraceLog(nodeId: string, traceLog: TraceLogProperties): Promise<void>;
618
661
  }
619
662
  declare module "@kinotic-ai/core" {
620
663
  interface KinoticSingleton extends ISystemApiExtension {}
621
664
  }
622
- export { WorkloadStatusReport, WorkloadStatus, WorkloadServiceProxy, WorkloadOrchestrationService, Workload, VolumeMount, VmProviderType, VmNodeStatusType, VmNodeStatus, VmNodeServiceProxy, VmNodeRegistration, VmNodeOrchestrationServiceProxy, VmNode, SystemOrganizationService, SystemApiPlugin, SingleLoggerLevelsDescriptor, SYSTEM_API_ZONE, PortProtocol, PortMapping, NetworkPolicy, NetworkMode, LoggersDescriptor, LoggerLevelsDescriptor, LogPolicy, LogManager, LogLevel, KinoticNodeInfo, KinoticClusterInfoService, KinoticClusterInfo, IWorkloadService, IWorkloadOrchestrationService, IVmNodeService, ISystemOrganizationService, ISystemApiExtension, ILogManager, IKinoticClusterInfoService, GroupLoggerLevelsDescriptor };
665
+ export { GroupLoggerLevelsDescriptor, IKinoticClusterInfoService, ILlmConfigurationService, ILogManager, ISystemApiExtension, ISystemJobService, ISystemMemberService, ISystemOrganizationService, IVmNodeService, IWatchEventService, IWorkloadOrchestrationService, IWorkloadService, KinoticClusterInfo, KinoticClusterInfoService, KinoticNodeInfo, LlmConfiguration, LlmConfigurationService, LlmProviderType, LogLevel, LogManager, LoggerLevelsDescriptor, LoggersDescriptor, SYSTEM_API_ZONE, SingleLoggerLevelsDescriptor, SystemApiPlugin, SystemJobDescriptor, SystemJobService, SystemMemberService, SystemOrganizationService, TraceLogProperties, VmNode, VmNodeOrchestrationServiceProxy, VmNodeRegistration, VmNodeServiceProxy, VmNodeState, VmNodeStatusType, VmProviderType, WatchEventService, WorkloadOrchestrationService, WorkloadServiceProxy, WorkloadStatusReport };