From 702a407007a9d5d3ec9600d90f1bb75c7c30a5fe Mon Sep 17 00:00:00 2001 From: Koosha Paridehpour Date: Tue, 24 Feb 2026 23:29:37 -0700 Subject: [PATCH] Layer 3: cherry-pick full-sdk type unification --- .../active/pkg/llmproxy/config/sdk_config.go | 13 ------ .../active/pkg/llmproxy/config/sdk_types.go | 43 +++++++++++++++++++ 2 files changed, 43 insertions(+), 13 deletions(-) delete mode 100644 .worktrees/config/m/config-build/active/pkg/llmproxy/config/sdk_config.go create mode 100644 .worktrees/config/m/config-build/active/pkg/llmproxy/config/sdk_types.go diff --git a/.worktrees/config/m/config-build/active/pkg/llmproxy/config/sdk_config.go b/.worktrees/config/m/config-build/active/pkg/llmproxy/config/sdk_config.go deleted file mode 100644 index 63e25a079b..0000000000 --- a/.worktrees/config/m/config-build/active/pkg/llmproxy/config/sdk_config.go +++ /dev/null @@ -1,13 +0,0 @@ -// Package config provides configuration management for the CLI Proxy API server. -// It handles loading and parsing YAML configuration files, and provides structured -// access to application settings including server port, authentication directory, -// debug settings, proxy configuration, and API keys. -package config - -import internalconfig "github.com/router-for-me/CLIProxyAPI/v6/internal/config" - -// SDKConfig is an alias to internal/config.SDKConfig. -type SDKConfig = internalconfig.SDKConfig - -// StreamingConfig is an alias to internal/config.StreamingConfig. -type StreamingConfig = internalconfig.StreamingConfig diff --git a/.worktrees/config/m/config-build/active/pkg/llmproxy/config/sdk_types.go b/.worktrees/config/m/config-build/active/pkg/llmproxy/config/sdk_types.go new file mode 100644 index 0000000000..bf4fb90ecf --- /dev/null +++ b/.worktrees/config/m/config-build/active/pkg/llmproxy/config/sdk_types.go @@ -0,0 +1,43 @@ +// Package config provides configuration types for CLI Proxy API. +// This file contains SDK-specific config types that are used by internal/* packages. +package config + +// SDKConfig represents the SDK-level configuration embedded in Config. +type SDKConfig struct { + // ProxyURL is the URL of an optional proxy server to use for outbound requests. + ProxyURL string `yaml:"proxy-url" json:"proxy-url"` + + // ForceModelPrefix requires explicit model prefixes (e.g., "teamA/gemini-3-pro-preview") + // to target prefixed credentials. When false, unprefixed model requests may use prefixed + // credentials as well. + ForceModelPrefix bool `yaml:"force-model-prefix" json:"force-model-prefix"` + + // RequestLog enables or disables detailed request logging functionality. + RequestLog bool `yaml:"request-log" json:"request-log"` + + // APIKeys is a list of keys for authenticating clients to this proxy server. + APIKeys []string `yaml:"api-keys" json:"api-keys"` + + // PassthroughHeaders controls whether upstream response headers are forwarded to downstream clients. + // Default is false (disabled). + PassthroughHeaders bool `yaml:"passthrough-headers" json:"passthrough-headers"` + + // Streaming configures server-side streaming behavior (keep-alives and safe bootstrap retries). + Streaming StreamingConfig `yaml:"streaming" json:"streaming"` + + // NonStreamKeepAliveInterval controls how often blank lines are emitted for non-streaming responses. + // <= 0 disables keep-alives. Value is in seconds. + NonStreamKeepAliveInterval int `yaml:"nonstream-keepalive-interval,omitempty" json:"nonstream-keepalive-interval,omitempty"` +} + +// StreamingConfig holds server streaming behavior configuration. +type StreamingConfig struct { + // KeepAliveSeconds controls how often the server emits SSE heartbeats (": keep-alive\n\n"). + // <= 0 disables keep-alives. Default is 0. + KeepAliveSeconds int `yaml:"keepalive-seconds,omitempty" json:"keepalive-seconds,omitempty"` + + // BootstrapRetries controls how many times the server may retry a streaming request before any bytes are sent, + // to allow auth rotation / transient recovery. + // <= 0 disables bootstrap retries. Default is 0. + BootstrapRetries int `yaml:"bootstrap-retries,omitempty" json:"bootstrap-retries,omitempty"` +}