@relayplane/proxy 0.1.6 → 0.1.8
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/README.md +73 -1
- package/dist/cli.js +243 -34
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +243 -34
- package/dist/cli.mjs.map +1 -1
- package/dist/index.d.mts +96 -1
- package/dist/index.d.ts +96 -1
- package/dist/index.js +298 -79
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +292 -78
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1020,4 +1020,99 @@ declare class OutcomeRecorder {
|
|
|
1020
1020
|
};
|
|
1021
1021
|
}
|
|
1022
1022
|
|
|
1023
|
-
|
|
1023
|
+
/**
|
|
1024
|
+
* Configuration Management
|
|
1025
|
+
*
|
|
1026
|
+
* Handles loading, validation, and hot-reload of the config file.
|
|
1027
|
+
*
|
|
1028
|
+
* @packageDocumentation
|
|
1029
|
+
*/
|
|
1030
|
+
|
|
1031
|
+
/**
|
|
1032
|
+
* Strategy configuration for a task type
|
|
1033
|
+
*/
|
|
1034
|
+
declare const StrategySchema: z.ZodObject<{
|
|
1035
|
+
model: z.ZodString;
|
|
1036
|
+
minConfidence: z.ZodOptional<z.ZodNumber>;
|
|
1037
|
+
fallback: z.ZodOptional<z.ZodString>;
|
|
1038
|
+
}, "strip", z.ZodTypeAny, {
|
|
1039
|
+
model: string;
|
|
1040
|
+
minConfidence?: number | undefined;
|
|
1041
|
+
fallback?: string | undefined;
|
|
1042
|
+
}, {
|
|
1043
|
+
model: string;
|
|
1044
|
+
minConfidence?: number | undefined;
|
|
1045
|
+
fallback?: string | undefined;
|
|
1046
|
+
}>;
|
|
1047
|
+
/**
|
|
1048
|
+
* Full config schema
|
|
1049
|
+
*/
|
|
1050
|
+
declare const ConfigSchema: z.ZodObject<{
|
|
1051
|
+
strategies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
1052
|
+
model: z.ZodString;
|
|
1053
|
+
minConfidence: z.ZodOptional<z.ZodNumber>;
|
|
1054
|
+
fallback: z.ZodOptional<z.ZodString>;
|
|
1055
|
+
}, "strip", z.ZodTypeAny, {
|
|
1056
|
+
model: string;
|
|
1057
|
+
minConfidence?: number | undefined;
|
|
1058
|
+
fallback?: string | undefined;
|
|
1059
|
+
}, {
|
|
1060
|
+
model: string;
|
|
1061
|
+
minConfidence?: number | undefined;
|
|
1062
|
+
fallback?: string | undefined;
|
|
1063
|
+
}>>>;
|
|
1064
|
+
defaults: z.ZodOptional<z.ZodObject<{
|
|
1065
|
+
qualityModel: z.ZodOptional<z.ZodString>;
|
|
1066
|
+
costModel: z.ZodOptional<z.ZodString>;
|
|
1067
|
+
}, "strip", z.ZodTypeAny, {
|
|
1068
|
+
qualityModel?: string | undefined;
|
|
1069
|
+
costModel?: string | undefined;
|
|
1070
|
+
}, {
|
|
1071
|
+
qualityModel?: string | undefined;
|
|
1072
|
+
costModel?: string | undefined;
|
|
1073
|
+
}>>;
|
|
1074
|
+
}, "strip", z.ZodTypeAny, {
|
|
1075
|
+
strategies?: Record<string, {
|
|
1076
|
+
model: string;
|
|
1077
|
+
minConfidence?: number | undefined;
|
|
1078
|
+
fallback?: string | undefined;
|
|
1079
|
+
}> | undefined;
|
|
1080
|
+
defaults?: {
|
|
1081
|
+
qualityModel?: string | undefined;
|
|
1082
|
+
costModel?: string | undefined;
|
|
1083
|
+
} | undefined;
|
|
1084
|
+
}, {
|
|
1085
|
+
strategies?: Record<string, {
|
|
1086
|
+
model: string;
|
|
1087
|
+
minConfidence?: number | undefined;
|
|
1088
|
+
fallback?: string | undefined;
|
|
1089
|
+
}> | undefined;
|
|
1090
|
+
defaults?: {
|
|
1091
|
+
qualityModel?: string | undefined;
|
|
1092
|
+
costModel?: string | undefined;
|
|
1093
|
+
} | undefined;
|
|
1094
|
+
}>;
|
|
1095
|
+
type StrategyConfig = z.infer<typeof StrategySchema>;
|
|
1096
|
+
type Config = z.infer<typeof ConfigSchema>;
|
|
1097
|
+
/**
|
|
1098
|
+
* Default configuration
|
|
1099
|
+
*/
|
|
1100
|
+
declare const DEFAULT_CONFIG: Config;
|
|
1101
|
+
/**
|
|
1102
|
+
* Get config file path
|
|
1103
|
+
*/
|
|
1104
|
+
declare function getConfigPath(): string;
|
|
1105
|
+
/**
|
|
1106
|
+
* Load and validate config
|
|
1107
|
+
*/
|
|
1108
|
+
declare function loadConfig(): Config;
|
|
1109
|
+
/**
|
|
1110
|
+
* Get strategy for a task type from config
|
|
1111
|
+
*/
|
|
1112
|
+
declare function getStrategy(config: Config, taskType: TaskType): StrategyConfig | null;
|
|
1113
|
+
/**
|
|
1114
|
+
* Watch config file for changes
|
|
1115
|
+
*/
|
|
1116
|
+
declare function watchConfig(onChange: (config: Config) => void): void;
|
|
1117
|
+
|
|
1118
|
+
export { type Config, DEFAULT_CONFIG, DEFAULT_ENDPOINTS, MODEL_MAPPING, MODEL_PRICING, type ModelCostBreakdown, type Outcome, type OutcomeQuality, OutcomeRecorder, PatternDetector, type Provider, type ProviderEndpoint, ProviderSchema, Providers, type ProxyConfig, RelayPlane, type RelayPlaneConfig, RoutingEngine, type RoutingRule, type RuleSource, type RunRecord, type SavingsReport, Store, type StrategyConfig, type Suggestion, type TaskType, TaskTypeSchema, TaskTypes, calculateCost, calculateSavings, getConfigPath, getInferenceConfidence, getModelPricing, getStrategy, inferTaskType, loadConfig, startProxy, watchConfig };
|
package/dist/index.d.ts
CHANGED
|
@@ -1020,4 +1020,99 @@ declare class OutcomeRecorder {
|
|
|
1020
1020
|
};
|
|
1021
1021
|
}
|
|
1022
1022
|
|
|
1023
|
-
|
|
1023
|
+
/**
|
|
1024
|
+
* Configuration Management
|
|
1025
|
+
*
|
|
1026
|
+
* Handles loading, validation, and hot-reload of the config file.
|
|
1027
|
+
*
|
|
1028
|
+
* @packageDocumentation
|
|
1029
|
+
*/
|
|
1030
|
+
|
|
1031
|
+
/**
|
|
1032
|
+
* Strategy configuration for a task type
|
|
1033
|
+
*/
|
|
1034
|
+
declare const StrategySchema: z.ZodObject<{
|
|
1035
|
+
model: z.ZodString;
|
|
1036
|
+
minConfidence: z.ZodOptional<z.ZodNumber>;
|
|
1037
|
+
fallback: z.ZodOptional<z.ZodString>;
|
|
1038
|
+
}, "strip", z.ZodTypeAny, {
|
|
1039
|
+
model: string;
|
|
1040
|
+
minConfidence?: number | undefined;
|
|
1041
|
+
fallback?: string | undefined;
|
|
1042
|
+
}, {
|
|
1043
|
+
model: string;
|
|
1044
|
+
minConfidence?: number | undefined;
|
|
1045
|
+
fallback?: string | undefined;
|
|
1046
|
+
}>;
|
|
1047
|
+
/**
|
|
1048
|
+
* Full config schema
|
|
1049
|
+
*/
|
|
1050
|
+
declare const ConfigSchema: z.ZodObject<{
|
|
1051
|
+
strategies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
1052
|
+
model: z.ZodString;
|
|
1053
|
+
minConfidence: z.ZodOptional<z.ZodNumber>;
|
|
1054
|
+
fallback: z.ZodOptional<z.ZodString>;
|
|
1055
|
+
}, "strip", z.ZodTypeAny, {
|
|
1056
|
+
model: string;
|
|
1057
|
+
minConfidence?: number | undefined;
|
|
1058
|
+
fallback?: string | undefined;
|
|
1059
|
+
}, {
|
|
1060
|
+
model: string;
|
|
1061
|
+
minConfidence?: number | undefined;
|
|
1062
|
+
fallback?: string | undefined;
|
|
1063
|
+
}>>>;
|
|
1064
|
+
defaults: z.ZodOptional<z.ZodObject<{
|
|
1065
|
+
qualityModel: z.ZodOptional<z.ZodString>;
|
|
1066
|
+
costModel: z.ZodOptional<z.ZodString>;
|
|
1067
|
+
}, "strip", z.ZodTypeAny, {
|
|
1068
|
+
qualityModel?: string | undefined;
|
|
1069
|
+
costModel?: string | undefined;
|
|
1070
|
+
}, {
|
|
1071
|
+
qualityModel?: string | undefined;
|
|
1072
|
+
costModel?: string | undefined;
|
|
1073
|
+
}>>;
|
|
1074
|
+
}, "strip", z.ZodTypeAny, {
|
|
1075
|
+
strategies?: Record<string, {
|
|
1076
|
+
model: string;
|
|
1077
|
+
minConfidence?: number | undefined;
|
|
1078
|
+
fallback?: string | undefined;
|
|
1079
|
+
}> | undefined;
|
|
1080
|
+
defaults?: {
|
|
1081
|
+
qualityModel?: string | undefined;
|
|
1082
|
+
costModel?: string | undefined;
|
|
1083
|
+
} | undefined;
|
|
1084
|
+
}, {
|
|
1085
|
+
strategies?: Record<string, {
|
|
1086
|
+
model: string;
|
|
1087
|
+
minConfidence?: number | undefined;
|
|
1088
|
+
fallback?: string | undefined;
|
|
1089
|
+
}> | undefined;
|
|
1090
|
+
defaults?: {
|
|
1091
|
+
qualityModel?: string | undefined;
|
|
1092
|
+
costModel?: string | undefined;
|
|
1093
|
+
} | undefined;
|
|
1094
|
+
}>;
|
|
1095
|
+
type StrategyConfig = z.infer<typeof StrategySchema>;
|
|
1096
|
+
type Config = z.infer<typeof ConfigSchema>;
|
|
1097
|
+
/**
|
|
1098
|
+
* Default configuration
|
|
1099
|
+
*/
|
|
1100
|
+
declare const DEFAULT_CONFIG: Config;
|
|
1101
|
+
/**
|
|
1102
|
+
* Get config file path
|
|
1103
|
+
*/
|
|
1104
|
+
declare function getConfigPath(): string;
|
|
1105
|
+
/**
|
|
1106
|
+
* Load and validate config
|
|
1107
|
+
*/
|
|
1108
|
+
declare function loadConfig(): Config;
|
|
1109
|
+
/**
|
|
1110
|
+
* Get strategy for a task type from config
|
|
1111
|
+
*/
|
|
1112
|
+
declare function getStrategy(config: Config, taskType: TaskType): StrategyConfig | null;
|
|
1113
|
+
/**
|
|
1114
|
+
* Watch config file for changes
|
|
1115
|
+
*/
|
|
1116
|
+
declare function watchConfig(onChange: (config: Config) => void): void;
|
|
1117
|
+
|
|
1118
|
+
export { type Config, DEFAULT_CONFIG, DEFAULT_ENDPOINTS, MODEL_MAPPING, MODEL_PRICING, type ModelCostBreakdown, type Outcome, type OutcomeQuality, OutcomeRecorder, PatternDetector, type Provider, type ProviderEndpoint, ProviderSchema, Providers, type ProxyConfig, RelayPlane, type RelayPlaneConfig, RoutingEngine, type RoutingRule, type RuleSource, type RunRecord, type SavingsReport, Store, type StrategyConfig, type Suggestion, type TaskType, TaskTypeSchema, TaskTypes, calculateCost, calculateSavings, getConfigPath, getInferenceConfidence, getModelPricing, getStrategy, inferTaskType, loadConfig, startProxy, watchConfig };
|