style: prettier formatting from pre-commit hook
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -253,7 +253,9 @@ export async function fetchClaudeUsageViaCli(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function fetchAllClaudeProfiles(): Promise<ClaudeAccountProfile[]> {
|
export async function fetchAllClaudeProfiles(): Promise<
|
||||||
|
ClaudeAccountProfile[]
|
||||||
|
> {
|
||||||
return ensureProfiles();
|
return ensureProfiles();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -74,7 +74,8 @@ function resolveActiveIndex(accountDirs: string[]): number {
|
|||||||
const hostAuth = readTextIfExists(path.join(HOST_CODEX_DIR, 'auth.json'));
|
const hostAuth = readTextIfExists(path.join(HOST_CODEX_DIR, 'auth.json'));
|
||||||
if (hostAuth) {
|
if (hostAuth) {
|
||||||
const matchIndex = accountDirs.findIndex(
|
const matchIndex = accountDirs.findIndex(
|
||||||
(accountDir) => readTextIfExists(path.join(accountDir, 'auth.json')) === hostAuth,
|
(accountDir) =>
|
||||||
|
readTextIfExists(path.join(accountDir, 'auth.json')) === hostAuth,
|
||||||
);
|
);
|
||||||
if (matchIndex >= 0) {
|
if (matchIndex >= 0) {
|
||||||
activeIndexCache = matchIndex;
|
activeIndexCache = matchIndex;
|
||||||
@@ -93,7 +94,10 @@ function copyIfExists(src: string, dst: string): void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function syncHostCodexAccount(accountDir: string): void {
|
function syncHostCodexAccount(accountDir: string): void {
|
||||||
copyIfExists(path.join(accountDir, 'auth.json'), path.join(HOST_CODEX_DIR, 'auth.json'));
|
copyIfExists(
|
||||||
|
path.join(accountDir, 'auth.json'),
|
||||||
|
path.join(HOST_CODEX_DIR, 'auth.json'),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getAllCodexAccounts(): CodexAccountState[] {
|
export function getAllCodexAccounts(): CodexAccountState[] {
|
||||||
@@ -134,8 +138,7 @@ export function rotateCodexToken(_reason?: string): boolean {
|
|||||||
const nextIndex =
|
const nextIndex =
|
||||||
candidates.find(
|
candidates.find(
|
||||||
(index) => index !== activeIndex && !rateLimitedAccounts.has(index),
|
(index) => index !== activeIndex && !rateLimitedAccounts.has(index),
|
||||||
) ??
|
) ?? candidates.find((index) => index !== activeIndex);
|
||||||
candidates.find((index) => index !== activeIndex);
|
|
||||||
|
|
||||||
if (nextIndex === undefined) return false;
|
if (nextIndex === undefined) return false;
|
||||||
|
|
||||||
|
|||||||
@@ -105,10 +105,7 @@ export function evaluateTaskSuspension(
|
|||||||
/**
|
/**
|
||||||
* Apply suspension to a task in the DB.
|
* Apply suspension to a task in the DB.
|
||||||
*/
|
*/
|
||||||
export function suspendTask(
|
export function suspendTask(taskId: string, suspendedUntil: string): void {
|
||||||
taskId: string,
|
|
||||||
suspendedUntil: string,
|
|
||||||
): void {
|
|
||||||
updateTask(taskId, { suspended_until: suspendedUntil });
|
updateTask(taskId, { suspended_until: suspendedUntil });
|
||||||
logger.info(
|
logger.info(
|
||||||
{ taskId, suspendedUntil },
|
{ taskId, suspendedUntil },
|
||||||
|
|||||||
@@ -29,7 +29,10 @@ function syncHostClaudeAccount(accountDir: string): void {
|
|||||||
path.join(accountDir, '.credentials.json'),
|
path.join(accountDir, '.credentials.json'),
|
||||||
path.join(HOST_CLAUDE_DIR, '.credentials.json'),
|
path.join(HOST_CLAUDE_DIR, '.credentials.json'),
|
||||||
);
|
);
|
||||||
copyIfExists(path.join(accountDir, 'settings.json'), path.join(HOST_CLAUDE_DIR, 'settings.json'));
|
copyIfExists(
|
||||||
|
path.join(accountDir, 'settings.json'),
|
||||||
|
path.join(HOST_CLAUDE_DIR, 'settings.json'),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getTokenCount(): number {
|
export function getTokenCount(): number {
|
||||||
@@ -47,8 +50,7 @@ export function rotateToken(_reason?: string): boolean {
|
|||||||
const nextIndex =
|
const nextIndex =
|
||||||
candidates.find(
|
candidates.find(
|
||||||
(index) => index !== activeIndex && !rateLimitedAccounts.has(index),
|
(index) => index !== activeIndex && !rateLimitedAccounts.has(index),
|
||||||
) ??
|
) ?? candidates.find((index) => index !== activeIndex);
|
||||||
candidates.find((index) => index !== activeIndex);
|
|
||||||
|
|
||||||
if (nextIndex === undefined) return false;
|
if (nextIndex === undefined) return false;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user