(null);
const [copiedApiKey, setCopiedApiKey] = useState(false);
const [copiedSecret, setCopiedSecret] = useState(false);
- const [agyAckBypass, setAgyAckBypass] = useState(false);
- const [agyAckBypassLoading, setAgyAckBypassLoading] = useState(true);
- const [agyAckBypassSaving, setAgyAckBypassSaving] = useState(false);
- const agyAckBypassSavingRef = useRef(false);
// Fetch tokens
const fetchTokens = useCallback(async () => {
@@ -77,28 +71,11 @@ export default function AuthSection() {
}
}, []);
- const fetchAgyAckBypass = useCallback(async () => {
- try {
- setAgyAckBypassLoading(true);
- const response = await fetch('/api/settings/auth/antigravity-risk');
- if (!response.ok) {
- throw new Error('Failed to load Antigravity power user settings');
- }
- const data = (await response.json()) as { antigravityAckBypass?: boolean };
- setAgyAckBypass(data.antigravityAckBypass === true);
- } catch (err) {
- setError(err instanceof Error ? err.message : 'Unknown error');
- } finally {
- setAgyAckBypassLoading(false);
- }
- }, []);
-
// Load on mount
useEffect(() => {
fetchTokens();
- fetchAgyAckBypass();
fetchRawConfig();
- }, [fetchTokens, fetchAgyAckBypass, fetchRawConfig]);
+ }, [fetchTokens, fetchRawConfig]);
// Clear success after timeout
useEffect(() => {
@@ -118,8 +95,6 @@ export default function AuthSection() {
// Save all changes
const saveChanges = async () => {
- if (agyAckBypassSaving) return;
-
const hasApiKeyChange = editedApiKey !== null && editedApiKey !== tokens?.apiKey.value;
const hasSecretChange =
editedSecret !== null && editedSecret !== tokens?.managementSecret.value;
@@ -159,8 +134,6 @@ export default function AuthSection() {
// Regenerate management secret
const regenerateSecret = async () => {
- if (agyAckBypassSaving) return;
-
try {
setSaving(true);
setError(null);
@@ -185,8 +158,6 @@ export default function AuthSection() {
// Reset to defaults
const resetToDefaults = async () => {
- if (agyAckBypassSaving) return;
-
try {
setSaving(true);
setError(null);
@@ -226,50 +197,11 @@ export default function AuthSection() {
setTimeout(() => setCopiedSecret(false), 2000);
};
- const saveAgyAckBypass = async (nextValue: boolean) => {
- if (agyAckBypassSavingRef.current || agyAckBypassSaving || saving) return;
-
- if (nextValue) {
- const confirmed = window.confirm(
- 'Enable AGY power user mode?\n\nThis skips AGY safety prompts. You accept the OAuth risk.'
- );
- if (!confirmed) return;
- }
-
- try {
- agyAckBypassSavingRef.current = true;
- setAgyAckBypassSaving(true);
- setError(null);
-
- const response = await fetch('/api/settings/auth/antigravity-risk', {
- method: 'PUT',
- headers: { 'Content-Type': 'application/json' },
- body: JSON.stringify({ antigravityAckBypass: nextValue }),
- });
-
- if (!response.ok) {
- const data = (await response.json()) as { error?: string };
- throw new Error(data.error || 'Failed to update Antigravity power user mode');
- }
-
- setAgyAckBypass(nextValue);
- setSuccess(
- nextValue ? 'Antigravity power user mode enabled.' : 'Antigravity power user mode disabled.'
- );
- await fetchRawConfig();
- } catch (err) {
- setError(err instanceof Error ? err.message : 'Unknown error');
- } finally {
- agyAckBypassSavingRef.current = false;
- setAgyAckBypassSaving(false);
- }
- };
-
const refreshAll = async () => {
- if (loading || saving || agyAckBypassSaving) return;
+ if (loading || saving) return;
setError(null);
setSuccess(null);
- await Promise.all([fetchTokens(), fetchAgyAckBypass(), fetchRawConfig()]);
+ await Promise.all([fetchTokens(), fetchRawConfig()]);
};
if (loading || !tokens) {
@@ -344,7 +276,7 @@ export default function AuthSection() {
value={displayApiKey}
onChange={(e) => setEditedApiKey(e.target.value)}
placeholder="API key"
- disabled={saving || agyAckBypassSaving}
+ disabled={saving}
className="pr-20 font-mono text-sm"
/>
@@ -395,7 +327,7 @@ export default function AuthSection() {
value={displaySecret}
onChange={(e) => setEditedSecret(e.target.value)}
placeholder="Management secret"
- disabled={saving || agyAckBypassSaving}
+ disabled={saving}
className="pr-20 font-mono text-sm"
/>
@@ -426,7 +358,7 @@ export default function AuthSection() {
variant="outline"
size="sm"
onClick={regenerateSecret}
- disabled={saving || agyAckBypassSaving}
+ disabled={saving}
title="Generate new secure secret"
>
@@ -434,48 +366,12 @@ export default function AuthSection() {
- {/* Actions */}
-
-
-
-
-
-
Antigravity Power User Mode
-
-
- Skip AGY responsibility checklists in Add Account and `ccs agy` flows.
-
-
-
-
-
- Use only if you fully understand the OAuth suspension/ban risk pattern (#509). CCS
- cannot assume responsibility for account loss.
-
-
- Toggle AGY power user mode
-
-
-
+ {/* Safety */}
+
+
+
+ Safety
+
+
+
+
+
Antigravity Power User Mode
+
+ Skip AGY responsibility checklist in Add Account and `ccs agy` flows.
+
+
+
+
+
+ Use only if you fully understand the OAuth suspension/ban risk pattern (#509). CCS
+ cannot assume responsibility for account loss.
+
+
+ Toggle AGY power user mode
+
+
+
+
{/* Remote Settings - Show when remote mode is enabled */}
{isRemoteMode && (
{
fetchConfig();
+ fetchAgyAckBypass();
fetchRawConfig();
fetchBackend();
checkPlusOnlyVariants();
}}
- disabled={loading || saving}
+ disabled={loading || saving || agyAckBypassSaving}
className="w-full"
>