mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-06 23:32:12 +03:00
fix(agentrouter): support Claude and Codex protocols
This commit is contained in:
@@ -4,8 +4,8 @@
|
||||
* Keep this leaf dependency-free so server executors, compatibility bridges,
|
||||
* and client-facing identity presets can share one source of truth.
|
||||
*/
|
||||
export const CLAUDE_CODE_CLIENT_VERSION = "2.1.219";
|
||||
export const CLAUDE_CODE_CLIENT_BUILD_REVISION = "250";
|
||||
export const CLAUDE_CODE_CLIENT_VERSION = "2.1.220";
|
||||
export const CLAUDE_CODE_CLIENT_BUILD_REVISION = "1f2";
|
||||
export const CLAUDE_CODE_CLIENT_BILLING_VERSION = `${CLAUDE_CODE_CLIENT_VERSION}.${CLAUDE_CODE_CLIENT_BUILD_REVISION}`;
|
||||
export const CLAUDE_CODE_SDK_PACKAGE_VERSION = "0.94.0";
|
||||
export const CLAUDE_CODE_RUNTIME_VERSION = "v26.3.0";
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
import { getClaudeCodeUserAgent } from "./claudeCodeClient";
|
||||
import { getCodexCliRsHeaders } from "./codexClient";
|
||||
|
||||
export interface ClientIdentityProfile {
|
||||
readonly id: string;
|
||||
@@ -40,10 +41,7 @@ const CLAUDE_CLI_PROFILE: ClientIdentityProfile = Object.freeze({
|
||||
const CODEX_CLI_PROFILE: ClientIdentityProfile = Object.freeze({
|
||||
id: "codex-cli",
|
||||
label: "Codex CLI",
|
||||
headers: Object.freeze({
|
||||
"User-Agent": "codex_cli_rs/0.144.1",
|
||||
originator: "codex_cli_rs",
|
||||
}),
|
||||
headers: Object.freeze(getCodexCliRsHeaders()),
|
||||
});
|
||||
|
||||
const GEMINI_CLI_PROFILE: ClientIdentityProfile = Object.freeze({
|
||||
|
||||
11
src/shared/constants/codexClient.ts
Normal file
11
src/shared/constants/codexClient.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
export const DEFAULT_CODEX_CLIENT_VERSION = "0.146.0";
|
||||
export const CODEX_CLI_RS_ORIGINATOR = "codex_cli_rs";
|
||||
|
||||
export function getCodexCliRsHeaders(
|
||||
version = DEFAULT_CODEX_CLIENT_VERSION
|
||||
): Record<string, string> {
|
||||
return {
|
||||
"User-Agent": `${CODEX_CLI_RS_ORIGINATOR}/${version}`,
|
||||
originator: CODEX_CLI_RS_ORIGINATOR,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user