SPB Git

Repository Public License

ProviderKit.swift 1.9 KB 30 lines swift

1// ProviderKit — the bring-your-own-key AI provider layer of ORIX Navigator.2//3// The browser works fully without this module: nothing here runs until the user configures a provider.4//5// Layout:6//   JSONValue.swift            JSON tree used for request bodies, tool schemas and tool arguments7//   ChatModel.swift            provider-neutral messages, tools, options, events, `ChatProvider`8//   ProviderError.swift        typed, user-presentable errors; HTTP status mapping; secret scrubbing9//   HTTPTransport.swift        injectable transport (URLSession in production, scripted in tests)10//   SSEParser.swift            byte-level server-sent-events parser11//   ProviderHTTP.swift         retries with backoff, timeouts, error bodies, parameter fallback12//   ChatCompletions.swift      the OpenAI Chat Completions wire format shared by three families13//   AnthropicProvider.swift, OpenAIProvider.swift, OpenRouterProvider.swift, CompatibleProvider.swift14//   EndpointPolicy.swift       HTTPS rule for user-supplied endpoints15//   LocalModels.swift          `LocalModelRuntime`, device capability check, `LocalProvider`16//   FoundationModelsRuntime.swift   Apple on-device model, compiled only where the SDK has it17//   Pricing.swift              price table and cost estimates (always labelled as estimates)18//   UsageLedger.swift          per-space / per-provider totals19//   ProviderRegistry.swift     configured providers, limits, secrets through `ProviderSecretSource`20//21// Dependencies: Foundation, NavigatorCore, Diagnostics. Nothing else, and never Persistence.2223/// Namespace for module-wide constants.24public enum ProviderKit {25    /// Sent as `User-Agent` product token and as the OpenRouter application title.26    public static let applicationName = "ORIX Navigator"27    /// Sent as OpenRouter's `HTTP-Referer` (application attribution, not a tracking identifier).28    public static let applicationURL = "https://www.orixlab.dev"29}30
Files main
Menu

Theme