@kinotic-ai/system-api 5.0.0-beta.24 → 5.0.0-beta.26

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
@@ -53,13 +53,15 @@ __export(exports_src, {
53
53
  SystemOrganizationService: () => SystemOrganizationService,
54
54
  SystemMemberService: () => SystemMemberService,
55
55
  SystemApiPlugin: () => SystemApiPlugin,
56
- SystemAccessService: () => SystemAccessService,
57
56
  SingleLoggerLevelsDescriptor: () => SingleLoggerLevelsDescriptor,
58
57
  SYSTEM_API_ZONE: () => import_management_api11.SYSTEM_API_ZONE,
59
58
  LoggersDescriptor: () => LoggersDescriptor,
60
59
  LoggerLevelsDescriptor: () => LoggerLevelsDescriptor,
61
60
  LogManager: () => LogManager,
62
61
  LogLevel: () => LogLevel,
62
+ LlmProviderType: () => LlmProviderType,
63
+ LlmConfigurationService: () => LlmConfigurationService,
64
+ LlmConfiguration: () => LlmConfiguration,
63
65
  KinoticNodeInfo: () => KinoticNodeInfo,
64
66
  KinoticClusterInfoService: () => KinoticClusterInfoService,
65
67
  KinoticClusterInfo: () => KinoticClusterInfo,
@@ -122,6 +124,30 @@ class VmNodeRegistration {
122
124
  this.hostname = hostname;
123
125
  }
124
126
  }
127
+ // packages/system-api/src/api/model/llm/LlmConfiguration.ts
128
+ class LlmConfiguration {
129
+ id = null;
130
+ name;
131
+ provider;
132
+ model;
133
+ endpoint = null;
134
+ maxTokens = null;
135
+ temperature = null;
136
+ apiKeyHeld = false;
137
+ created = null;
138
+ updated = null;
139
+ constructor(name, provider, model) {
140
+ this.name = name;
141
+ this.provider = provider;
142
+ this.model = model;
143
+ }
144
+ }
145
+ // packages/system-api/src/api/model/llm/LlmProviderType.ts
146
+ var LlmProviderType;
147
+ ((LlmProviderType2) => {
148
+ LlmProviderType2["ANTHROPIC"] = "ANTHROPIC";
149
+ LlmProviderType2["OPENAI"] = "OPENAI";
150
+ })(LlmProviderType ||= {});
125
151
  // packages/system-api/src/api/services/workload/IVmNodeService.ts
126
152
  var import_management_api2 = require("@kinotic-ai/management-api");
127
153
  var import_core = require("@kinotic-ai/core");
@@ -364,47 +390,47 @@ class SystemMemberService {
364
390
  }
365
391
  }
366
392
 
367
- // packages/system-api/src/api/services/ISystemAccessService.ts
393
+ // packages/system-api/src/api/services/IWatchEventService.ts
368
394
  var import_management_api9 = require("@kinotic-ai/management-api");
395
+ var import_core3 = require("@kinotic-ai/core");
369
396
 
370
- class SystemAccessService {
397
+ class WatchEventService {
371
398
  serviceProxy;
372
399
  constructor(kinotic) {
373
- this.serviceProxy = kinotic.serviceProxy(`${import_management_api9.SYSTEM_API_ZONE}~org.kinotic.system.api.services.SystemAccessService`);
400
+ this.serviceProxy = kinotic.serviceProxy(`${import_management_api9.SYSTEM_API_ZONE}~org.kinotic.system.api.services.WatchEventService`);
374
401
  }
375
- findRoles() {
376
- return this.serviceProxy.invoke("findRoles", []);
377
- }
378
- findGrants() {
379
- return this.serviceProxy.invoke("findGrants", []);
380
- }
381
- grant(subject, roleId) {
382
- return this.serviceProxy.invoke("grant", [subject, roleId]);
383
- }
384
- revoke(grantId) {
385
- return this.serviceProxy.invoke("revoke", [grantId]);
402
+ async findAll(pageable) {
403
+ const page = await this.findAllSinglePage(pageable);
404
+ return new import_core3.FunctionalIterablePage(pageable, page, (pageable2) => this.findAllSinglePage(pageable2));
386
405
  }
387
- explain(subject, permission) {
388
- return this.serviceProxy.invoke("explain", [subject, permission]);
406
+ findAllSinglePage(pageable) {
407
+ return this.serviceProxy.invoke("findAll", [pageable]);
389
408
  }
390
409
  }
391
410
 
392
- // packages/system-api/src/api/services/IWatchEventService.ts
411
+ // packages/system-api/src/api/services/ILlmConfigurationService.ts
393
412
  var import_management_api10 = require("@kinotic-ai/management-api");
394
- var import_core3 = require("@kinotic-ai/core");
395
413
 
396
- class WatchEventService {
414
+ class LlmConfigurationService {
397
415
  serviceProxy;
398
416
  constructor(kinotic) {
399
- this.serviceProxy = kinotic.serviceProxy(`${import_management_api10.SYSTEM_API_ZONE}~org.kinotic.system.api.services.WatchEventService`);
417
+ this.serviceProxy = kinotic.serviceProxy(`${import_management_api10.SYSTEM_API_ZONE}~org.kinotic.system.api.services.LlmConfigurationService`);
400
418
  }
401
- async findAll(pageable) {
402
- const page = await this.findAllSinglePage(pageable);
403
- return new import_core3.FunctionalIterablePage(pageable, page, (pageable2) => this.findAllSinglePage(pageable2));
404
- }
405
- findAllSinglePage(pageable) {
419
+ findAll(pageable) {
406
420
  return this.serviceProxy.invoke("findAll", [pageable]);
407
421
  }
422
+ findById(id) {
423
+ return this.serviceProxy.invoke("findById", [id]);
424
+ }
425
+ findByName(name) {
426
+ return this.serviceProxy.invoke("findByName", [name]);
427
+ }
428
+ save(configuration, apiKey) {
429
+ return this.serviceProxy.invoke("save", [configuration, apiKey]);
430
+ }
431
+ deleteById(id) {
432
+ return this.serviceProxy.invoke("deleteById", [id]);
433
+ }
408
434
  }
409
435
 
410
436
  // packages/system-api/src/api/SystemApiPlugin.ts
@@ -418,8 +444,8 @@ var SystemApiPlugin = {
418
444
  clusterInfo: new KinoticClusterInfoService(kinotic),
419
445
  systemOrganizations: new SystemOrganizationService(kinotic),
420
446
  systemMembers: new SystemMemberService(kinotic),
421
- systemAccess: new SystemAccessService(kinotic),
422
- watchEvents: new WatchEventService(kinotic)
447
+ watchEvents: new WatchEventService(kinotic),
448
+ llmConfigurations: new LlmConfigurationService(kinotic)
423
449
  };
424
450
  }
425
451
  };
package/dist/index.d.cts CHANGED
@@ -149,6 +149,39 @@ interface WorkloadStatusReport {
149
149
  /** When the node recorded this status, in epoch milliseconds. */
150
150
  updated: number;
151
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
+ }
152
185
  import { WatchEvent } from "@kinotic-ai/management-api";
153
186
  import { IKinotic } from "@kinotic-ai/core";
154
187
  import { CrudServiceProxy, ICrudServiceProxy, IterablePage, Page, Pageable } from "@kinotic-ai/core";
@@ -425,7 +458,7 @@ declare class KinoticClusterInfoService implements IKinoticClusterInfoService {
425
458
  constructor(kinotic: IKinotic5);
426
459
  getClusterInfo(): Promise<KinoticClusterInfo>;
427
460
  }
428
- import { Application, Organization, Project, PendingInviteSummary, UserParticipantIdentity } from "@kinotic-ai/management-api";
461
+ import { Application, Organization, Project, PendingInviteSummary, Member } from "@kinotic-ai/management-api";
429
462
  import { IKinotic as IKinotic6, Page as Page3, Pageable as Pageable3 } from "@kinotic-ai/core";
430
463
  /**
431
464
  * Cross-organization reads for platform operators. Published in the system zone, which only
@@ -441,8 +474,8 @@ interface ISystemOrganizationService {
441
474
  findApplications(organizationId: string, pageable: Pageable3): Promise<Page3<Application>>;
442
475
  findProjects(organizationId: string, pageable: Pageable3): Promise<Page3<Project>>;
443
476
  /** applicationId null = the organization's members */
444
- findMembers(organizationId: string, applicationId: string | null, pageable: Pageable3): Promise<Page3<UserParticipantIdentity>>;
445
- searchMembers(searchText: string, organizationId: string, applicationId: string | null, pageable: Pageable3): Promise<Page3<UserParticipantIdentity>>;
477
+ findMembers(organizationId: string, applicationId: string | null, pageable: Pageable3): Promise<Page3<Member>>;
478
+ searchMembers(searchText: string, organizationId: string, applicationId: string | null, pageable: Pageable3): Promise<Page3<Member>>;
446
479
  findPendingInvites(organizationId: string, applicationId: string | null, pageable: Pageable3): Promise<Page3<PendingInviteSummary>>;
447
480
  }
448
481
  declare class SystemOrganizationService implements ISystemOrganizationService {
@@ -454,11 +487,11 @@ declare class SystemOrganizationService implements ISystemOrganizationService {
454
487
  countOrganizations(): Promise<number>;
455
488
  findApplications(organizationId: string, pageable: Pageable3): Promise<Page3<Application>>;
456
489
  findProjects(organizationId: string, pageable: Pageable3): Promise<Page3<Project>>;
457
- findMembers(organizationId: string, applicationId: string | null, pageable: Pageable3): Promise<Page3<UserParticipantIdentity>>;
458
- searchMembers(searchText: string, organizationId: string, applicationId: string | null, pageable: Pageable3): Promise<Page3<UserParticipantIdentity>>;
490
+ findMembers(organizationId: string, applicationId: string | null, pageable: Pageable3): Promise<Page3<Member>>;
491
+ searchMembers(searchText: string, organizationId: string, applicationId: string | null, pageable: Pageable3): Promise<Page3<Member>>;
459
492
  findPendingInvites(organizationId: string, applicationId: string | null, pageable: Pageable3): Promise<Page3<PendingInviteSummary>>;
460
493
  }
461
- import { MachineParticipantIdentity, MachineProvisionResult, UserParticipantIdentity as UserParticipantIdentity2 } from "@kinotic-ai/management-api";
494
+ import { MachineParticipantIdentity, MachineProvisionResult, Member as Member2 } from "@kinotic-ai/management-api";
462
495
  import { IKinotic as IKinotic7, Page as Page4, Pageable as Pageable4 } from "@kinotic-ai/core";
463
496
  /**
464
497
  * The platform's own members: the operators who sign in to the system console, and the
@@ -468,8 +501,8 @@ import { IKinotic as IKinotic7, Page as Page4, Pageable as Pageable4 } from "@ki
468
501
  * manage through IMachineService.
469
502
  */
470
503
  interface ISystemMemberService {
471
- findUsers(pageable: Pageable4): Promise<Page4<UserParticipantIdentity2>>;
472
- searchUsers(searchText: string, pageable: Pageable4): Promise<Page4<UserParticipantIdentity2>>;
504
+ findUsers(pageable: Pageable4): Promise<Page4<Member2>>;
505
+ searchUsers(searchText: string, pageable: Pageable4): Promise<Page4<Member2>>;
473
506
  /** Lists the platform's machines, disabled ones included. */
474
507
  findMachines(pageable: Pageable4): Promise<Page4<MachineParticipantIdentity>>;
475
508
  /**
@@ -497,53 +530,16 @@ interface ISystemMemberService {
497
530
  declare class SystemMemberService implements ISystemMemberService {
498
531
  private readonly serviceProxy;
499
532
  constructor(kinotic: IKinotic7);
500
- findUsers(pageable: Pageable4): Promise<Page4<UserParticipantIdentity2>>;
501
- searchUsers(searchText: string, pageable: Pageable4): Promise<Page4<UserParticipantIdentity2>>;
533
+ findUsers(pageable: Pageable4): Promise<Page4<Member2>>;
534
+ searchUsers(searchText: string, pageable: Pageable4): Promise<Page4<Member2>>;
502
535
  findMachines(pageable: Pageable4): Promise<Page4<MachineParticipantIdentity>>;
503
536
  createMachine(displayName: string): Promise<MachineProvisionResult>;
504
537
  rotateSecret(machineId: string): Promise<string>;
505
538
  setMachineEnabled(machineId: string, enabled: boolean): Promise<void>;
506
539
  removeMachine(machineId: string): Promise<void>;
507
540
  }
508
- import { AccessExplanation, Grant, RoleDefinition, Subject } from "@kinotic-ai/management-api";
509
- import { IKinotic as IKinotic8 } from "@kinotic-ai/core";
510
- /**
511
- * Access control of the platform itself: the roles the platform's operators and machines can be
512
- * granted, and the grants made on the platform, which reach every organization and node on it. A
513
- * subject named must be one of the platform's own operators or machines.
514
- */
515
- interface ISystemAccessService {
516
- /** The built-in roles the model defines, each with the permissions it bundles. */
517
- findRoles(): Promise<RoleDefinition[]>;
518
- /** The grants made on the platform. */
519
- findGrants(): Promise<Grant[]>;
520
- /**
521
- * Grants a role to a platform operator or machine on the platform: the subject holds every
522
- * permission the role bundles on the platform and on everything on it.
523
- * @param subject a user naming an operator's or a machine's identity id
524
- * @param roleId a built-in role's id
525
- */
526
- grant(subject: Subject, roleId: string): Promise<Grant>;
527
- /** Revokes a grant made on the platform. */
528
- revoke(grantId: string): Promise<void>;
529
- /**
530
- * Whether a platform operator or machine holds a permission of the platform, and the grants it
531
- * holds the permission through.
532
- * @param permission the permission's short name, such as can_manage_workloads
533
- */
534
- explain(subject: Subject, permission: string): Promise<AccessExplanation>;
535
- }
536
- declare class SystemAccessService implements ISystemAccessService {
537
- private readonly serviceProxy;
538
- constructor(kinotic: IKinotic8);
539
- findRoles(): Promise<RoleDefinition[]>;
540
- findGrants(): Promise<Grant[]>;
541
- grant(subject: Subject, roleId: string): Promise<Grant>;
542
- revoke(grantId: string): Promise<void>;
543
- explain(subject: Subject, permission: string): Promise<AccessExplanation>;
544
- }
545
541
  import { WatchEvent as WatchEvent3 } from "@kinotic-ai/management-api";
546
- import { IKinotic as IKinotic9 } from "@kinotic-ai/core";
542
+ import { IKinotic as IKinotic8 } from "@kinotic-ai/core";
547
543
  import { IterablePage as IterablePage3, Pageable as Pageable5 } from "@kinotic-ai/core";
548
544
  /**
549
545
  * The ledger of every watched record on the platform.
@@ -560,10 +556,41 @@ interface IWatchEventService {
560
556
  }
561
557
  declare class WatchEventService implements IWatchEventService {
562
558
  private readonly serviceProxy;
563
- constructor(kinotic: IKinotic9);
559
+ constructor(kinotic: IKinotic8);
564
560
  findAll(pageable: Pageable5): Promise<IterablePage3<WatchEvent3>>;
565
561
  private findAllSinglePage;
566
562
  }
563
+ import { IKinotic as IKinotic9, Page as Page5, Pageable as Pageable6 } from "@kinotic-ai/core";
564
+ /**
565
+ * The large language models the platform's services call, each an LlmConfiguration that platform operators
566
+ * manage and a service selects by name. A configuration's API key is given on save and held in the platform's
567
+ * scope of the secret storage until a save gives another or the configuration is deleted. Published in the
568
+ * system zone, which only SYSTEM participants and the platform's own cluster members may address.
569
+ */
570
+ interface ILlmConfigurationService {
571
+ findAll(pageable: Pageable6): Promise<Page5<LlmConfiguration>>;
572
+ /** Resolves null when no configuration has the given id. */
573
+ findById(id: string): Promise<LlmConfiguration | null>;
574
+ /** Resolves null when no configuration has the given name. */
575
+ findByName(name: string): Promise<LlmConfiguration | null>;
576
+ /**
577
+ * Saves a configuration, new or changed, and makes apiKey, when given, the key it calls its provider with.
578
+ * A null or blank apiKey keeps the key held for the configuration, if any. Its name must be one no other
579
+ * configuration has.
580
+ */
581
+ save(configuration: LlmConfiguration, apiKey: string | null): Promise<LlmConfiguration>;
582
+ /** Deletes the configuration and the API key held for it. */
583
+ deleteById(id: string): Promise<void>;
584
+ }
585
+ declare class LlmConfigurationService implements ILlmConfigurationService {
586
+ private readonly serviceProxy;
587
+ constructor(kinotic: IKinotic9);
588
+ findAll(pageable: Pageable6): Promise<Page5<LlmConfiguration>>;
589
+ findById(id: string): Promise<LlmConfiguration | null>;
590
+ findByName(name: string): Promise<LlmConfiguration | null>;
591
+ save(configuration: LlmConfiguration, apiKey: string | null): Promise<LlmConfiguration>;
592
+ deleteById(id: string): Promise<void>;
593
+ }
567
594
  interface ISystemApiExtension {
568
595
  vmNodes: IVmNodeService;
569
596
  workloads: IWorkloadService;
@@ -572,8 +599,8 @@ interface ISystemApiExtension {
572
599
  clusterInfo: IKinoticClusterInfoService;
573
600
  systemOrganizations: ISystemOrganizationService;
574
601
  systemMembers: ISystemMemberService;
575
- systemAccess: ISystemAccessService;
576
602
  watchEvents: IWatchEventService;
603
+ llmConfigurations: ILlmConfigurationService;
577
604
  }
578
605
  declare const SystemApiPlugin: KinoticPlugin<ISystemApiExtension>;
579
606
  import { IKinotic as IKinotic10 } from "@kinotic-ai/core";
@@ -589,4 +616,4 @@ declare class LogManager implements ILogManager {
589
616
  declare module "@kinotic-ai/core" {
590
617
  interface KinoticSingleton extends ISystemApiExtension {}
591
618
  }
592
- export { WorkloadStatusReport, WorkloadServiceProxy, WorkloadOrchestrationService, WatchEventService, VmProviderType, VmNodeStatusType, VmNodeState, VmNodeServiceProxy, VmNodeRegistration, VmNodeOrchestrationServiceProxy, VmNode, TraceLogProperties, SystemOrganizationService, SystemMemberService, SystemApiPlugin, SystemAccessService, SingleLoggerLevelsDescriptor, SYSTEM_API_ZONE, LoggersDescriptor, LoggerLevelsDescriptor, LogManager, LogLevel, KinoticNodeInfo, KinoticClusterInfoService, KinoticClusterInfo, IWorkloadService, IWorkloadOrchestrationService, IWatchEventService, IVmNodeService, ISystemOrganizationService, ISystemMemberService, ISystemApiExtension, ISystemAccessService, ILogManager, IKinoticClusterInfoService, GroupLoggerLevelsDescriptor };
619
+ export { WorkloadStatusReport, WorkloadServiceProxy, WorkloadOrchestrationService, WatchEventService, VmProviderType, VmNodeStatusType, VmNodeState, VmNodeServiceProxy, VmNodeRegistration, VmNodeOrchestrationServiceProxy, VmNode, TraceLogProperties, SystemOrganizationService, SystemMemberService, SystemApiPlugin, SingleLoggerLevelsDescriptor, SYSTEM_API_ZONE, LoggersDescriptor, LoggerLevelsDescriptor, LogManager, LogLevel, LlmProviderType, LlmConfigurationService, LlmConfiguration, KinoticNodeInfo, KinoticClusterInfoService, KinoticClusterInfo, IWorkloadService, IWorkloadOrchestrationService, IWatchEventService, IVmNodeService, ISystemOrganizationService, ISystemMemberService, ISystemApiExtension, ILogManager, ILlmConfigurationService, IKinoticClusterInfoService, GroupLoggerLevelsDescriptor };
package/dist/index.d.ts CHANGED
@@ -149,6 +149,39 @@ interface WorkloadStatusReport {
149
149
  /** When the node recorded this status, in epoch milliseconds. */
150
150
  updated: number;
151
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
+ }
152
185
  import { WatchEvent } from "@kinotic-ai/management-api";
153
186
  import { IKinotic } from "@kinotic-ai/core";
154
187
  import { CrudServiceProxy, ICrudServiceProxy, IterablePage, Page, Pageable } from "@kinotic-ai/core";
@@ -425,7 +458,7 @@ declare class KinoticClusterInfoService implements IKinoticClusterInfoService {
425
458
  constructor(kinotic: IKinotic5);
426
459
  getClusterInfo(): Promise<KinoticClusterInfo>;
427
460
  }
428
- import { Application, Organization, Project, PendingInviteSummary, UserParticipantIdentity } from "@kinotic-ai/management-api";
461
+ import { Application, Organization, Project, PendingInviteSummary, Member } from "@kinotic-ai/management-api";
429
462
  import { IKinotic as IKinotic6, Page as Page3, Pageable as Pageable3 } from "@kinotic-ai/core";
430
463
  /**
431
464
  * Cross-organization reads for platform operators. Published in the system zone, which only
@@ -441,8 +474,8 @@ interface ISystemOrganizationService {
441
474
  findApplications(organizationId: string, pageable: Pageable3): Promise<Page3<Application>>;
442
475
  findProjects(organizationId: string, pageable: Pageable3): Promise<Page3<Project>>;
443
476
  /** applicationId null = the organization's members */
444
- findMembers(organizationId: string, applicationId: string | null, pageable: Pageable3): Promise<Page3<UserParticipantIdentity>>;
445
- searchMembers(searchText: string, organizationId: string, applicationId: string | null, pageable: Pageable3): Promise<Page3<UserParticipantIdentity>>;
477
+ findMembers(organizationId: string, applicationId: string | null, pageable: Pageable3): Promise<Page3<Member>>;
478
+ searchMembers(searchText: string, organizationId: string, applicationId: string | null, pageable: Pageable3): Promise<Page3<Member>>;
446
479
  findPendingInvites(organizationId: string, applicationId: string | null, pageable: Pageable3): Promise<Page3<PendingInviteSummary>>;
447
480
  }
448
481
  declare class SystemOrganizationService implements ISystemOrganizationService {
@@ -454,11 +487,11 @@ declare class SystemOrganizationService implements ISystemOrganizationService {
454
487
  countOrganizations(): Promise<number>;
455
488
  findApplications(organizationId: string, pageable: Pageable3): Promise<Page3<Application>>;
456
489
  findProjects(organizationId: string, pageable: Pageable3): Promise<Page3<Project>>;
457
- findMembers(organizationId: string, applicationId: string | null, pageable: Pageable3): Promise<Page3<UserParticipantIdentity>>;
458
- searchMembers(searchText: string, organizationId: string, applicationId: string | null, pageable: Pageable3): Promise<Page3<UserParticipantIdentity>>;
490
+ findMembers(organizationId: string, applicationId: string | null, pageable: Pageable3): Promise<Page3<Member>>;
491
+ searchMembers(searchText: string, organizationId: string, applicationId: string | null, pageable: Pageable3): Promise<Page3<Member>>;
459
492
  findPendingInvites(organizationId: string, applicationId: string | null, pageable: Pageable3): Promise<Page3<PendingInviteSummary>>;
460
493
  }
461
- import { MachineParticipantIdentity, MachineProvisionResult, UserParticipantIdentity as UserParticipantIdentity2 } from "@kinotic-ai/management-api";
494
+ import { MachineParticipantIdentity, MachineProvisionResult, Member as Member2 } from "@kinotic-ai/management-api";
462
495
  import { IKinotic as IKinotic7, Page as Page4, Pageable as Pageable4 } from "@kinotic-ai/core";
463
496
  /**
464
497
  * The platform's own members: the operators who sign in to the system console, and the
@@ -468,8 +501,8 @@ import { IKinotic as IKinotic7, Page as Page4, Pageable as Pageable4 } from "@ki
468
501
  * manage through IMachineService.
469
502
  */
470
503
  interface ISystemMemberService {
471
- findUsers(pageable: Pageable4): Promise<Page4<UserParticipantIdentity2>>;
472
- searchUsers(searchText: string, pageable: Pageable4): Promise<Page4<UserParticipantIdentity2>>;
504
+ findUsers(pageable: Pageable4): Promise<Page4<Member2>>;
505
+ searchUsers(searchText: string, pageable: Pageable4): Promise<Page4<Member2>>;
473
506
  /** Lists the platform's machines, disabled ones included. */
474
507
  findMachines(pageable: Pageable4): Promise<Page4<MachineParticipantIdentity>>;
475
508
  /**
@@ -497,53 +530,16 @@ interface ISystemMemberService {
497
530
  declare class SystemMemberService implements ISystemMemberService {
498
531
  private readonly serviceProxy;
499
532
  constructor(kinotic: IKinotic7);
500
- findUsers(pageable: Pageable4): Promise<Page4<UserParticipantIdentity2>>;
501
- searchUsers(searchText: string, pageable: Pageable4): Promise<Page4<UserParticipantIdentity2>>;
533
+ findUsers(pageable: Pageable4): Promise<Page4<Member2>>;
534
+ searchUsers(searchText: string, pageable: Pageable4): Promise<Page4<Member2>>;
502
535
  findMachines(pageable: Pageable4): Promise<Page4<MachineParticipantIdentity>>;
503
536
  createMachine(displayName: string): Promise<MachineProvisionResult>;
504
537
  rotateSecret(machineId: string): Promise<string>;
505
538
  setMachineEnabled(machineId: string, enabled: boolean): Promise<void>;
506
539
  removeMachine(machineId: string): Promise<void>;
507
540
  }
508
- import { AccessExplanation, Grant, RoleDefinition, Subject } from "@kinotic-ai/management-api";
509
- import { IKinotic as IKinotic8 } from "@kinotic-ai/core";
510
- /**
511
- * Access control of the platform itself: the roles the platform's operators and machines can be
512
- * granted, and the grants made on the platform, which reach every organization and node on it. A
513
- * subject named must be one of the platform's own operators or machines.
514
- */
515
- interface ISystemAccessService {
516
- /** The built-in roles the model defines, each with the permissions it bundles. */
517
- findRoles(): Promise<RoleDefinition[]>;
518
- /** The grants made on the platform. */
519
- findGrants(): Promise<Grant[]>;
520
- /**
521
- * Grants a role to a platform operator or machine on the platform: the subject holds every
522
- * permission the role bundles on the platform and on everything on it.
523
- * @param subject a user naming an operator's or a machine's identity id
524
- * @param roleId a built-in role's id
525
- */
526
- grant(subject: Subject, roleId: string): Promise<Grant>;
527
- /** Revokes a grant made on the platform. */
528
- revoke(grantId: string): Promise<void>;
529
- /**
530
- * Whether a platform operator or machine holds a permission of the platform, and the grants it
531
- * holds the permission through.
532
- * @param permission the permission's short name, such as can_manage_workloads
533
- */
534
- explain(subject: Subject, permission: string): Promise<AccessExplanation>;
535
- }
536
- declare class SystemAccessService implements ISystemAccessService {
537
- private readonly serviceProxy;
538
- constructor(kinotic: IKinotic8);
539
- findRoles(): Promise<RoleDefinition[]>;
540
- findGrants(): Promise<Grant[]>;
541
- grant(subject: Subject, roleId: string): Promise<Grant>;
542
- revoke(grantId: string): Promise<void>;
543
- explain(subject: Subject, permission: string): Promise<AccessExplanation>;
544
- }
545
541
  import { WatchEvent as WatchEvent3 } from "@kinotic-ai/management-api";
546
- import { IKinotic as IKinotic9 } from "@kinotic-ai/core";
542
+ import { IKinotic as IKinotic8 } from "@kinotic-ai/core";
547
543
  import { IterablePage as IterablePage3, Pageable as Pageable5 } from "@kinotic-ai/core";
548
544
  /**
549
545
  * The ledger of every watched record on the platform.
@@ -560,10 +556,41 @@ interface IWatchEventService {
560
556
  }
561
557
  declare class WatchEventService implements IWatchEventService {
562
558
  private readonly serviceProxy;
563
- constructor(kinotic: IKinotic9);
559
+ constructor(kinotic: IKinotic8);
564
560
  findAll(pageable: Pageable5): Promise<IterablePage3<WatchEvent3>>;
565
561
  private findAllSinglePage;
566
562
  }
563
+ import { IKinotic as IKinotic9, Page as Page5, Pageable as Pageable6 } from "@kinotic-ai/core";
564
+ /**
565
+ * The large language models the platform's services call, each an LlmConfiguration that platform operators
566
+ * manage and a service selects by name. A configuration's API key is given on save and held in the platform's
567
+ * scope of the secret storage until a save gives another or the configuration is deleted. Published in the
568
+ * system zone, which only SYSTEM participants and the platform's own cluster members may address.
569
+ */
570
+ interface ILlmConfigurationService {
571
+ findAll(pageable: Pageable6): Promise<Page5<LlmConfiguration>>;
572
+ /** Resolves null when no configuration has the given id. */
573
+ findById(id: string): Promise<LlmConfiguration | null>;
574
+ /** Resolves null when no configuration has the given name. */
575
+ findByName(name: string): Promise<LlmConfiguration | null>;
576
+ /**
577
+ * Saves a configuration, new or changed, and makes apiKey, when given, the key it calls its provider with.
578
+ * A null or blank apiKey keeps the key held for the configuration, if any. Its name must be one no other
579
+ * configuration has.
580
+ */
581
+ save(configuration: LlmConfiguration, apiKey: string | null): Promise<LlmConfiguration>;
582
+ /** Deletes the configuration and the API key held for it. */
583
+ deleteById(id: string): Promise<void>;
584
+ }
585
+ declare class LlmConfigurationService implements ILlmConfigurationService {
586
+ private readonly serviceProxy;
587
+ constructor(kinotic: IKinotic9);
588
+ findAll(pageable: Pageable6): Promise<Page5<LlmConfiguration>>;
589
+ findById(id: string): Promise<LlmConfiguration | null>;
590
+ findByName(name: string): Promise<LlmConfiguration | null>;
591
+ save(configuration: LlmConfiguration, apiKey: string | null): Promise<LlmConfiguration>;
592
+ deleteById(id: string): Promise<void>;
593
+ }
567
594
  interface ISystemApiExtension {
568
595
  vmNodes: IVmNodeService;
569
596
  workloads: IWorkloadService;
@@ -572,8 +599,8 @@ interface ISystemApiExtension {
572
599
  clusterInfo: IKinoticClusterInfoService;
573
600
  systemOrganizations: ISystemOrganizationService;
574
601
  systemMembers: ISystemMemberService;
575
- systemAccess: ISystemAccessService;
576
602
  watchEvents: IWatchEventService;
603
+ llmConfigurations: ILlmConfigurationService;
577
604
  }
578
605
  declare const SystemApiPlugin: KinoticPlugin<ISystemApiExtension>;
579
606
  import { IKinotic as IKinotic10 } from "@kinotic-ai/core";
@@ -589,4 +616,4 @@ declare class LogManager implements ILogManager {
589
616
  declare module "@kinotic-ai/core" {
590
617
  interface KinoticSingleton extends ISystemApiExtension {}
591
618
  }
592
- export { WorkloadStatusReport, WorkloadServiceProxy, WorkloadOrchestrationService, WatchEventService, VmProviderType, VmNodeStatusType, VmNodeState, VmNodeServiceProxy, VmNodeRegistration, VmNodeOrchestrationServiceProxy, VmNode, TraceLogProperties, SystemOrganizationService, SystemMemberService, SystemApiPlugin, SystemAccessService, SingleLoggerLevelsDescriptor, SYSTEM_API_ZONE, LoggersDescriptor, LoggerLevelsDescriptor, LogManager, LogLevel, KinoticNodeInfo, KinoticClusterInfoService, KinoticClusterInfo, IWorkloadService, IWorkloadOrchestrationService, IWatchEventService, IVmNodeService, ISystemOrganizationService, ISystemMemberService, ISystemApiExtension, ISystemAccessService, ILogManager, IKinoticClusterInfoService, GroupLoggerLevelsDescriptor };
619
+ export { WorkloadStatusReport, WorkloadServiceProxy, WorkloadOrchestrationService, WatchEventService, VmProviderType, VmNodeStatusType, VmNodeState, VmNodeServiceProxy, VmNodeRegistration, VmNodeOrchestrationServiceProxy, VmNode, TraceLogProperties, SystemOrganizationService, SystemMemberService, SystemApiPlugin, SingleLoggerLevelsDescriptor, SYSTEM_API_ZONE, LoggersDescriptor, LoggerLevelsDescriptor, LogManager, LogLevel, LlmProviderType, LlmConfigurationService, LlmConfiguration, KinoticNodeInfo, KinoticClusterInfoService, KinoticClusterInfo, IWorkloadService, IWorkloadOrchestrationService, IWatchEventService, IVmNodeService, ISystemOrganizationService, ISystemMemberService, ISystemApiExtension, ILogManager, ILlmConfigurationService, IKinoticClusterInfoService, GroupLoggerLevelsDescriptor };
package/dist/index.js CHANGED
@@ -55,6 +55,30 @@ class VmNodeRegistration {
55
55
  this.hostname = hostname;
56
56
  }
57
57
  }
58
+ // packages/system-api/src/api/model/llm/LlmConfiguration.ts
59
+ class LlmConfiguration {
60
+ id = null;
61
+ name;
62
+ provider;
63
+ model;
64
+ endpoint = null;
65
+ maxTokens = null;
66
+ temperature = null;
67
+ apiKeyHeld = false;
68
+ created = null;
69
+ updated = null;
70
+ constructor(name, provider, model) {
71
+ this.name = name;
72
+ this.provider = provider;
73
+ this.model = model;
74
+ }
75
+ }
76
+ // packages/system-api/src/api/model/llm/LlmProviderType.ts
77
+ var LlmProviderType;
78
+ ((LlmProviderType2) => {
79
+ LlmProviderType2["ANTHROPIC"] = "ANTHROPIC";
80
+ LlmProviderType2["OPENAI"] = "OPENAI";
81
+ })(LlmProviderType ||= {});
58
82
  // packages/system-api/src/api/services/workload/IVmNodeService.ts
59
83
  import { SYSTEM_API_ZONE } from "@kinotic-ai/management-api";
60
84
  import { CrudServiceProxy, FunctionalIterablePage } from "@kinotic-ai/core";
@@ -301,49 +325,47 @@ class SystemMemberService {
301
325
  }
302
326
  }
303
327
 
304
- // packages/system-api/src/api/services/ISystemAccessService.ts
305
- import {
306
- SYSTEM_API_ZONE as SYSTEM_API_ZONE8
307
- } from "@kinotic-ai/management-api";
328
+ // packages/system-api/src/api/services/IWatchEventService.ts
329
+ import { SYSTEM_API_ZONE as SYSTEM_API_ZONE8 } from "@kinotic-ai/management-api";
330
+ import { FunctionalIterablePage as FunctionalIterablePage3 } from "@kinotic-ai/core";
308
331
 
309
- class SystemAccessService {
332
+ class WatchEventService {
310
333
  serviceProxy;
311
334
  constructor(kinotic) {
312
- this.serviceProxy = kinotic.serviceProxy(`${SYSTEM_API_ZONE8}~org.kinotic.system.api.services.SystemAccessService`);
313
- }
314
- findRoles() {
315
- return this.serviceProxy.invoke("findRoles", []);
316
- }
317
- findGrants() {
318
- return this.serviceProxy.invoke("findGrants", []);
319
- }
320
- grant(subject, roleId) {
321
- return this.serviceProxy.invoke("grant", [subject, roleId]);
335
+ this.serviceProxy = kinotic.serviceProxy(`${SYSTEM_API_ZONE8}~org.kinotic.system.api.services.WatchEventService`);
322
336
  }
323
- revoke(grantId) {
324
- return this.serviceProxy.invoke("revoke", [grantId]);
337
+ async findAll(pageable) {
338
+ const page = await this.findAllSinglePage(pageable);
339
+ return new FunctionalIterablePage3(pageable, page, (pageable2) => this.findAllSinglePage(pageable2));
325
340
  }
326
- explain(subject, permission) {
327
- return this.serviceProxy.invoke("explain", [subject, permission]);
341
+ findAllSinglePage(pageable) {
342
+ return this.serviceProxy.invoke("findAll", [pageable]);
328
343
  }
329
344
  }
330
345
 
331
- // packages/system-api/src/api/services/IWatchEventService.ts
346
+ // packages/system-api/src/api/services/ILlmConfigurationService.ts
332
347
  import { SYSTEM_API_ZONE as SYSTEM_API_ZONE9 } from "@kinotic-ai/management-api";
333
- import { FunctionalIterablePage as FunctionalIterablePage3 } from "@kinotic-ai/core";
334
348
 
335
- class WatchEventService {
349
+ class LlmConfigurationService {
336
350
  serviceProxy;
337
351
  constructor(kinotic) {
338
- this.serviceProxy = kinotic.serviceProxy(`${SYSTEM_API_ZONE9}~org.kinotic.system.api.services.WatchEventService`);
339
- }
340
- async findAll(pageable) {
341
- const page = await this.findAllSinglePage(pageable);
342
- return new FunctionalIterablePage3(pageable, page, (pageable2) => this.findAllSinglePage(pageable2));
352
+ this.serviceProxy = kinotic.serviceProxy(`${SYSTEM_API_ZONE9}~org.kinotic.system.api.services.LlmConfigurationService`);
343
353
  }
344
- findAllSinglePage(pageable) {
354
+ findAll(pageable) {
345
355
  return this.serviceProxy.invoke("findAll", [pageable]);
346
356
  }
357
+ findById(id) {
358
+ return this.serviceProxy.invoke("findById", [id]);
359
+ }
360
+ findByName(name) {
361
+ return this.serviceProxy.invoke("findByName", [name]);
362
+ }
363
+ save(configuration, apiKey) {
364
+ return this.serviceProxy.invoke("save", [configuration, apiKey]);
365
+ }
366
+ deleteById(id) {
367
+ return this.serviceProxy.invoke("deleteById", [id]);
368
+ }
347
369
  }
348
370
 
349
371
  // packages/system-api/src/api/SystemApiPlugin.ts
@@ -357,8 +379,8 @@ var SystemApiPlugin = {
357
379
  clusterInfo: new KinoticClusterInfoService(kinotic),
358
380
  systemOrganizations: new SystemOrganizationService(kinotic),
359
381
  systemMembers: new SystemMemberService(kinotic),
360
- systemAccess: new SystemAccessService(kinotic),
361
- watchEvents: new WatchEventService(kinotic)
382
+ watchEvents: new WatchEventService(kinotic),
383
+ llmConfigurations: new LlmConfigurationService(kinotic)
362
384
  };
363
385
  }
364
386
  };
@@ -395,13 +417,15 @@ export {
395
417
  SystemOrganizationService,
396
418
  SystemMemberService,
397
419
  SystemApiPlugin,
398
- SystemAccessService,
399
420
  SingleLoggerLevelsDescriptor,
400
421
  SYSTEM_API_ZONE10 as SYSTEM_API_ZONE,
401
422
  LoggersDescriptor,
402
423
  LoggerLevelsDescriptor,
403
424
  LogManager,
404
425
  LogLevel,
426
+ LlmProviderType,
427
+ LlmConfigurationService,
428
+ LlmConfiguration,
405
429
  KinoticNodeInfo,
406
430
  KinoticClusterInfoService,
407
431
  KinoticClusterInfo,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kinotic-ai/system-api",
3
- "version": "5.0.0-beta.24",
3
+ "version": "5.0.0-beta.26",
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.17",
42
- "@kinotic-ai/management-api": "^5.0.0-beta.46"
41
+ "@kinotic-ai/core": "^5.0.0-beta.25",
42
+ "@kinotic-ai/management-api": "^5.0.0-beta.59"
43
43
  },
44
44
  "devDependencies": {
45
- "@kinotic-ai/core": "5.0.0-beta.17",
46
- "@kinotic-ai/management-api": "5.0.0-beta.46",
45
+ "@kinotic-ai/core": "5.0.0-beta.25",
46
+ "@kinotic-ai/management-api": "5.0.0-beta.59",
47
47
  "@types/bun": "^1.3.9",
48
48
  "typescript": "^5.9.3"
49
49
  }