@relayplane/proxy 0.1.7 → 0.1.9

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/dist/index.d.mts CHANGED
@@ -1020,4 +1020,122 @@ declare class OutcomeRecorder {
1020
1020
  };
1021
1021
  }
1022
1022
 
1023
- export { 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 Suggestion, type TaskType, TaskTypeSchema, TaskTypes, calculateCost, calculateSavings, getInferenceConfidence, getModelPricing, inferTaskType, startProxy };
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
+ auth: z.ZodOptional<z.ZodObject<{
1075
+ anthropicApiKey: z.ZodOptional<z.ZodString>;
1076
+ anthropicMaxToken: z.ZodOptional<z.ZodString>;
1077
+ useMaxForModels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1078
+ }, "strip", z.ZodTypeAny, {
1079
+ anthropicApiKey?: string | undefined;
1080
+ anthropicMaxToken?: string | undefined;
1081
+ useMaxForModels?: string[] | undefined;
1082
+ }, {
1083
+ anthropicApiKey?: string | undefined;
1084
+ anthropicMaxToken?: string | undefined;
1085
+ useMaxForModels?: string[] | undefined;
1086
+ }>>;
1087
+ }, "strip", z.ZodTypeAny, {
1088
+ strategies?: Record<string, {
1089
+ model: string;
1090
+ minConfidence?: number | undefined;
1091
+ fallback?: string | undefined;
1092
+ }> | undefined;
1093
+ defaults?: {
1094
+ qualityModel?: string | undefined;
1095
+ costModel?: string | undefined;
1096
+ } | undefined;
1097
+ auth?: {
1098
+ anthropicApiKey?: string | undefined;
1099
+ anthropicMaxToken?: string | undefined;
1100
+ useMaxForModels?: string[] | undefined;
1101
+ } | undefined;
1102
+ }, {
1103
+ strategies?: Record<string, {
1104
+ model: string;
1105
+ minConfidence?: number | undefined;
1106
+ fallback?: string | undefined;
1107
+ }> | undefined;
1108
+ defaults?: {
1109
+ qualityModel?: string | undefined;
1110
+ costModel?: string | undefined;
1111
+ } | undefined;
1112
+ auth?: {
1113
+ anthropicApiKey?: string | undefined;
1114
+ anthropicMaxToken?: string | undefined;
1115
+ useMaxForModels?: string[] | undefined;
1116
+ } | undefined;
1117
+ }>;
1118
+ type StrategyConfig = z.infer<typeof StrategySchema>;
1119
+ type Config = z.infer<typeof ConfigSchema>;
1120
+ /**
1121
+ * Default configuration
1122
+ */
1123
+ declare const DEFAULT_CONFIG: Config;
1124
+ /**
1125
+ * Get config file path
1126
+ */
1127
+ declare function getConfigPath(): string;
1128
+ /**
1129
+ * Load and validate config
1130
+ */
1131
+ declare function loadConfig(): Config;
1132
+ /**
1133
+ * Get strategy for a task type from config
1134
+ */
1135
+ declare function getStrategy(config: Config, taskType: TaskType): StrategyConfig | null;
1136
+ /**
1137
+ * Watch config file for changes
1138
+ */
1139
+ declare function watchConfig(onChange: (config: Config) => void): void;
1140
+
1141
+ 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,122 @@ declare class OutcomeRecorder {
1020
1020
  };
1021
1021
  }
1022
1022
 
1023
- export { 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 Suggestion, type TaskType, TaskTypeSchema, TaskTypes, calculateCost, calculateSavings, getInferenceConfidence, getModelPricing, inferTaskType, startProxy };
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
+ auth: z.ZodOptional<z.ZodObject<{
1075
+ anthropicApiKey: z.ZodOptional<z.ZodString>;
1076
+ anthropicMaxToken: z.ZodOptional<z.ZodString>;
1077
+ useMaxForModels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1078
+ }, "strip", z.ZodTypeAny, {
1079
+ anthropicApiKey?: string | undefined;
1080
+ anthropicMaxToken?: string | undefined;
1081
+ useMaxForModels?: string[] | undefined;
1082
+ }, {
1083
+ anthropicApiKey?: string | undefined;
1084
+ anthropicMaxToken?: string | undefined;
1085
+ useMaxForModels?: string[] | undefined;
1086
+ }>>;
1087
+ }, "strip", z.ZodTypeAny, {
1088
+ strategies?: Record<string, {
1089
+ model: string;
1090
+ minConfidence?: number | undefined;
1091
+ fallback?: string | undefined;
1092
+ }> | undefined;
1093
+ defaults?: {
1094
+ qualityModel?: string | undefined;
1095
+ costModel?: string | undefined;
1096
+ } | undefined;
1097
+ auth?: {
1098
+ anthropicApiKey?: string | undefined;
1099
+ anthropicMaxToken?: string | undefined;
1100
+ useMaxForModels?: string[] | undefined;
1101
+ } | undefined;
1102
+ }, {
1103
+ strategies?: Record<string, {
1104
+ model: string;
1105
+ minConfidence?: number | undefined;
1106
+ fallback?: string | undefined;
1107
+ }> | undefined;
1108
+ defaults?: {
1109
+ qualityModel?: string | undefined;
1110
+ costModel?: string | undefined;
1111
+ } | undefined;
1112
+ auth?: {
1113
+ anthropicApiKey?: string | undefined;
1114
+ anthropicMaxToken?: string | undefined;
1115
+ useMaxForModels?: string[] | undefined;
1116
+ } | undefined;
1117
+ }>;
1118
+ type StrategyConfig = z.infer<typeof StrategySchema>;
1119
+ type Config = z.infer<typeof ConfigSchema>;
1120
+ /**
1121
+ * Default configuration
1122
+ */
1123
+ declare const DEFAULT_CONFIG: Config;
1124
+ /**
1125
+ * Get config file path
1126
+ */
1127
+ declare function getConfigPath(): string;
1128
+ /**
1129
+ * Load and validate config
1130
+ */
1131
+ declare function loadConfig(): Config;
1132
+ /**
1133
+ * Get strategy for a task type from config
1134
+ */
1135
+ declare function getStrategy(config: Config, taskType: TaskType): StrategyConfig | null;
1136
+ /**
1137
+ * Watch config file for changes
1138
+ */
1139
+ declare function watchConfig(onChange: (config: Config) => void): void;
1140
+
1141
+ 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 };