cc-x10ded 3.0.17 → 3.0.18

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/src/types.ts ADDED
@@ -0,0 +1,71 @@
1
+ export type LogLevel = "debug" | "info" | "warn" | "error";
2
+
3
+ export interface TelemetryEvent {
4
+ type: string;
5
+ timestamp: number;
6
+ provider?: string;
7
+ model?: string;
8
+ latencyMs?: number;
9
+ success?: boolean;
10
+ errorCode?: string;
11
+ reason?: string;
12
+ fromProvider?: string;
13
+ toProvider?: string;
14
+ }
15
+
16
+ export interface ProviderInfo {
17
+ id: string;
18
+ name: string;
19
+ models: ModelInfo[];
20
+ isNative: boolean;
21
+ requiresKey: string;
22
+ }
23
+
24
+ export interface ModelInfo {
25
+ id: string;
26
+ name: string;
27
+ contextWindow?: number;
28
+ maxOutputTokens?: number;
29
+ capabilities?: readonly ("text" | "vision" | "tools")[];
30
+ default?: boolean;
31
+ }
32
+
33
+ export interface CircuitState {
34
+ provider: string;
35
+ state: "closed" | "open" | "half-open";
36
+ failures: number;
37
+ lastFailure: number | null;
38
+ }
39
+
40
+ export interface HealthStatus {
41
+ healthy: boolean;
42
+ latencyMs?: number;
43
+ error?: string;
44
+ }
45
+
46
+ export interface PluginConfig {
47
+ apiKey?: string;
48
+ baseUrl: string;
49
+ extra?: Record<string, unknown>;
50
+ }
51
+
52
+ export interface ProviderClient {
53
+ readonly provider: string;
54
+ streamComplete(request: object): AsyncGenerator<object>;
55
+ getModelInfo(): ModelInfo | undefined;
56
+ healthCheck(): Promise<HealthStatus>;
57
+ }
58
+
59
+ export interface ProviderPlugin {
60
+ id: string;
61
+ name: string;
62
+ version: string;
63
+ description?: string;
64
+ models: ModelInfo[];
65
+ createClient(config: PluginConfig): ProviderClient;
66
+ }
67
+
68
+ export interface SSEMessage {
69
+ type: string;
70
+ data: unknown;
71
+ }