mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 08:22:47 +00:00
refactor: rename to openclaw
This commit is contained in:
@@ -12,15 +12,15 @@ import {
|
||||
resolveProfileUnusableUntilForDisplay,
|
||||
} from "../agents/auth-profiles.js";
|
||||
import { updateAuthProfileStoreWithLock } from "../agents/auth-profiles/store.js";
|
||||
import type { MoltbotConfig } from "../config/config.js";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import { note } from "../terminal/note.js";
|
||||
import { formatCliCommand } from "../cli/command-format.js";
|
||||
import type { DoctorPrompter } from "./doctor-prompter.js";
|
||||
|
||||
export async function maybeRepairAnthropicOAuthProfileId(
|
||||
cfg: MoltbotConfig,
|
||||
cfg: OpenClawConfig,
|
||||
prompter: DoctorPrompter,
|
||||
): Promise<MoltbotConfig> {
|
||||
): Promise<OpenClawConfig> {
|
||||
const store = ensureAuthProfileStore();
|
||||
const repair = repairOAuthProfileIdMismatch({
|
||||
cfg,
|
||||
@@ -55,9 +55,9 @@ function pruneAuthOrder(
|
||||
}
|
||||
|
||||
function pruneAuthProfiles(
|
||||
cfg: MoltbotConfig,
|
||||
cfg: OpenClawConfig,
|
||||
profileIds: Set<string>,
|
||||
): { next: MoltbotConfig; changed: boolean } {
|
||||
): { next: OpenClawConfig; changed: boolean } {
|
||||
const profiles = cfg.auth?.profiles;
|
||||
const order = cfg.auth?.order;
|
||||
const nextProfiles = profiles ? { ...profiles } : undefined;
|
||||
@@ -96,9 +96,9 @@ function pruneAuthProfiles(
|
||||
}
|
||||
|
||||
export async function maybeRemoveDeprecatedCliAuthProfiles(
|
||||
cfg: MoltbotConfig,
|
||||
cfg: OpenClawConfig,
|
||||
prompter: DoctorPrompter,
|
||||
): Promise<MoltbotConfig> {
|
||||
): Promise<OpenClawConfig> {
|
||||
const store = ensureAuthProfileStore(undefined, { allowKeychainPrompt: false });
|
||||
const deprecated = new Set<string>();
|
||||
if (store.profiles[CLAUDE_CLI_PROFILE_ID] || cfg.auth?.profiles?.[CLAUDE_CLI_PROFILE_ID]) {
|
||||
@@ -113,13 +113,13 @@ export async function maybeRemoveDeprecatedCliAuthProfiles(
|
||||
const lines = ["Deprecated external CLI auth profiles detected (no longer supported):"];
|
||||
if (deprecated.has(CLAUDE_CLI_PROFILE_ID)) {
|
||||
lines.push(
|
||||
`- ${CLAUDE_CLI_PROFILE_ID} (Anthropic): use setup-token → ${formatCliCommand("moltbot models auth setup-token")}`,
|
||||
`- ${CLAUDE_CLI_PROFILE_ID} (Anthropic): use setup-token → ${formatCliCommand("openclaw models auth setup-token")}`,
|
||||
);
|
||||
}
|
||||
if (deprecated.has(CODEX_CLI_PROFILE_ID)) {
|
||||
lines.push(
|
||||
`- ${CODEX_CLI_PROFILE_ID} (OpenAI Codex): use OAuth → ${formatCliCommand(
|
||||
"moltbot models auth login --provider openai-codex",
|
||||
"openclaw models auth login --provider openai-codex",
|
||||
)}`,
|
||||
);
|
||||
}
|
||||
@@ -190,16 +190,16 @@ type AuthIssue = {
|
||||
|
||||
function formatAuthIssueHint(issue: AuthIssue): string | null {
|
||||
if (issue.provider === "anthropic" && issue.profileId === CLAUDE_CLI_PROFILE_ID) {
|
||||
return `Deprecated profile. Use ${formatCliCommand("moltbot models auth setup-token")} or ${formatCliCommand(
|
||||
"moltbot configure",
|
||||
return `Deprecated profile. Use ${formatCliCommand("openclaw models auth setup-token")} or ${formatCliCommand(
|
||||
"openclaw configure",
|
||||
)}.`;
|
||||
}
|
||||
if (issue.provider === "openai-codex" && issue.profileId === CODEX_CLI_PROFILE_ID) {
|
||||
return `Deprecated profile. Use ${formatCliCommand(
|
||||
"moltbot models auth login --provider openai-codex",
|
||||
)} or ${formatCliCommand("moltbot configure")}.`;
|
||||
"openclaw models auth login --provider openai-codex",
|
||||
)} or ${formatCliCommand("openclaw configure")}.`;
|
||||
}
|
||||
return `Re-auth via \`${formatCliCommand("moltbot configure")}\` or \`${formatCliCommand("moltbot onboard")}\`.`;
|
||||
return `Re-auth via \`${formatCliCommand("openclaw configure")}\` or \`${formatCliCommand("openclaw onboard")}\`.`;
|
||||
}
|
||||
|
||||
function formatAuthIssueLine(issue: AuthIssue): string {
|
||||
@@ -210,7 +210,7 @@ function formatAuthIssueLine(issue: AuthIssue): string {
|
||||
}
|
||||
|
||||
export async function noteAuthProfileHealth(params: {
|
||||
cfg: MoltbotConfig;
|
||||
cfg: OpenClawConfig;
|
||||
prompter: DoctorPrompter;
|
||||
allowKeychainPrompt: boolean;
|
||||
}): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user