Remove gemini-stream.ts (#84)
This module is no longer needed and the types can be provided from types.
This commit is contained in:
parent
738c2692fb
commit
651a543403
|
@ -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
|
||||
}
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
import React, { useState, useMemo } from 'react';
|
||||
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 { useLoadingIndicator } from './hooks/useLoadingIndicator.js';
|
||||
import { useInputHistory } from './hooks/useInputHistory.js';
|
||||
|
@ -15,7 +15,6 @@ import { HistoryDisplay } from './components/HistoryDisplay.js';
|
|||
import { LoadingIndicator } from './components/LoadingIndicator.js';
|
||||
import { InputPrompt } from './components/InputPrompt.js';
|
||||
import { Footer } from './components/Footer.js';
|
||||
import { StreamingState } from '../core/gemini-stream.js';
|
||||
import { ITermDetectionWarning } from './utils/itermDetection.js';
|
||||
import {
|
||||
useStartupWarnings,
|
||||
|
|
|
@ -30,11 +30,11 @@ import {
|
|||
type Part,
|
||||
} from '@google/genai';
|
||||
import {
|
||||
StreamingState,
|
||||
HistoryItem,
|
||||
IndividualToolCallDisplay,
|
||||
ToolCallStatus,
|
||||
} from '../types.js';
|
||||
import { StreamingState } from '../../core/gemini-stream.js';
|
||||
import { toolRegistry } from '../../tools/tool-registry.js';
|
||||
|
||||
const addHistoryItem = (
|
||||
|
|
|
@ -9,7 +9,7 @@ import {
|
|||
WITTY_LOADING_PHRASES,
|
||||
PHRASE_CHANGE_INTERVAL_MS,
|
||||
} from '../constants.js';
|
||||
import { StreamingState } from '../../core/gemini-stream.js';
|
||||
import { StreamingState } from '../types.js';
|
||||
|
||||
export const useLoadingIndicator = (streamingState: StreamingState) => {
|
||||
const [elapsedTime, setElapsedTime] = useState(0);
|
||||
|
|
|
@ -7,6 +7,20 @@
|
|||
import { ToolCallConfirmationDetails } from '@gemini-code/server';
|
||||
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 {
|
||||
Pending = 'Pending',
|
||||
Invoked = 'Invoked',
|
||||
|
|
Loading…
Reference in New Issue