@gacua/backend
Version:
GACUA Backend
24 lines (23 loc) • 1.21 kB
TypeScript
/**
* @license
* Copyright 2025 MuleRun
* SPDX-License-Identifier: Apache-2.0
*/
import { Config } from '@gacua/gemini-cli-core';
import { type Content, type Part } from '@google/genai';
import type { SessionStatus, ToolReviewRequest, ToolReviewChoice, FunctionCall as StrictFunctionCall, StreamMessage, ToolReviewResponse } from '@gacua/shared';
import pino from 'pino';
export type AgentInput = string | {
functionCall: StrictFunctionCall;
originalFunctionCall: StrictFunctionCall;
response: ToolReviewChoice;
}[];
export type AgentPersistMessage = {
role: 'user' | 'model' | 'tool' | 'workflow' | 'grounding_model';
parts: (Part | {
imageFileName: string;
})[];
toolReview?: ToolReviewRequest | ToolReviewResponse;
forDisplay?: boolean;
};
export declare function runAgent(config: Config, historyMessages: Content[], input: AgentInput, allowedTools: string[], setSessionStatus: (status: SessionStatus, message?: string) => Promise<void>, streamMessage: (message: StreamMessage) => void, saveImage: (imageBuffer: Buffer, nameSuffix: string) => Promise<string>, persistMessage: (message: AgentPersistMessage) => Promise<void>, logger: pino.Logger): Promise<void>;