Download src/plugin-sdk/test-helpers/agents/auth-profile-runtime-contract.ts from SaylorTwift/openclaw: direct link, hf CLI and curl.
- Browser
- Download file 2.44 kB
-
https://huggingface.co/SaylorTwift/openclaw/resolve/main/src/plugin-sdk/test-helpers/agents/auth-profile-runtime-contract.ts
- Command line
-
hf download hf://SaylorTwift/openclaw/src/plugin-sdk/test-helpers/agents/auth-profile-runtime-contract.ts
-
curl -L -o auth-profile-runtime-contract.ts https://huggingface.co/SaylorTwift/openclaw/resolve/main/src/plugin-sdk/test-helpers/agents/auth-profile-runtime-contract.ts
2.44 kB
| /** | |
| * Shared contract fixtures for agent auth profile runtime behavior. | |
| */ | |
| import { | |
| resolveProviderIdForAuth, | |
| type ProviderAuthAliasLookupParams, | |
| } from "../../../agents/provider-auth-aliases.js"; | |
| import type { PluginManifestRegistry } from "../../../plugins/manifest-registry.js"; | |
| export const AUTH_PROFILE_RUNTIME_CONTRACT = { | |
| sessionId: "session-auth-contract", | |
| sessionKey: "agent:main:auth-contract", | |
| runId: "run-auth-contract", | |
| workspacePrompt: "continue with the bound Codex profile", | |
| openAiProvider: "openai", | |
| openAiCodexProvider: "openai", | |
| codexCliProvider: "codex-cli", | |
| codexHarnessProvider: "codex", | |
| claudeCliProvider: "claude-cli", | |
| openAiProfileId: "openai:work", | |
| openAiCodexProfileId: "openai:work", | |
| anthropicProfileId: "anthropic:work", | |
| } as const; | |
| export function createAuthAliasManifestRegistry(): PluginManifestRegistry { | |
| return { | |
| plugins: [ | |
| { | |
| id: "openai", | |
| origin: "bundled", | |
| channels: [], | |
| providers: [], | |
| cliBackends: [], | |
| skills: [], | |
| hooks: [], | |
| rootDir: "/tmp/openclaw-auth-contract-plugin", | |
| source: "test", | |
| manifestPath: "/tmp/openclaw-auth-contract-plugin/plugin.json", | |
| providerAuthAliases: { | |
| [AUTH_PROFILE_RUNTIME_CONTRACT.openAiCodexProvider]: | |
| AUTH_PROFILE_RUNTIME_CONTRACT.openAiProvider, | |
| [AUTH_PROFILE_RUNTIME_CONTRACT.codexCliProvider]: | |
| AUTH_PROFILE_RUNTIME_CONTRACT.openAiProvider, | |
| }, | |
| providerAuthChoices: [ | |
| { | |
| provider: AUTH_PROFILE_RUNTIME_CONTRACT.openAiProvider, | |
| method: "oauth", | |
| choiceId: AUTH_PROFILE_RUNTIME_CONTRACT.openAiProvider, | |
| deprecatedChoiceIds: [ | |
| AUTH_PROFILE_RUNTIME_CONTRACT.openAiCodexProvider, | |
| AUTH_PROFILE_RUNTIME_CONTRACT.codexCliProvider, | |
| ], | |
| }, | |
| ], | |
| }, | |
| ], | |
| diagnostics: [], | |
| }; | |
| } | |
| export function expectedForwardedAuthProfile(params: { | |
| provider: string; | |
| authProfileProvider: string; | |
| aliasLookupParams: ProviderAuthAliasLookupParams; | |
| sessionAuthProfileId: string | undefined; | |
| }): string | undefined { | |
| return resolveProviderIdForAuth(params.provider, params.aliasLookupParams) === | |
| resolveProviderIdForAuth(params.authProfileProvider, { | |
| ...params.aliasLookupParams, | |
| storedCredential: true, | |
| }) | |
| ? params.sessionAuthProfileId | |
| : undefined; | |
| } | |