Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 10 additions & 1 deletion src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
import { authorizeAntigravity, exchangeAntigravity } from "./antigravity/oauth";
import type { AntigravityTokenExchangeResult } from "./antigravity/oauth";
import { accessTokenExpired, isOAuthAuth, parseRefreshParts, formatRefreshParts } from "./plugin/auth";
import { promptAddAnotherAccount, promptLoginMode, promptProjectId } from "./plugin/cli";
import { promptAddAnotherAccount, promptLoginMode, promptProjectId, promptContinue } from "./plugin/cli";
import { ensureProjectContext } from "./plugin/project";
import {
startAntigravityDebugRequest,
Expand Down Expand Up @@ -2692,6 +2692,7 @@ export const createAntigravityPlugin = (providerId: string) => async (
await saveAccounts(existingStorage);
}
console.log("");
await promptContinue();
continue;
}

Expand All @@ -2703,6 +2704,7 @@ export const createAntigravityPlugin = (providerId: string) => async (
await saveAccounts(existingStorage);
activeAccountManager?.setAccountEnabled(menuResult.toggleAccountIndex, acc.enabled);
console.log(`\nAccount ${acc.email || menuResult.toggleAccountIndex + 1} ${acc.enabled ? 'enabled' : 'disabled'}.\n`);
await promptContinue();
}
}
continue;
Expand All @@ -2714,6 +2716,7 @@ export const createAntigravityPlugin = (providerId: string) => async (
if (verifyAll) {
if (existingStorage.accounts.length === 0) {
console.log("\nNo accounts available to verify.\n");
await promptContinue();
continue;
}

Expand Down Expand Up @@ -2793,6 +2796,7 @@ export const createAntigravityPlugin = (providerId: string) => async (
console.log("");
}

await promptContinue();
continue;
}

Expand All @@ -2803,12 +2807,14 @@ export const createAntigravityPlugin = (providerId: string) => async (

if (verifyAccountIndex === undefined) {
console.log("\nVerification cancelled.\n");
await promptContinue();
continue;
}

const account = existingStorage.accounts[verifyAccountIndex];
if (!account) {
console.log(`\nAccount ${verifyAccountIndex + 1} not found.\n`);
await promptContinue();
continue;
}

Expand All @@ -2829,6 +2835,7 @@ export const createAntigravityPlugin = (providerId: string) => async (
} else {
console.log(`✓ ${label} is ready for requests.\n`);
}
await promptContinue();
continue;
}

Expand Down Expand Up @@ -2866,10 +2873,12 @@ export const createAntigravityPlugin = (providerId: string) => async (
} else {
console.log("No verification URL was returned. Try re-authenticating this account.\n");
}
await promptContinue();
continue;
}

console.log(`✗ ${label}: ${verification.message}\n`);
await promptContinue();
continue;
}

Expand Down
11 changes: 11 additions & 0 deletions src/plugin/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ export async function promptAddAnotherAccount(currentCount: number): Promise<boo
}
}

export async function promptContinue(): Promise<void> {
if (!isTTY()) return;
const rl = createInterface({ input, output });
try {
await rl.question("Press Enter to return to menu...");
} finally {
rl.close();
}
}
Comment thread
greptile-apps[bot] marked this conversation as resolved.

export type LoginMode = "add" | "fresh" | "manage" | "check" | "verify" | "verify-all" | "cancel";

export interface ExistingAccountInfo {
Expand Down Expand Up @@ -149,6 +159,7 @@ export async function promptLoginMode(existingAccounts: ExistingAccountInfo[]):
} else {
console.log(`\n✗ Failed to configure models: ${result.error}\n`);
}
await promptContinue();
continue;
}

Expand Down