@ultrst-armada/kloks 1.15.0 → 1.16.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.
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schema": 1,
3
3
  "packageName": "@ultrst-armada/kloks",
4
- "version": "1.15.0",
5
- "sourceCommit": "2604c1adbf1158c1223ace47e278a654082c4fad",
4
+ "version": "1.16.0",
5
+ "sourceCommit": "eb260f0bb24e9dc18bfca085e3389e2477a4258f",
6
6
  "releaseWorkflow": "npm Release",
7
- "workflowRunId": "40836063403"
7
+ "workflowRunId": "40836920132"
8
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ultrst-armada/kloks",
3
- "version": "1.15.0",
3
+ "version": "1.16.0",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -1,4 +1,4 @@
1
- import { a as ProviderId } from '../types-2p2AhboE.js';
1
+ import { P as ProviderId } from '../types-Di4ZAQYA.js';
2
2
  import { b as AITransportClient } from '../AITransportClient-dToGr8nj.js';
3
3
 
4
4
  /**
@@ -1,48 +1,5 @@
1
- import { a as ProviderId } from '../types-2p2AhboE.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
- }
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
@@ -109,4 +66,4 @@ declare class KeyStoreService {
109
66
  }
110
67
  declare const keyStore: KeyStoreService;
111
68
 
112
- export { type ApiKeyEntry, type KeyModelUsageStats, KeyStoreService, type KeyValidationResult, KeysStorage, type RotationStrategy, keyStore, keysStorage, validateApiKey };
69
+ export { ApiKeyEntry, KeyModelUsageStats, KeyStoreService, KeyValidationResult, KeysStorage, RotationStrategy, keyStore, keysStorage, validateApiKey };
@@ -1,39 +1,7 @@
1
- import { a as ProviderId } from '../types-2p2AhboE.js';
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, type ModelCatalogEntry, ModelCatalogService, ModelHealthService, type ModelHealthStatus, STATIC_MODELS_CATALOG, endpointRefresher, modelCatalog, modelHealthService };
72
+ export { EndpointRefresher, ModelCatalogEntry, ModelCatalogService, ModelHealthService, ModelHealthStatus, STATIC_MODELS_CATALOG, endpointRefresher, modelCatalog, modelHealthService };
@@ -1,5 +1,5 @@
1
- import { b as ProviderMeta, a as ProviderId, A as AIProviderStatus } from '../types-2p2AhboE.js';
2
- export { P as ProviderCapabilities } from '../types-2p2AhboE.js';
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
 
@@ -1,4 +1,4 @@
1
- import { a as ProviderId } from '../types-2p2AhboE.js';
1
+ import { P as ProviderId } from '../types-Di4ZAQYA.js';
2
2
 
3
3
  /**
4
4
  * @file types.ts
@@ -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) => keyStore.getKeys(providerId),
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) => {
@@ -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, P as ProviderCapabilities, a as ProviderId, b as ProviderMeta } from './types-2p2AhboE.js';
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 { EndpointRefresher, ModelCatalogEntry, ModelCatalogService, ModelHealthService, ModelHealthStatus, STATIC_MODELS_CATALOG, endpointRefresher, modelCatalog, modelHealthService } from './ai-models/index.js';
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, KeyStoreService, KeyValidationResult, KeysStorage, RotationStrategy, keyStore, keysStorage, validateApiKey } from './ai-keys/index.js';
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-6YBBOHHG.js";
141
+ } from "./chunk-EWQYKBSN.js";
142
142
  import {
143
143
  MCPEngine,
144
144
  ToolManagerService,
@@ -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) => 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,7 +11,7 @@ import {
11
11
  AIRoutingServiceFacade,
12
12
  AIToolServiceDefinition,
13
13
  AIToolServiceFacade
14
- } from "./chunk-6YBBOHHG.js";
14
+ } from "./chunk-EWQYKBSN.js";
15
15
  import "./chunk-U4HUGPRH.js";
16
16
  import "./chunk-TY32TUNI.js";
17
17
  import "./chunk-GCTQY24J.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 };
@@ -30,4 +30,4 @@ interface AIProviderStatus {
30
30
  error?: string;
31
31
  }
32
32
 
33
- export type { AIProviderStatus as A, ProviderCapabilities as P, ProviderId as a, ProviderMeta as b };
33
+ export type { AIProviderStatus as A, ProviderId as P, ProviderCapabilities as a, ProviderMeta as b };
@@ -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,