openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
23 lines (22 loc) • 800 B
JavaScript
import { i as resolveOpenAICodexAuthIdentity } from "./provider-openai-chatgpt-auth-BoLGEnud.js";
import "./provider-oauth-runtime-CduuU4e2.js";
//#region extensions/openai/realtime-auth.ts
async function resolveOpenAIChatGptSubscriptionAuth(params, { resolveProviderAuthProfileApiKey }) {
const token = await resolveProviderAuthProfileApiKey({
provider: "openai",
cfg: params.cfg,
agentDir: params.agentDir,
profileTypes: ["oauth"],
includeExternalCliAuth: false
});
if (!token) return;
const accountId = resolveOpenAICodexAuthIdentity({ access: token }).accountId;
if (!accountId) throw new Error("The selected ChatGPT OAuth profile is missing its account id");
return {
type: "oauth",
token,
accountId
};
}
//#endregion
export { resolveOpenAIChatGptSubscriptionAuth as t };