feat: implement protocol parity and harden upstream handling (#88)
* feat: implement protocol parity and harden upstream handling * docs(agents): add lodash-es utility method and named import guideline
This commit is contained in:
23 files changed
+4408
-654
No files matched your search
@@ -10,6 +10,7 @@ export interface CloudTokenData {
|
||||
email?: string;
|
||||
project_id?: string;
|
||||
session_id?: string;
|
||||
upstream_proxy_url?: string;
|
||||
}
|
||||
|
||||
export interface CloudQuotaData {
|
||||
@@ -48,6 +49,7 @@ export const CloudTokenDataSchema = z.object({
|
||||
email: z.string().optional(),
|
||||
project_id: z.string().optional(),
|
||||
session_id: z.string().optional(),
|
||||
upstream_proxy_url: z.string().optional(),
|
||||
});
|
||||
|
||||
export const CloudQuotaDataSchema = z.object({
|
||||
|
||||
@@ -10,6 +10,8 @@ export const ProxyConfigSchema = z.object({
|
||||
port: z.number(), // 监听端口
|
||||
api_key: z.string(), // API 密钥 (Also used for Admin Mode auth)
|
||||
auto_start: z.boolean(), // 是否自动启动
|
||||
backend_canary_enabled: z.boolean().default(true),
|
||||
custom_mapping: z.record(z.string(), z.string()).default({}),
|
||||
anthropic_mapping: z.record(z.string(), z.string()), // 映射表
|
||||
request_timeout: z.number().default(120), // 超时秒数
|
||||
upstream_proxy: UpstreamProxyConfigSchema,
|
||||
@@ -49,6 +51,8 @@ export const DEFAULT_APP_CONFIG: AppConfig = {
|
||||
port: 8045,
|
||||
api_key: '', // Generated dynamically if default needed
|
||||
auto_start: false,
|
||||
backend_canary_enabled: true,
|
||||
custom_mapping: {},
|
||||
anthropic_mapping: {},
|
||||
request_timeout: 120,
|
||||
upstream_proxy: {
|
||||
|
||||
Reference in new issue
Block a user