openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
24 lines (23 loc) • 834 B
JavaScript
import { i as resolveOpenAICodexAuthIdentity } from "./provider-openai-chatgpt-auth-DY_g-mT7.mjs";
import "./provider-oauth-runtime-COm3dGYG.mjs";
//#region extensions/openai/realtime-auth.ts
async function resolveOpenAIChatGptSubscriptionAuth(params, { resolveProviderAuthProfileApiKey }) {
const token = await resolveProviderAuthProfileApiKey({
provider: "openai",
capability: "realtime-voice",
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 };