/** * CareerVividProxyEngine * * A drop-in replacement for QueryEngine that routes all Gemini API calls * through the CareerVivid `agentProxy` Firebase function instead of calling * Gemini directly. This allows users without a personal Gemini key to use * the AI agent via their CareerVivid account credits. * * The proxy handles: * - Authentication (via cv_live_... API key) * - Credit deduction (atomically with each Gemini call) * - Gemini API call (server-side, using the CareerVivid Gemini secret) * * The engine handles: * - History management * - Tool execution (locally, in the CLI) * - Agentic loop (multi-turn tool calls) * - Context compaction */ import type { Content } from "@google/genai"; import { Tool } from "./Tool.js"; export interface ProxyEngineOptions { cvApiKey: string; model?: string; systemInstruction?: string; tools?: Tool[]; thinkingBudget?: number; includeThoughts?: boolean; maxHistoryLength?: number; } export interface ProxyIterationHook { onStart?: () => void; onResponse?: (creditInfo: { creditsUsed: number; creditsRemaining: number; monthlyLimit: number; }) => void | Promise; onToolCall?: (toolName: string, args: any) => Promise; onToolResult?: (toolName: string, result: any) => void; onError?: (error: Error) => void; onChunk?: (text: string) => void; onThinking?: (thought: string) => void; onCompacting?: () => void; /** Fired when credit limit is reached — engine will stop the loop */ onCreditLimitReached?: (remaining: number) => void; } export declare class CareerVividProxyEngine { private cvApiKey; private model; private systemInstruction; private tools; private toolMap; private thinkingBudget; private includeThoughts; private maxHistoryLength; private history; private sessionCreditsUsed; private lastKnownRemaining; private monthlyLimit; constructor(options: ProxyEngineOptions); getHistory(): Content[]; setHistory(history: Content[]): void; /** Credits used in this session */ get sessionUsed(): number; /** Last known remaining credits */ get remaining(): number | null; private callProxy; private compactHistory; private executeToolCalls; runLoopStreaming(prompt: string, hooks?: ProxyIterationHook): Promise; runLoop(prompt: string, hooks?: ProxyIterationHook): Promise; } //# sourceMappingURL=CareerVividProxyEngine.d.ts.map