@ultrst-armada/kloks 1.15.0 → 1.17.0
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/.krusbl-release-attestation.json +3 -3
- package/package.json +1 -1
- package/packages/backend/dist/ai-inference/index.d.ts +1 -1
- package/packages/backend/dist/ai-keys/index.d.ts +4 -47
- package/packages/backend/dist/ai-keys/index.js +1 -1
- package/packages/backend/dist/ai-models/index.d.ts +3 -35
- package/packages/backend/dist/ai-models/index.js +2 -2
- package/packages/backend/dist/ai-provider/index.d.ts +2 -2
- package/packages/backend/dist/ai-routing/index.d.ts +1 -1
- package/packages/backend/dist/ai-routing/index.js +3 -3
- package/packages/backend/dist/{chunk-F4J4YPUR.js → chunk-4WUVDLIQ.js} +1 -1
- package/packages/backend/dist/{chunk-HXFTSHCP.js → chunk-F7JDIU2C.js} +1 -1
- package/packages/backend/dist/{chunk-6YBBOHHG.js → chunk-RSKFM7AC.js} +10 -3
- package/packages/backend/dist/{chunk-AQT3GIXB.js → chunk-UYXROZPP.js} +2 -2
- package/packages/backend/dist/index.d.ts +5 -3
- package/packages/backend/dist/index.js +4 -4
- package/packages/backend/dist/krnl-ai-services.d.ts +18 -0
- package/packages/backend/dist/krnl-ai-services.js +4 -4
- package/packages/backend/dist/types-B0aSwTAt.d.ts +47 -0
- package/packages/backend/dist/{types-2p2AhboE.d.ts → types-Di4ZAQYA.d.ts} +1 -1
- package/packages/backend/dist/types-fYUdf9oB.d.ts +36 -0
- package/packages/state-graph/dist/index.js +14 -14
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schema": 1,
|
|
3
3
|
"packageName": "@ultrst-armada/kloks",
|
|
4
|
-
"version": "1.
|
|
5
|
-
"sourceCommit": "
|
|
4
|
+
"version": "1.17.0",
|
|
5
|
+
"sourceCommit": "b54b0084d09f1e314ac1c1ab6e4ed320a623025f",
|
|
6
6
|
"releaseWorkflow": "npm Release",
|
|
7
|
-
"workflowRunId": "
|
|
7
|
+
"workflowRunId": "40837780737"
|
|
8
8
|
}
|
package/package.json
CHANGED
|
@@ -1,48 +1,5 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @file types.ts
|
|
5
|
-
* @description Canonical AI Key Management contracts and types for @ultrst-armada/kloks/backend
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
type RotationStrategy = 'lowest-latency' | 'round-robin' | 'weighted-random' | 'failover-priority';
|
|
9
|
-
interface ApiKeyEntry {
|
|
10
|
-
id: string;
|
|
11
|
-
providerId: ProviderId;
|
|
12
|
-
label: string;
|
|
13
|
-
key: string;
|
|
14
|
-
keyValue?: string;
|
|
15
|
-
status: 'active' | 'valid' | 'invalid' | 'rate-limited' | 'checking';
|
|
16
|
-
isActive: boolean;
|
|
17
|
-
createdAt: string;
|
|
18
|
-
weight: number;
|
|
19
|
-
remainingCreditsUsd: number | null;
|
|
20
|
-
totalCalls: number;
|
|
21
|
-
successfulCalls: number;
|
|
22
|
-
failedCalls: number;
|
|
23
|
-
lastLatencyMs: number;
|
|
24
|
-
errorCount: number;
|
|
25
|
-
lifespanSeconds?: number | null;
|
|
26
|
-
expiresAt?: string | null;
|
|
27
|
-
lastUsedAt?: string | null;
|
|
28
|
-
validationError?: string | null;
|
|
29
|
-
failedModels?: string[];
|
|
30
|
-
}
|
|
31
|
-
interface KeyValidationResult {
|
|
32
|
-
valid: boolean;
|
|
33
|
-
status: 'valid' | 'invalid' | 'rate-limited';
|
|
34
|
-
error?: string;
|
|
35
|
-
latencyMs: number;
|
|
36
|
-
}
|
|
37
|
-
interface KeyModelUsageStats {
|
|
38
|
-
keyId: string;
|
|
39
|
-
modelId: string;
|
|
40
|
-
totalCalls: number;
|
|
41
|
-
successfulCalls: number;
|
|
42
|
-
failedCalls: number;
|
|
43
|
-
lastUsedAt?: string;
|
|
44
|
-
avgLatencyMs?: number;
|
|
45
|
-
}
|
|
1
|
+
import { a as KeyValidationResult, A as ApiKeyEntry, R as RotationStrategy, K as KeyModelUsageStats } from '../types-B0aSwTAt.js';
|
|
2
|
+
import { P as ProviderId } from '../types-Di4ZAQYA.js';
|
|
46
3
|
|
|
47
4
|
/**
|
|
48
5
|
* @file keyValidator.ts
|
|
@@ -76,7 +33,7 @@ declare class KeyStoreService {
|
|
|
76
33
|
private roundRobinIndices;
|
|
77
34
|
private forcedNextKeys;
|
|
78
35
|
private permanentKeys;
|
|
79
|
-
getKeys(providerId?: ProviderId): ApiKeyEntry[];
|
|
36
|
+
getKeys(providerId?: ProviderId, _modelId?: string): ApiKeyEntry[];
|
|
80
37
|
getKey(id: string): ApiKeyEntry | undefined;
|
|
81
38
|
getActiveKey(providerId: ProviderId): ApiKeyEntry | undefined;
|
|
82
39
|
setStrategy(strategy: RotationStrategy): void;
|
|
@@ -109,4 +66,4 @@ declare class KeyStoreService {
|
|
|
109
66
|
}
|
|
110
67
|
declare const keyStore: KeyStoreService;
|
|
111
68
|
|
|
112
|
-
export {
|
|
69
|
+
export { ApiKeyEntry, KeyModelUsageStats, KeyStoreService, KeyValidationResult, KeysStorage, RotationStrategy, keyStore, keysStorage, validateApiKey };
|
|
@@ -1,39 +1,7 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { M as ModelCatalogEntry, a as ModelHealthStatus } from '../types-fYUdf9oB.js';
|
|
2
|
+
import { P as ProviderId } from '../types-Di4ZAQYA.js';
|
|
2
3
|
import { b as AITransportClient } from '../AITransportClient-dToGr8nj.js';
|
|
3
4
|
|
|
4
|
-
/**
|
|
5
|
-
* @file types.ts
|
|
6
|
-
* @description Canonical Model Catalog and Discovery types for @ultrst-armada/kloks/backend
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
interface ModelCatalogEntry {
|
|
10
|
-
id: string;
|
|
11
|
-
name: string;
|
|
12
|
-
providerId: ProviderId;
|
|
13
|
-
contextWindow?: number;
|
|
14
|
-
inputCostPer1k?: number;
|
|
15
|
-
outputCostPer1k?: number;
|
|
16
|
-
supportsTools?: boolean;
|
|
17
|
-
supportsVision?: boolean;
|
|
18
|
-
supportsJson?: boolean;
|
|
19
|
-
isFree?: boolean;
|
|
20
|
-
latencyRatingMs?: number;
|
|
21
|
-
qualityRating?: number;
|
|
22
|
-
maxOutputTokens?: number;
|
|
23
|
-
status?: 'active' | 'deprecated' | 'offline' | 'online' | 'currently_unavailable';
|
|
24
|
-
runtimeStats?: Record<string, any>;
|
|
25
|
-
description?: string;
|
|
26
|
-
}
|
|
27
|
-
interface ModelHealthStatus {
|
|
28
|
-
modelId: string;
|
|
29
|
-
providerId: ProviderId;
|
|
30
|
-
isHealthy: boolean;
|
|
31
|
-
latencyMs: number;
|
|
32
|
-
consecutiveFailures: number;
|
|
33
|
-
lastCheckedAt: string;
|
|
34
|
-
lastError?: string;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
5
|
/**
|
|
38
6
|
* @file catalogData.ts
|
|
39
7
|
* @description Builtin static AI Model Catalog data across major providers
|
|
@@ -101,4 +69,4 @@ declare class ModelCatalogService {
|
|
|
101
69
|
}
|
|
102
70
|
declare const modelCatalog: ModelCatalogService;
|
|
103
71
|
|
|
104
|
-
export { EndpointRefresher,
|
|
72
|
+
export { EndpointRefresher, ModelCatalogEntry, ModelCatalogService, ModelHealthService, ModelHealthStatus, STATIC_MODELS_CATALOG, endpointRefresher, modelCatalog, modelHealthService };
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
endpointRefresher,
|
|
8
8
|
modelCatalog,
|
|
9
9
|
modelHealthService
|
|
10
|
-
} from "../chunk-
|
|
11
|
-
import "../chunk-
|
|
10
|
+
} from "../chunk-4WUVDLIQ.js";
|
|
11
|
+
import "../chunk-F7JDIU2C.js";
|
|
12
12
|
import "../chunk-MAMK4GDH.js";
|
|
13
13
|
import "../chunk-JSQZAFBU.js";
|
|
14
14
|
export {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as ProviderMeta,
|
|
2
|
-
export {
|
|
1
|
+
import { b as ProviderMeta, P as ProviderId, A as AIProviderStatus } from '../types-Di4ZAQYA.js';
|
|
2
|
+
export { a as ProviderCapabilities } from '../types-Di4ZAQYA.js';
|
|
3
3
|
import { b as AITransportClient } from '../AITransportClient-dToGr8nj.js';
|
|
4
4
|
export { A as AIHttpRequest, a as AIHttpResponse } from '../AITransportClient-dToGr8nj.js';
|
|
5
5
|
|
|
@@ -6,9 +6,9 @@ import {
|
|
|
6
6
|
failoverExecutionEngine,
|
|
7
7
|
healthCheckService,
|
|
8
8
|
metricsLogger
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
9
|
+
} from "../chunk-UYXROZPP.js";
|
|
10
|
+
import "../chunk-4WUVDLIQ.js";
|
|
11
|
+
import "../chunk-F7JDIU2C.js";
|
|
12
12
|
import "../chunk-SLR6SIEU.js";
|
|
13
13
|
import "../chunk-MAMK4GDH.js";
|
|
14
14
|
import "../chunk-JSQZAFBU.js";
|
|
@@ -97,7 +97,7 @@ var KeyStoreService = class {
|
|
|
97
97
|
roundRobinIndices = /* @__PURE__ */ new Map();
|
|
98
98
|
forcedNextKeys = /* @__PURE__ */ new Map();
|
|
99
99
|
permanentKeys = /* @__PURE__ */ new Map();
|
|
100
|
-
getKeys(providerId) {
|
|
100
|
+
getKeys(providerId, _modelId) {
|
|
101
101
|
const all = keysStorage.loadKeys();
|
|
102
102
|
if (!providerId) return all;
|
|
103
103
|
return all.filter((k) => k.providerId === providerId);
|
|
@@ -10,13 +10,13 @@ import {
|
|
|
10
10
|
} from "./chunk-GCTQY24J.js";
|
|
11
11
|
import {
|
|
12
12
|
failoverExecutionEngine
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-UYXROZPP.js";
|
|
14
14
|
import {
|
|
15
15
|
modelCatalog
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-4WUVDLIQ.js";
|
|
17
17
|
import {
|
|
18
18
|
keyStore
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-F7JDIU2C.js";
|
|
20
20
|
import {
|
|
21
21
|
aiProviderService
|
|
22
22
|
} from "./chunk-SLR6SIEU.js";
|
|
@@ -108,6 +108,9 @@ var AIModelCatalogServiceFacade = {
|
|
|
108
108
|
version: AIModelCatalogServiceDefinition.version,
|
|
109
109
|
runtime: "server",
|
|
110
110
|
deployment: "local",
|
|
111
|
+
getCatalog: (providerId) => modelCatalog.getCatalog(providerId),
|
|
112
|
+
getProviderStatuses: () => modelCatalog.getProviderStatuses(),
|
|
113
|
+
refreshCatalogFromEndpoints: () => modelCatalog.refreshCatalogFromEndpoints(),
|
|
111
114
|
definition: AIModelCatalogServiceDefinition,
|
|
112
115
|
createInstance: () => createService(AIModelCatalogServiceDefinition),
|
|
113
116
|
execute: async (op, input) => {
|
|
@@ -170,6 +173,10 @@ var AIKeyServiceFacade = {
|
|
|
170
173
|
version: AIKeyServiceDefinition.version,
|
|
171
174
|
runtime: "server",
|
|
172
175
|
deployment: "local",
|
|
176
|
+
getKeys: (providerId, modelId) => keyStore.getKeys(providerId, modelId),
|
|
177
|
+
getStrategy: () => keyStore.getStrategy(),
|
|
178
|
+
getUsageStats: (keyId, modelId) => keyStore.getUsageStats(keyId, modelId),
|
|
179
|
+
addKey: (input) => keyStore.addKey(input),
|
|
173
180
|
definition: AIKeyServiceDefinition,
|
|
174
181
|
createInstance: () => createService(AIKeyServiceDefinition),
|
|
175
182
|
execute: async (op, input) => {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
modelCatalog,
|
|
3
3
|
modelHealthService
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-4WUVDLIQ.js";
|
|
5
5
|
import {
|
|
6
6
|
keyStore
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-F7JDIU2C.js";
|
|
8
8
|
import {
|
|
9
9
|
aiProviderService
|
|
10
10
|
} from "./chunk-SLR6SIEU.js";
|
|
@@ -14,13 +14,15 @@ export { CompositeBackend, EndpointGenerator, GeneratedEndpointSummary, LOCAL_ST
|
|
|
14
14
|
import { AssetDataType as AssetDataType$1, AssetChannelType as AssetChannelType$1, GraphFolderInfo as GraphFolderInfo$1, GraphAssetItem as GraphAssetItem$1, SpaceNode, NodeConnection, DawProject } from '@ultrst-armada/kloks/state-graph';
|
|
15
15
|
export { AuthServiceDefinition, AuthServiceFacade, ControlPlaneServiceDefinition, ControlPlaneServiceFacade, DatabaseServiceDefinition, DatabaseServiceFacade, GeminiServiceDefinition, GeminiServiceFacade, SrklServiceDefinition, SrklServiceFacade, StorageServiceDefinition, StorageServiceFacade, WorkspaceGraphServiceDefinition, WorkspaceGraphServiceFacade, WorkspaceServiceDefinition, WorkspaceServiceFacade, krnlAuthServiceDefinition, krnlAuthServiceFacade, krnlControlPlaneServiceDefinition, krnlControlPlaneServiceFacade, krnlDatabaseServiceDefinition, krnlDatabaseServiceFacade, krnlGeminiServiceDefinition, krnlGeminiServiceFacade, krnlSrklServiceDefinition, krnlSrklServiceFacade, krnlStorageServiceDefinition, krnlStorageServiceFacade, krnlWorkspaceGraphServiceDefinition, krnlWorkspaceGraphServiceFacade, krnlWorkspaceServiceDefinition, krnlWorkspaceServiceFacade } from './krnl-services.js';
|
|
16
16
|
export { AgentHarnessProvider, AgentHarnessProviderInfo, AgentHarnessResult, AgentHarnessRunInput, AgentHarnessRuntime, AgentHarnessServiceContract, AgentHarnessServiceDefinition, AgentHarnessServiceFacade, CodeDiagnosticsInput, CodeDiagnosticsResult, CodeDiagnosticsService, CodeValidationInput, CodeValidationResult, CodeValidationRuntime, CodeValidationServiceDefinition, CodeValidationServiceFacade, DevelopmentProvider, DevelopmentRequest, DevelopmentResult, DevelopmentRuntime, DevelopmentServiceContract, DevelopmentServiceDefinition, DevelopmentServiceFacade, DevelopmentTask, GitHubActionsClient, GitHubActionsConfig, GitHubActionsServiceDefinition, GitHubActionsServiceFacade, TYPESCRIPT_LANGUAGE_SERVER_PACKAGE, TYPESCRIPT_LANGUAGE_SERVER_VERSION, TypeScriptLanguageServerNotificationInput, TypeScriptLanguageServerRequestInput, TypeScriptLanguageServerResponse, TypeScriptLanguageServerServiceDefinition, TypeScriptLanguageServerServiceFacade, TypeScriptLanguageServerStartInput, TypeScriptLanguageServerStatus, ValidationDiagnostic, ValidationLayer, WebContainerCommand, WebContainerRunCommandInput, WebContainerRuntime, WebContainerServiceDefinition, WebContainerServiceFacade, WorkflowRun, codeDiagnosticsService, resolveDevelopmentCommand } from './development/index.js';
|
|
17
|
-
export { A as AIProviderStatus,
|
|
17
|
+
export { A as AIProviderStatus, a as ProviderCapabilities, P as ProviderId, b as ProviderMeta } from './types-Di4ZAQYA.js';
|
|
18
18
|
export { AIProviderService, PROVIDERS_META, PROVIDER_COLORS, aiProviderService, getProviderMeta, listProviders } from './ai-provider/index.js';
|
|
19
19
|
export { A as AIHttpRequest, a as AIHttpResponse, b as AITransportClient } from './AITransportClient-dToGr8nj.js';
|
|
20
20
|
export { DeterministicEndpointExecutor, EndpointExecutionParams, EndpointExecutionResult, ErrorClassification, InferenceExecutorService, InferenceOptions, InferenceResult, ParsedProviderError, ToolCall, classifyAndFormatError, deterministicEndpointExecutor, inferenceExecutor, parseErrorJson, performInference } from './ai-inference/index.js';
|
|
21
|
-
export {
|
|
21
|
+
export { M as ModelCatalogEntry, a as ModelHealthStatus } from './types-fYUdf9oB.js';
|
|
22
|
+
export { EndpointRefresher, ModelCatalogService, ModelHealthService, STATIC_MODELS_CATALOG, endpointRefresher, modelCatalog, modelHealthService } from './ai-models/index.js';
|
|
22
23
|
export { AIMetricRecord, AIRoutingStrategy, FailoverExecutionEngine, HealthCheckService, MetricsLogger, RetryPolicy, RouteCandidate, RouteExecutionResult, failoverExecutionEngine, healthCheckService, metricsLogger } from './ai-routing/index.js';
|
|
23
|
-
export { ApiKeyEntry, KeyModelUsageStats,
|
|
24
|
+
export { A as ApiKeyEntry, K as KeyModelUsageStats, a as KeyValidationResult, R as RotationStrategy } from './types-B0aSwTAt.js';
|
|
25
|
+
export { KeyStoreService, KeysStorage, keyStore, keysStorage, validateApiKey } from './ai-keys/index.js';
|
|
24
26
|
export { MCPEngine, MCPServerConfig, MCPTool, MCPToolParameter, ToolExecutionResult, ToolInputValidationResult, ToolManagerService, mcpEngine, toolManagerService, validateToolInput } from './ai-tools/index.js';
|
|
25
27
|
export { AIInferenceServiceDefinition, AIInferenceServiceFacade, AIKeyServiceDefinition, AIKeyServiceFacade, AIModelCatalogServiceDefinition, AIModelCatalogServiceFacade, AIProviderServiceDefinition, AIProviderServiceFacade, AIRoutingServiceDefinition, AIRoutingServiceFacade, AIToolServiceDefinition, AIToolServiceFacade } from './krnl-ai-services.js';
|
|
26
28
|
export { EndpointDescriptor, IService, ProtocolAdapter, ServiceDefinition } from '@ultrst-armada/krnl';
|
|
@@ -138,7 +138,7 @@ import {
|
|
|
138
138
|
AIRoutingServiceFacade,
|
|
139
139
|
AIToolServiceDefinition,
|
|
140
140
|
AIToolServiceFacade
|
|
141
|
-
} from "./chunk-
|
|
141
|
+
} from "./chunk-RSKFM7AC.js";
|
|
142
142
|
import {
|
|
143
143
|
MCPEngine,
|
|
144
144
|
ToolManagerService,
|
|
@@ -279,7 +279,7 @@ import {
|
|
|
279
279
|
failoverExecutionEngine,
|
|
280
280
|
healthCheckService,
|
|
281
281
|
metricsLogger
|
|
282
|
-
} from "./chunk-
|
|
282
|
+
} from "./chunk-UYXROZPP.js";
|
|
283
283
|
import {
|
|
284
284
|
EndpointRefresher,
|
|
285
285
|
ModelCatalogService,
|
|
@@ -288,14 +288,14 @@ import {
|
|
|
288
288
|
endpointRefresher,
|
|
289
289
|
modelCatalog,
|
|
290
290
|
modelHealthService
|
|
291
|
-
} from "./chunk-
|
|
291
|
+
} from "./chunk-4WUVDLIQ.js";
|
|
292
292
|
import {
|
|
293
293
|
KeyStoreService,
|
|
294
294
|
KeysStorage,
|
|
295
295
|
keyStore,
|
|
296
296
|
keysStorage,
|
|
297
297
|
validateApiKey
|
|
298
|
-
} from "./chunk-
|
|
298
|
+
} from "./chunk-F7JDIU2C.js";
|
|
299
299
|
import {
|
|
300
300
|
AIProviderService,
|
|
301
301
|
aiProviderService
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import * as _ultrst_armada_krnl from '@ultrst-armada/krnl';
|
|
2
2
|
import { ServiceDefinition } from '@ultrst-armada/krnl';
|
|
3
|
+
import { P as ProviderId } from './types-Di4ZAQYA.js';
|
|
4
|
+
import { M as ModelCatalogEntry } from './types-fYUdf9oB.js';
|
|
5
|
+
import { A as ApiKeyEntry, R as RotationStrategy, K as KeyModelUsageStats } from './types-B0aSwTAt.js';
|
|
3
6
|
|
|
4
7
|
declare const AIProviderServiceDefinition: ServiceDefinition;
|
|
5
8
|
declare const AIProviderServiceFacade: {
|
|
@@ -30,6 +33,17 @@ declare const AIModelCatalogServiceFacade: {
|
|
|
30
33
|
version: string;
|
|
31
34
|
runtime: "server";
|
|
32
35
|
deployment: "local";
|
|
36
|
+
getCatalog: (providerId?: string) => ModelCatalogEntry[];
|
|
37
|
+
getProviderStatuses: () => {
|
|
38
|
+
providerId: ProviderId;
|
|
39
|
+
status: string;
|
|
40
|
+
modelsCount: number;
|
|
41
|
+
error?: string;
|
|
42
|
+
}[];
|
|
43
|
+
refreshCatalogFromEndpoints: () => Promise<{
|
|
44
|
+
updated: number;
|
|
45
|
+
errors: string[];
|
|
46
|
+
}>;
|
|
33
47
|
definition: ServiceDefinition<Record<string, unknown>, Record<string, unknown>>;
|
|
34
48
|
createInstance: () => _ultrst_armada_krnl.ServiceInstance<Record<string, unknown>, Record<string, unknown>>;
|
|
35
49
|
execute: <TIn = unknown, TOut = unknown>(op: string, input?: TIn) => Promise<TOut>;
|
|
@@ -52,6 +66,10 @@ declare const AIKeyServiceFacade: {
|
|
|
52
66
|
version: string;
|
|
53
67
|
runtime: "server";
|
|
54
68
|
deployment: "local";
|
|
69
|
+
getKeys: (providerId?: string, modelId?: string) => ApiKeyEntry[];
|
|
70
|
+
getStrategy: () => RotationStrategy;
|
|
71
|
+
getUsageStats: (keyId?: string, modelId?: string) => KeyModelUsageStats[];
|
|
72
|
+
addKey: (input: any) => ApiKeyEntry;
|
|
55
73
|
definition: ServiceDefinition<Record<string, unknown>, Record<string, unknown>>;
|
|
56
74
|
createInstance: () => _ultrst_armada_krnl.ServiceInstance<Record<string, unknown>, Record<string, unknown>>;
|
|
57
75
|
execute: <TIn = unknown, TOut = unknown>(op: string, input?: TIn) => Promise<TOut>;
|
|
@@ -11,13 +11,13 @@ import {
|
|
|
11
11
|
AIRoutingServiceFacade,
|
|
12
12
|
AIToolServiceDefinition,
|
|
13
13
|
AIToolServiceFacade
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-RSKFM7AC.js";
|
|
15
15
|
import "./chunk-U4HUGPRH.js";
|
|
16
16
|
import "./chunk-TY32TUNI.js";
|
|
17
17
|
import "./chunk-GCTQY24J.js";
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
18
|
+
import "./chunk-UYXROZPP.js";
|
|
19
|
+
import "./chunk-4WUVDLIQ.js";
|
|
20
|
+
import "./chunk-F7JDIU2C.js";
|
|
21
21
|
import "./chunk-SLR6SIEU.js";
|
|
22
22
|
import "./chunk-MAMK4GDH.js";
|
|
23
23
|
import "./chunk-JSQZAFBU.js";
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { P as ProviderId } from './types-Di4ZAQYA.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file types.ts
|
|
5
|
+
* @description Canonical AI Key Management contracts and types for @ultrst-armada/kloks/backend
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
type RotationStrategy = 'lowest-latency' | 'round-robin' | 'weighted-random' | 'failover-priority';
|
|
9
|
+
interface ApiKeyEntry {
|
|
10
|
+
id: string;
|
|
11
|
+
providerId: ProviderId;
|
|
12
|
+
label: string;
|
|
13
|
+
key: string;
|
|
14
|
+
keyValue?: string;
|
|
15
|
+
status: 'active' | 'valid' | 'invalid' | 'rate-limited' | 'checking';
|
|
16
|
+
isActive: boolean;
|
|
17
|
+
createdAt: string;
|
|
18
|
+
weight: number;
|
|
19
|
+
remainingCreditsUsd: number | null;
|
|
20
|
+
totalCalls: number;
|
|
21
|
+
successfulCalls: number;
|
|
22
|
+
failedCalls: number;
|
|
23
|
+
lastLatencyMs: number;
|
|
24
|
+
errorCount: number;
|
|
25
|
+
lifespanSeconds?: number | null;
|
|
26
|
+
expiresAt?: string | null;
|
|
27
|
+
lastUsedAt?: string | null;
|
|
28
|
+
validationError?: string | null;
|
|
29
|
+
failedModels?: string[];
|
|
30
|
+
}
|
|
31
|
+
interface KeyValidationResult {
|
|
32
|
+
valid: boolean;
|
|
33
|
+
status: 'valid' | 'invalid' | 'rate-limited';
|
|
34
|
+
error?: string;
|
|
35
|
+
latencyMs: number;
|
|
36
|
+
}
|
|
37
|
+
interface KeyModelUsageStats {
|
|
38
|
+
keyId: string;
|
|
39
|
+
modelId: string;
|
|
40
|
+
totalCalls: number;
|
|
41
|
+
successfulCalls: number;
|
|
42
|
+
failedCalls: number;
|
|
43
|
+
lastUsedAt?: string;
|
|
44
|
+
avgLatencyMs?: number;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export type { ApiKeyEntry as A, KeyModelUsageStats as K, RotationStrategy as R, KeyValidationResult as a };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { P as ProviderId } from './types-Di4ZAQYA.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file types.ts
|
|
5
|
+
* @description Canonical Model Catalog and Discovery types for @ultrst-armada/kloks/backend
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
interface ModelCatalogEntry {
|
|
9
|
+
id: string;
|
|
10
|
+
name: string;
|
|
11
|
+
providerId: ProviderId;
|
|
12
|
+
contextWindow?: number;
|
|
13
|
+
inputCostPer1k?: number;
|
|
14
|
+
outputCostPer1k?: number;
|
|
15
|
+
supportsTools?: boolean;
|
|
16
|
+
supportsVision?: boolean;
|
|
17
|
+
supportsJson?: boolean;
|
|
18
|
+
isFree?: boolean;
|
|
19
|
+
latencyRatingMs?: number;
|
|
20
|
+
qualityRating?: number;
|
|
21
|
+
maxOutputTokens?: number;
|
|
22
|
+
status?: 'active' | 'deprecated' | 'offline' | 'online' | 'currently_unavailable';
|
|
23
|
+
runtimeStats?: Record<string, any>;
|
|
24
|
+
description?: string;
|
|
25
|
+
}
|
|
26
|
+
interface ModelHealthStatus {
|
|
27
|
+
modelId: string;
|
|
28
|
+
providerId: ProviderId;
|
|
29
|
+
isHealthy: boolean;
|
|
30
|
+
latencyMs: number;
|
|
31
|
+
consecutiveFailures: number;
|
|
32
|
+
lastCheckedAt: string;
|
|
33
|
+
lastError?: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export type { ModelCatalogEntry as M, ModelHealthStatus as a };
|
|
@@ -16,20 +16,6 @@ import {
|
|
|
16
16
|
useSkipoBind,
|
|
17
17
|
useSkipoState
|
|
18
18
|
} from "./chunk-EW4ACSZB.js";
|
|
19
|
-
import {
|
|
20
|
-
CommandApi,
|
|
21
|
-
GhostStore,
|
|
22
|
-
GraphStore
|
|
23
|
-
} from "./chunk-4UVGXFEM.js";
|
|
24
|
-
import {
|
|
25
|
-
BaseGraph,
|
|
26
|
-
BaseNode,
|
|
27
|
-
BaseViewWindow,
|
|
28
|
-
CustomGraph,
|
|
29
|
-
CustomNode,
|
|
30
|
-
CustomViewWindow,
|
|
31
|
-
DEFAULT_GRAPH_SETTINGS
|
|
32
|
-
} from "./chunk-KG6QYS26.js";
|
|
33
19
|
import {
|
|
34
20
|
AttractionEngine,
|
|
35
21
|
GhostInferenceEngine,
|
|
@@ -45,6 +31,20 @@ import {
|
|
|
45
31
|
WireTypeRegistry,
|
|
46
32
|
initializeDefaultGraphRules
|
|
47
33
|
} from "./chunk-TZOL3RN7.js";
|
|
34
|
+
import {
|
|
35
|
+
CommandApi,
|
|
36
|
+
GhostStore,
|
|
37
|
+
GraphStore
|
|
38
|
+
} from "./chunk-4UVGXFEM.js";
|
|
39
|
+
import {
|
|
40
|
+
BaseGraph,
|
|
41
|
+
BaseNode,
|
|
42
|
+
BaseViewWindow,
|
|
43
|
+
CustomGraph,
|
|
44
|
+
CustomNode,
|
|
45
|
+
CustomViewWindow,
|
|
46
|
+
DEFAULT_GRAPH_SETTINGS
|
|
47
|
+
} from "./chunk-KG6QYS26.js";
|
|
48
48
|
import {
|
|
49
49
|
AutoSolidify,
|
|
50
50
|
SpatialEngine,
|