@openkaiden/api 0.2.3 → 0.3.0-next.202606240904-41516c0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openkaiden/api",
3
- "version": "0.2.3",
3
+ "version": "0.3.0-next.202606240904-41516c0",
4
4
  "description": "API for Kaiden extensions",
5
5
  "repository": "https://github.com/openkaiden/kaiden",
6
6
  "publishConfig": {
@@ -12,8 +12,9 @@
12
12
  "files": [
13
13
  "src"
14
14
  ],
15
- "devDependencies": {
16
- "@ai-sdk/provider": "^3.0.10"
15
+ "dependencies": {
16
+ "@ai-sdk/provider": "^3.0.10",
17
+ "@openkaiden/workspace-configuration": "^0.14.0"
17
18
  },
18
19
  "scripts": {
19
20
  "clean": "rimraf lib *.tsbuildinfo",
@@ -42,6 +42,7 @@
42
42
  declare module '@openkaiden/api' {
43
43
  import type { ProviderV3 as AISDKInferenceProvider } from '@ai-sdk/provider';
44
44
  import type { components } from '@openkaiden/mcp-registry-types';
45
+ import type { components as workspaceConfigComponents } from '@openkaiden/workspace-configuration';
45
46
 
46
47
  /**
47
48
  * The version of Kaiden.
@@ -655,6 +656,7 @@ declare module '@openkaiden/api' {
655
656
  }
656
657
 
657
658
  export type InferenceProviderConnection = {
659
+ id: string;
658
660
  name: string;
659
661
  type: InferenceProviderConnectionType;
660
662
  llmMetadata?: LLMMetadata;
@@ -713,9 +715,12 @@ declare module '@openkaiden/api' {
713
715
  text: Uri;
714
716
  };
715
717
 
716
- export type ChunkProvider = {
718
+ export type ChunkProviderConnection = {
719
+ id: string;
717
720
  name: string;
718
721
  chunk(doc: Uri): Promise<Chunk[]>;
722
+ status(): ProviderConnectionStatus;
723
+ lifecycle?: ProviderConnectionLifecycle;
719
724
  };
720
725
 
721
726
  export interface ProviderInferenceConnection {
@@ -728,9 +733,9 @@ declare module '@openkaiden/api' {
728
733
  connection: RagProviderConnection;
729
734
  }
730
735
 
731
- export interface ProviderChunkerConnection {
736
+ export interface ProviderChunkProviderConnection {
732
737
  providerId: string;
733
- connection: ChunkProvider;
738
+ connection: ChunkProviderConnection;
734
739
  }
735
740
 
736
741
  export type ProviderConnection =
@@ -739,7 +744,8 @@ declare module '@openkaiden/api' {
739
744
  | VmProviderConnection
740
745
  | InferenceProviderConnection
741
746
  | RagProviderConnection
742
- | FlowProviderConnection;
747
+ | FlowProviderConnection
748
+ | ChunkProviderConnection;
743
749
 
744
750
  // common set of options for creating a provider
745
751
  export interface ProviderConnectionFactory {
@@ -762,6 +768,7 @@ declare module '@openkaiden/api' {
762
768
  // create programmatically a InferenceProviderConnection
763
769
  export interface InferenceProviderConnectionFactory extends ProviderConnectionFactory {
764
770
  connectionTypes: InferenceProviderConnectionType[];
771
+ llmMetadata?: LLMMetadata;
765
772
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
766
773
  create(params: { [key: string]: any }, logger?: Logger, token?: CancellationToken): Promise<void>;
767
774
  }
@@ -772,6 +779,11 @@ declare module '@openkaiden/api' {
772
779
  create(params: { [key: string]: any }, logger?: Logger, token?: CancellationToken): Promise<void>;
773
780
  }
774
781
 
782
+ export interface ChunkProviderConnectionFactory extends ProviderConnectionFactory {
783
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
784
+ create(params: { [key: string]: any }, logger?: Logger, token?: CancellationToken): Promise<void>;
785
+ }
786
+
775
787
  // create a kubernetes provider
776
788
  export interface KubernetesProviderConnectionFactory extends ProviderConnectionFactory {
777
789
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -979,6 +991,11 @@ declare module '@openkaiden/api' {
979
991
  connectionAuditor?: Auditor,
980
992
  ): Disposable;
981
993
 
994
+ setChunkProviderConnectionFactory(
995
+ chunkProviderConnectionFactory: ChunkProviderConnectionFactory,
996
+ connectionAuditor?: Auditor,
997
+ ): Disposable;
998
+
982
999
  registerContainerProviderConnection(connection: ContainerProviderConnection): Disposable;
983
1000
  registerKubernetesProviderConnection(connection: KubernetesProviderConnection): Disposable;
984
1001
  registerVmProviderConnection(connection: VmProviderConnection): Disposable;
@@ -987,6 +1004,8 @@ declare module '@openkaiden/api' {
987
1004
 
988
1005
  registerFlowProviderConnection(connection: FlowProviderConnection): Disposable;
989
1006
 
1007
+ registerChunkProviderConnection(connection: ChunkProviderConnection): Disposable;
1008
+
990
1009
  registerSkill(skill: CreateSkillParams): Disposable;
991
1010
 
992
1011
  registerLifecycle(lifecycle: ProviderLifecycle): Disposable;
@@ -1150,11 +1169,18 @@ declare module '@openkaiden/api' {
1150
1169
  providerId: string;
1151
1170
  connection: RagProviderConnection;
1152
1171
  }
1153
- export interface RegisterChunkerConnectionEvent {
1172
+ export interface RegisterChunkProviderConnectionEvent {
1154
1173
  providerId: string;
1174
+ connection: ChunkProviderConnection;
1175
+ }
1176
+ export interface UpdateChunkProviderConnectionEvent {
1177
+ providerId: string;
1178
+ connection: ChunkProviderConnection;
1179
+ status: ProviderConnectionStatus;
1155
1180
  }
1156
- export interface UnregisterChunkerConnectionEvent {
1181
+ export interface UnregisterChunkProviderConnectionEvent {
1157
1182
  providerId: string;
1183
+ connection: ChunkProviderConnection;
1158
1184
  }
1159
1185
 
1160
1186
  export interface RegisterFlowConnectionEvent {
@@ -1176,7 +1202,7 @@ declare module '@openkaiden/api' {
1176
1202
  }
1177
1203
 
1178
1204
  export interface ConnectionFactory {
1179
- type: 'container' | 'kubernetes' | 'vm';
1205
+ type: 'container' | 'kubernetes' | 'vm' | 'inference';
1180
1206
  providerId: string;
1181
1207
  }
1182
1208
 
@@ -5517,7 +5543,65 @@ declare module '@openkaiden/api' {
5517
5543
  constructor(url: string);
5518
5544
  }
5519
5545
 
5520
- export namespace rag {
5521
- export function registerChunkProvider(provider: ChunkProvider): Disposable;
5546
+ export type Runtime = 'openshell' | 'podman';
5547
+
5548
+ export interface ModelType {
5549
+ readonly name: string;
5550
+ }
5551
+
5552
+ export interface AcpConfiguration {
5553
+ readonly args: ReadonlyArray<string>;
5554
+ }
5555
+
5556
+ export interface AgentConfigurationBase {
5557
+ readonly path: string;
5558
+ read(): Promise<string>;
5559
+ }
5560
+ export interface AgentConfigurationFile extends AgentConfigurationBase {
5561
+ update(content: string): Promise<void>;
5562
+ }
5563
+
5564
+ export type AgentWorkspaceConfiguration = workspaceConfigComponents['schemas']['WorkspaceConfiguration'];
5565
+
5566
+ export interface AgentWorkspaceContext {
5567
+ readonly model: {
5568
+ readonly llmMetadata?: LLMMetadata;
5569
+ readonly model: InferenceModel;
5570
+ readonly endpoint?: string;
5571
+ };
5572
+ readonly configurationFiles: ReadonlyArray<AgentConfigurationFile>;
5573
+ readonly workspace: AgentWorkspaceConfiguration;
5574
+ }
5575
+
5576
+ export interface Agent {
5577
+ readonly id: string;
5578
+ readonly name: string;
5579
+ readonly description: string;
5580
+ readonly icon?: ProviderImages;
5581
+ readonly tags?: ReadonlyArray<string>;
5582
+ readonly command: string;
5583
+ readonly acp?: AcpConfiguration;
5584
+ readonly configurationFiles: ReadonlyArray<AgentConfigurationBase>;
5585
+ readonly baseImage?: string;
5586
+ /**
5587
+ * If relative path taken as relative to home folder of the sandbox user or
5588
+ * ${HOME}/path1/path2
5589
+ */
5590
+ readonly destinationSkillsFolder: string;
5591
+ isSupportedModelType?(type: ModelType): boolean | Promise<boolean>;
5592
+ isSupportedRuntime?(runtime: Runtime): boolean | Promise<boolean>;
5593
+ preWorkspaceStart(context: AgentWorkspaceContext): Promise<void>;
5594
+ }
5595
+
5596
+ export interface AgentRegisteredEvent {
5597
+ readonly agent: Agent;
5598
+ }
5599
+
5600
+ export interface AgentUnregisteredEvent {
5601
+ readonly id: string;
5602
+ }
5603
+
5604
+ export namespace agents {
5605
+ export function registerAgent(agent: Agent): Disposable;
5522
5606
  }
5523
5607
  }