description="Injects context of all relevant cli files"
prompt = """
The source code contains the content of absolutely every source code file in
packages/cli and key files from packages/core. In addition to the source code, the following test files are
included as they are test files that conform to the project's testing standards:
`packages/cli/src/ui/components/InputPrompt.test.tsx` and `packages/cli/src/ui/App.test.tsx`.
You should very rarely need to read any other files from packages/cli to resolve
prompts.

!{find packages/cli -path packages/cli/dist -prune -o -type f \\( -name "*.ts" -o -name "*.tsx" \\) ! -name "*.test.ts" ! -name "*.test.tsx" ! -name "*.d.ts" -exec echo "--- {} ---" \\; -exec cat {} \\; && echo "--- packages/cli/src/ui/components/InputPrompt.test.tsx ---" && cat packages/cli/src/ui/components/InputPrompt.test.tsx && echo "--- packages/cli/src/ui/App.test.tsx ---" && cat packages/cli/src/ui/App.test.tsx && echo "--- packages/core/src/core/coreToolScheduler.ts ---" && cat packages/core/src/core/coreToolScheduler.ts && echo "--- packages/core/src/core/nonInteractiveToolExecutor.ts ---" && cat packages/core/src/core/nonInteractiveToolExecutor.ts && echo "--- packages/core/src/confirmation-bus/message-bus.ts ---" && cat packages/core/src/confirmation-bus/message-bus.ts && echo "--- packages/core/src/confirmation-bus/types.ts ---" && cat packages/core/src/confirmation-bus/types.ts && echo "--- packages/core/src/utils/events.ts ---" && cat packages/core/src/utils/events.ts && echo "--- packages/core/src/core/client.ts ---" && cat packages/core/src/core/client.ts && echo "--- packages/core/src/core/geminiChat.ts ---" && cat packages/core/src/core/geminiChat.ts && echo "--- packages/core/src/core/turn.ts ---" && cat packages/core/src/core/turn.ts && echo "--- packages/core/src/agents/executor.ts ---" && cat packages/core/src/agents/executor.ts && echo "--- packages/core/src/telemetry/types.ts ---" && cat packages/core/src/telemetry/types.ts && echo "--- packages/core/src/telemetry/loggers.ts ---" && cat packages/core/src/telemetry/loggers.ts && echo "--- packages/core/src/telemetry/uiTelemetry.ts ---" && cat packages/core/src/telemetry/uiTelemetry.ts}

**Pay extremely close attention to these files.** They define the project's
core architecture, component patterns, and testing standards.

In addition to the code context, you MUST strictly adhere to the following frontend-specific development guidelines while adding code to packages/cli.

## Testing Standards
*   **Async Testing**: ALWAYS use `waitFor` from `packages/cli/src/test-utils/async.ts` instead of `vi.waitFor` to prevent flakiness and `act` warnings. NEVER use fixed waits (e.g., `await delay(100)`).
*   **State Changes**: Wrap all blocks that change component state in `act`.
*   **Snapshots**: Use `toMatchSnapshot` to verify rendering.
*   **Rendering**: Use `render` or `renderWithProviders` from `packages/cli/src/test-utils/render.tsx` instead of `ink-testing-library` directly.
*   **Mocking**:
    *   Reuse existing mocks/fakes where possible.
    *   **Parameterized Tests**: Use parameterized tests with explicit types to reduce duplication and ensure type safety.
    *   Avoid mocking the file system, os, or child_process if at all possible; if you have to mock the Mock critical dependencies (`fs`, `os`, `child_process`) do so ONLY at the top of the file.

## React & Ink Architecture
*   **Keyboard Handling**: You MUST use `useKeyPress.ts` from Gemini CLI for keyboard handling, NOT the standard ink library. This is critical for supporting slow terminals and multiple events per frame.
    *   Handle multiple events gracefully (often requires a reducer pattern, see `text-buffer.ts`).
*   **State Management**:
    *   NEVER trigger side effects from within the body of a `setState` callback. Use a reducer or `useRef` if necessary.
    *   Initialize state explicitly (e.g., use `undefined` rather than `true` if unknown).
*   **Performance**:
    *   Avoid synchronous file I/O in components.
    *   Do not introduce excessive property drilling; leverage or extend existing providers.

## Configuration & Settings
*   **Settings vs Args**: Use settings for user-configurable options; do not add new CLI arguments.
*   **Schema**: Add new settings to `packages/cli/src/config/settingsSchema.ts`.
*   **Documentation**:
    *   If `showInDialog: true`, document in `docs/get-started/configuration.md`.
    *   Ensure `requiresRestart` is correctly set.

## Keyboard Shortcuts
*   **Registration**: Define new shortcuts in `packages/cli/src/config/keyBindings.ts`.
*   **Documentation**: Document all new shortcuts in `docs/cli/keyboard-shortcuts.md`.
*   **Compatibility**: Avoid function keys and common VSCode shortcuts. Be cautious with `Meta` key (Mac-limited support).

## General
*   **Logging**: Use `debugLogger` for errors. NEVER leave `console.log/warn/error` in the code.
*   **TypeScript**: Avoid the non-null assertion operator (`!`).

{{args}}. 
 """