/**
* @license
* Copyright 2025 Vybestack LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { Box, Newline, Text } from 'ink';
import { useCallback } from 'react';
import { RadioButtonSelect } from '../components/shared/RadioButtonSelect.js';
import { usePrivacySettings } from '../hooks/usePrivacySettings.js';
import { CloudPaidPrivacyNotice } from './CloudPaidPrivacyNotice.js';
import { Colors } from '../colors.js';
import { useKeypress } from '../hooks/useKeypress.js';
import type { AgentClientSource } from '../cliUiRuntime.js';
interface CloudFreePrivacyNoticeProps {
config: AgentClientSource;
onExit: () => void;
}
const PrivacyNoticeHeader: React.FC = () => (
<>
Gemini Code Assist for Individuals Privacy Notice
This notice and our Privacy Policy
[1] describe how Gemini Code Assist
handles your data. Please read them carefully.
>
);
const PrivacyNoticeBody: React.FC = () => (
<>
When you use Gemini Code Assist for individuals with LLxprt Code, Google
collects your prompts, related code, generated output, code edits, related
feature usage information, and your feedback to provide, improve, and
develop Google products and services and machine learning technologies.
To help with quality and improve our products (such as generative
machine-learning models), human reviewers may read, annotate, and process
the data collected above. We take steps to protect your privacy as part of
this process. This includes disconnecting the data from your Google
Account before reviewers see or annotate it, and storing those
disconnected copies for up to 18 months. Please don't submit
confidential information or any data you wouldn't want a reviewer to
see or Google to use to improve our products, services and
machine-learning technologies.
>
);
const PrivacyNoticeFooter: React.FC = () => (
<>
[1]{' '}
https://policies.google.com/privacy
Press Enter to choose an option and exit.
>
);
const OPT_IN_ITEMS = [
{ label: 'Yes', value: true, key: 'true' },
{ label: 'No', value: false, key: 'false' },
];
export const CloudFreePrivacyNotice = ({
config,
onExit,
}: CloudFreePrivacyNoticeProps) => {
const { privacyState, updateDataCollectionOptIn } =
usePrivacySettings(config);
const handleSelect = useCallback(
(value: boolean) => {
void updateDataCollectionOptIn(value);
if (!privacyState.error) {
onExit();
}
},
[updateDataCollectionOptIn, privacyState.error, onExit],
);
useKeypress(
(key) => {
if (privacyState.error && key.name === 'escape') {
onExit();
}
},
{ isActive: true },
);
if (privacyState.isLoading) {
return Loading...;
}
if (privacyState.error) {
return (
Error loading Opt-in settings: {privacyState.error}
Press Esc to exit.
);
}
if (privacyState.isFreeTier === false) {
return ;
}
return (
Allow Google to use this data to develop and improve our products?
);
};