File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import { createRequire } from "node:module" ;
2- import { fileURLToPath , pathToFileURL } from "node:url" ;
31import { callbackTargetFor } from "@corbits/oauth-core" ;
2+ import { codexOAuthConfig } from "@corbits/codex-provider" ;
43
5- const require = createRequire ( import . meta. url ) ;
6- const packageIndex = pathToFileURL ( require . resolve ( "@corbits/codex-provider" ) ) ;
7- const codexConstants = require (
8- fileURLToPath ( new URL ( "./constants.js" , packageIndex ) ) ,
9- ) as {
10- CODEX_BASE_URL : string ;
11- CODEX_REDIRECT_URI : string ;
12- CODEX_RESPONSES_PATH : string ;
13- } ;
14- const { codexOAuthConfig } = require (
15- fileURLToPath ( new URL ( "./oauth.js" , packageIndex ) ) ,
16- ) as {
17- codexOAuthConfig : Parameters < typeof callbackTargetFor > [ 0 ] ;
18- } ;
19-
20- export const CODEX_BASE_URL = codexConstants . CODEX_BASE_URL ;
21- export const CODEX_REDIRECT_URI = codexConstants . CODEX_REDIRECT_URI ;
22- export const CODEX_RESPONSES_PATH = codexConstants . CODEX_RESPONSES_PATH ;
4+ export {
5+ CODEX_BASE_URL ,
6+ CODEX_REDIRECT_URI ,
7+ CODEX_RESPONSES_PATH ,
8+ } from "@corbits/codex-provider" ;
239
2410const callbackTarget = callbackTargetFor ( codexOAuthConfig ) ;
2511export const CODEX_CALLBACK_HOST = callbackTarget . host ;
Original file line number Diff line number Diff line change 1- import { createRequire } from "node:module" ;
2- import { fileURLToPath , pathToFileURL } from "node:url" ;
31import { callbackTargetFor } from "@corbits/oauth-core" ;
4-
5- const require = createRequire ( import . meta. url ) ;
6- const packageIndex = pathToFileURL ( require . resolve ( "@corbits/xai-provider" ) ) ;
7- const {
8- XAI_DEFAULT_MODELS : VENDOR_XAI_DEFAULT_MODELS ,
9- XAI_OAUTH_PROXY_BASE_URL : XAI_BASE_URL ,
10- } = require ( fileURLToPath ( new URL ( "./constants.js" , packageIndex ) ) ) as {
11- XAI_DEFAULT_MODELS : readonly string [ ] ;
12- XAI_OAUTH_PROXY_BASE_URL : string ;
13- } ;
14- const { xaiOAuthConfig } = require (
15- fileURLToPath ( new URL ( "./oauth.js" , packageIndex ) ) ,
16- ) as {
17- xaiOAuthConfig : Parameters < typeof callbackTargetFor > [ 0 ] ;
18- } ;
2+ import {
3+ XAI_DEFAULT_MODELS as VENDOR_XAI_DEFAULT_MODELS ,
4+ XAI_OAUTH_PROXY_BASE_URL as XAI_BASE_URL ,
5+ xaiOAuthConfig ,
6+ } from "@corbits/xai-provider" ;
197
208export { XAI_BASE_URL } ;
219
Load diff This file was deleted.
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import { responsesAdapterFactory } from "@corbits/openai-responses";
22import { XAI_USER_ID_OPTION , xaiResponsesQuirks } from "@corbits/xai-provider" ;
33import type { AdapterFactory } from "@intx/inference" ;
44
5- export { GROK_RESPONSES_PROVIDER } from "./ grok-responses-id.js ";
5+ export const GROK_RESPONSES_PROVIDER = " grok-responses";
66
77export const GROK_USER_ID_OPTION = "grokUserId" ;
88export const GROK_SESSION_ID_OPTION = "grokSessionId" ;
Original file line number Diff line number Diff line change 1- import { GROK_RESPONSES_PROVIDER } from "../provider/grok-responses-id.js" ;
2- import { isXaiProviderName } from "../config/xai-providers.js" ;
3- import { isCodexProviderName } from "../config/codex-providers.js" ;
41import { isDeepSeekModel } from "../provider/deepseek-v4-effort.js" ;
52
3+ /** Wire id for the Grok Responses adapter. Duplicated in grok-responses.ts so
4+ * this module does not load @corbits/openai-responses at reactor boot. */
5+ const GROK_RESPONSES_PROVIDER = "grok-responses" ;
6+
7+ /** Prefixes owned by config/xai-providers.ts and config/codex-providers.ts.
8+ * Inlined so a name check does not evaluate those modules' provider barrels. */
9+ const XAI_PROVIDER_PREFIX = "xai/" ;
10+ const CODEX_PROVIDER_PREFIX = "codex/" ;
11+
12+ function isXaiProviderName ( name : string ) : boolean {
13+ return name . startsWith ( XAI_PROVIDER_PREFIX ) ;
14+ }
15+
16+ function isCodexProviderName ( name : string ) : boolean {
17+ return name . startsWith ( CODEX_PROVIDER_PREFIX ) ;
18+ }
19+
620/** True when the leaf inference path is xAI / Grok. For small prompt
721 * residuals only. */
822export function isXaiGrokLeafProvider ( input : {
You can’t perform that action at this time.
0 commit comments