Remove gemini-stream.ts (#84)

This module is no longer needed and the types can be provided from types.
This commit is contained in:
Jaana Dogan 2025-04-21 11:49:46 -07:00 committed by GitHub
parent 738c2692fb
commit 651a543403
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 17 additions and 23 deletions

View File

@ -1,19 +0,0 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
// Only defining the state enum needed by the UI
export enum StreamingState {
Idle = 'idle',
Responding = 'responding',
WaitingForConfirmation = 'waiting_for_confirmation',
}
// Copied from server/src/core/turn.ts for CLI usage
export enum GeminiEventType {
Content = 'content',
ToolCallRequest = 'tool_call_request',
// Add other event types if the UI hook needs to handle them
}

View File

@ -6,7 +6,7 @@
import React, { useState, useMemo } from 'react'; import React, { useState, useMemo } from 'react';
import { Box, Text } from 'ink'; import { Box, Text } from 'ink';
import type { HistoryItem } from './types.js'; import { StreamingState, type HistoryItem } from './types.js';
import { useGeminiStream } from './hooks/useGeminiStream.js'; import { useGeminiStream } from './hooks/useGeminiStream.js';
import { useLoadingIndicator } from './hooks/useLoadingIndicator.js'; import { useLoadingIndicator } from './hooks/useLoadingIndicator.js';
import { useInputHistory } from './hooks/useInputHistory.js'; import { useInputHistory } from './hooks/useInputHistory.js';
@ -15,7 +15,6 @@ import { HistoryDisplay } from './components/HistoryDisplay.js';
import { LoadingIndicator } from './components/LoadingIndicator.js'; import { LoadingIndicator } from './components/LoadingIndicator.js';
import { InputPrompt } from './components/InputPrompt.js'; import { InputPrompt } from './components/InputPrompt.js';
import { Footer } from './components/Footer.js'; import { Footer } from './components/Footer.js';
import { StreamingState } from '../core/gemini-stream.js';
import { ITermDetectionWarning } from './utils/itermDetection.js'; import { ITermDetectionWarning } from './utils/itermDetection.js';
import { import {
useStartupWarnings, useStartupWarnings,

View File

@ -30,11 +30,11 @@ import {
type Part, type Part,
} from '@google/genai'; } from '@google/genai';
import { import {
StreamingState,
HistoryItem, HistoryItem,
IndividualToolCallDisplay, IndividualToolCallDisplay,
ToolCallStatus, ToolCallStatus,
} from '../types.js'; } from '../types.js';
import { StreamingState } from '../../core/gemini-stream.js';
import { toolRegistry } from '../../tools/tool-registry.js'; import { toolRegistry } from '../../tools/tool-registry.js';
const addHistoryItem = ( const addHistoryItem = (

View File

@ -9,7 +9,7 @@ import {
WITTY_LOADING_PHRASES, WITTY_LOADING_PHRASES,
PHRASE_CHANGE_INTERVAL_MS, PHRASE_CHANGE_INTERVAL_MS,
} from '../constants.js'; } from '../constants.js';
import { StreamingState } from '../../core/gemini-stream.js'; import { StreamingState } from '../types.js';
export const useLoadingIndicator = (streamingState: StreamingState) => { export const useLoadingIndicator = (streamingState: StreamingState) => {
const [elapsedTime, setElapsedTime] = useState(0); const [elapsedTime, setElapsedTime] = useState(0);

View File

@ -7,6 +7,20 @@
import { ToolCallConfirmationDetails } from '@gemini-code/server'; import { ToolCallConfirmationDetails } from '@gemini-code/server';
import { ToolResultDisplay } from '../tools/tools.js'; import { ToolResultDisplay } from '../tools/tools.js';
// Only defining the state enum needed by the UI
export enum StreamingState {
Idle = 'idle',
Responding = 'responding',
WaitingForConfirmation = 'waiting_for_confirmation',
}
// Copied from server/src/core/turn.ts for CLI usage
export enum GeminiEventType {
Content = 'content',
ToolCallRequest = 'tool_call_request',
// Add other event types if the UI hook needs to handle them
}
export enum ToolCallStatus { export enum ToolCallStatus {
Pending = 'Pending', Pending = 'Pending',
Invoked = 'Invoked', Invoked = 'Invoked',