@kortex-app/api 0.0.1-next.202511272106-5d30d1b8e → 0.0.1-next.202511281152-57a8bc669
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 +1 -1
- package/src/extension-api.d.ts +95 -0
package/package.json
CHANGED
package/src/extension-api.d.ts
CHANGED
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
|
|
42
42
|
declare module '@kortex-app/api' {
|
|
43
43
|
import type { ProviderV2 as AISDKInferenceProvider } from '@ai-sdk/provider';
|
|
44
|
+
import type { components } from '@kortex-hub/mcp-registry-types';
|
|
44
45
|
|
|
45
46
|
/**
|
|
46
47
|
* The version of Kortex.
|
|
@@ -650,16 +651,78 @@ declare module '@kortex-app/api' {
|
|
|
650
651
|
models: Array<InferenceModel>;
|
|
651
652
|
};
|
|
652
653
|
|
|
654
|
+
export interface InputResponse {
|
|
655
|
+
value: string;
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
export interface InputWithVariableResponse extends InputResponse {
|
|
659
|
+
variables: Record<string, InputResponse>;
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
export interface MCPRemoteServerConfig {
|
|
663
|
+
type: 'remote';
|
|
664
|
+
index: number;
|
|
665
|
+
headers: Record<string, InputWithVariableResponse>;
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
export interface MCPPackageServerConfig {
|
|
669
|
+
type: 'package';
|
|
670
|
+
index: number;
|
|
671
|
+
runtimeArguments: Record<number, InputWithVariableResponse>;
|
|
672
|
+
packageArguments: Record<number, InputWithVariableResponse>;
|
|
673
|
+
environmentVariables: Record<string, InputWithVariableResponse>;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
export type MCPServerConfig = MCPRemoteServerConfig | MCPPackageServerConfig;
|
|
677
|
+
|
|
678
|
+
export type MCPServerDetail = components['schemas']['ServerDetail'];
|
|
679
|
+
|
|
680
|
+
export type MCPServer = {
|
|
681
|
+
serverId: string;
|
|
682
|
+
config: MCPServerConfig;
|
|
683
|
+
};
|
|
684
|
+
|
|
685
|
+
export type RegisterServerResult = Disposable & { serverId: string };
|
|
686
|
+
|
|
687
|
+
export type RagProviderConnection = {
|
|
688
|
+
name: string;
|
|
689
|
+
mcpServer: MCPServer;
|
|
690
|
+
index(doc: Uri, chunks: Uri[]): Promise<void>;
|
|
691
|
+
deindex(doc: Uri): Promise<void>;
|
|
692
|
+
lifecycle?: ProviderConnectionLifecycle;
|
|
693
|
+
status(): ProviderConnectionStatus;
|
|
694
|
+
};
|
|
695
|
+
|
|
696
|
+
export type Chunk = {
|
|
697
|
+
text: Uri;
|
|
698
|
+
};
|
|
699
|
+
|
|
700
|
+
export type ChunkProvider = {
|
|
701
|
+
name: string;
|
|
702
|
+
chunk(doc: Uri): Promise<Chunk[]>;
|
|
703
|
+
};
|
|
704
|
+
|
|
653
705
|
export interface ProviderInferenceConnection {
|
|
654
706
|
providerId: string;
|
|
655
707
|
connection: InferenceProviderConnection;
|
|
656
708
|
}
|
|
657
709
|
|
|
710
|
+
export interface ProviderRagConnection {
|
|
711
|
+
providerId: string;
|
|
712
|
+
connection: RagProviderConnection;
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
export interface ProviderChunkerConnection {
|
|
716
|
+
providerId: string;
|
|
717
|
+
connection: ChunkProvider;
|
|
718
|
+
}
|
|
719
|
+
|
|
658
720
|
export type ProviderConnection =
|
|
659
721
|
| ContainerProviderConnection
|
|
660
722
|
| KubernetesProviderConnection
|
|
661
723
|
| VmProviderConnection
|
|
662
724
|
| InferenceProviderConnection
|
|
725
|
+
| RagProviderConnection
|
|
663
726
|
| FlowProviderConnection;
|
|
664
727
|
|
|
665
728
|
// common set of options for creating a provider
|
|
@@ -686,6 +749,12 @@ declare module '@kortex-app/api' {
|
|
|
686
749
|
create(params: { [key: string]: any }, logger?: Logger, token?: CancellationToken): Promise<void>;
|
|
687
750
|
}
|
|
688
751
|
|
|
752
|
+
// create programmatically a RagProviderConnection
|
|
753
|
+
export interface RagProviderConnectionFactory extends ProviderConnectionFactory {
|
|
754
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
755
|
+
create(params: { [key: string]: any }, logger?: Logger, token?: CancellationToken): Promise<void>;
|
|
756
|
+
}
|
|
757
|
+
|
|
689
758
|
// create a kubernetes provider
|
|
690
759
|
export interface KubernetesProviderConnectionFactory extends ProviderConnectionFactory {
|
|
691
760
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -883,10 +952,16 @@ declare module '@kortex-app/api' {
|
|
|
883
952
|
connectionAuditor?: Auditor,
|
|
884
953
|
): Disposable;
|
|
885
954
|
|
|
955
|
+
setRagProviderConnectionFactory(
|
|
956
|
+
ragProviderConnectionFactory: RagProviderConnectionFactory,
|
|
957
|
+
connectionAuditor?: Auditor,
|
|
958
|
+
): Disposable;
|
|
959
|
+
|
|
886
960
|
registerContainerProviderConnection(connection: ContainerProviderConnection): Disposable;
|
|
887
961
|
registerKubernetesProviderConnection(connection: KubernetesProviderConnection): Disposable;
|
|
888
962
|
registerVmProviderConnection(connection: VmProviderConnection): Disposable;
|
|
889
963
|
registerInferenceProviderConnection(connection: InferenceProviderConnection): Disposable;
|
|
964
|
+
registerRagProviderConnection(connection: RagProviderConnection): Disposable;
|
|
890
965
|
|
|
891
966
|
registerFlowProviderConnection(connection: FlowProviderConnection): Disposable;
|
|
892
967
|
|
|
@@ -1038,6 +1113,18 @@ declare module '@kortex-app/api' {
|
|
|
1038
1113
|
export interface UnregisterInferenceConnectionEvent {
|
|
1039
1114
|
providerId: string;
|
|
1040
1115
|
}
|
|
1116
|
+
export interface RegisterRagConnectionEvent {
|
|
1117
|
+
providerId: string;
|
|
1118
|
+
}
|
|
1119
|
+
export interface UnregisterRagConnectionEvent {
|
|
1120
|
+
providerId: string;
|
|
1121
|
+
}
|
|
1122
|
+
export interface RegisterChunkerConnectionEvent {
|
|
1123
|
+
providerId: string;
|
|
1124
|
+
}
|
|
1125
|
+
export interface UnregisterChunkerConnectionEvent {
|
|
1126
|
+
providerId: string;
|
|
1127
|
+
}
|
|
1041
1128
|
|
|
1042
1129
|
export interface RegisterFlowConnectionEvent {
|
|
1043
1130
|
providerId: string;
|
|
@@ -1243,6 +1330,7 @@ declare module '@kortex-app/api' {
|
|
|
1243
1330
|
export const onDidRegisterContainerConnection: Event<RegisterContainerConnectionEvent>;
|
|
1244
1331
|
export function getContainerConnections(): ProviderContainerConnection[];
|
|
1245
1332
|
export function getInferenceConnections(): ProviderInferenceConnection[];
|
|
1333
|
+
export function getRagConnections(): ProviderRagConnection[];
|
|
1246
1334
|
/**
|
|
1247
1335
|
* It returns the lifecycle context for the provider connection.
|
|
1248
1336
|
* If no context is found it throws an error
|
|
@@ -1444,6 +1532,9 @@ declare module '@kortex-app/api' {
|
|
|
1444
1532
|
export const onDidRegisterRegistry: Event<MCPRegistry>;
|
|
1445
1533
|
export const onDidUpdateRegistry: Event<MCPRegistry>;
|
|
1446
1534
|
export const onDidUnregisterRegistry: Event<MCPRegistry>;
|
|
1535
|
+
|
|
1536
|
+
export function registerServer(server: MCPServerDetail): RegisterServerResult;
|
|
1537
|
+
export function unregisterServer(serverId: string): void;
|
|
1447
1538
|
}
|
|
1448
1539
|
|
|
1449
1540
|
export namespace tray {
|
|
@@ -5247,4 +5338,8 @@ declare module '@kortex-app/api' {
|
|
|
5247
5338
|
*/
|
|
5248
5339
|
constructor(url: string);
|
|
5249
5340
|
}
|
|
5341
|
+
|
|
5342
|
+
export namespace rag {
|
|
5343
|
+
export function registerChunkProvider(provider: ChunkProvider): Disposable;
|
|
5344
|
+
}
|
|
5250
5345
|
}
|