gemini-flow
Version:
🧠Gemini Flow - AI-Powered Development Orchestration with Google Gemini API Integration
188 lines • 4.73 kB
TypeScript
/**
* Gemini Session Manager - Type Definitions
* Echte Gemini API Integration mit Multi-Session Support
*/
export interface GeminiConfig {
apiKey: string;
model?: string;
maxTokens?: number;
temperature?: number;
topP?: number;
topK?: number;
}
export interface SessionConfig {
sessionId: string;
agentType: AgentType;
capabilities: string[];
systemPrompt?: string;
maxHistory?: number;
persistent?: boolean;
}
export interface AgentSession {
id: string;
type: AgentType;
capabilities: string[];
geminiSession: any;
state: SessionState;
memory: SessionMemory;
coordination: CoordinationState;
lastActivity: Date;
totalTokens: number;
performance: PerformanceMetrics;
}
export interface SessionState {
status: 'idle' | 'active' | 'busy' | 'error' | 'terminated';
currentTask?: string;
progress: number;
errors: SessionError[];
context: Map<string, any>;
}
export interface SessionMemory {
shortTerm: Map<string, any>;
longTerm: Map<string, any>;
shared: SharedMemory;
coordination: CoordinationMemory;
}
export interface SharedMemory {
swarmId: string;
agentStates: Map<string, any>;
sharedContext: Map<string, any>;
decisions: Decision[];
coordination: CoordinationPoint[];
}
export interface CoordinationMemory {
decisions: Decision[];
communications: AgentCommunication[];
dependencies: Map<string, string[]>;
synchronization: SyncPoint[];
}
export interface Decision {
id: string;
agentId: string;
timestamp: Date;
decision: string;
reasoning: string;
impact: string[];
sharedWith: string[];
}
export interface AgentCommunication {
from: string;
to: string[];
timestamp: Date;
message: any;
type: 'coordination' | 'data' | 'decision' | 'sync';
priority: 'low' | 'medium' | 'high' | 'critical';
}
export interface CoordinationPoint {
id: string;
type: 'sync' | 'barrier' | 'decision' | 'merge';
participants: string[];
timestamp: Date;
data: any;
status: 'pending' | 'completed' | 'failed';
}
export interface SyncPoint {
id: string;
timestamp: Date;
participants: string[];
data: any;
completed: boolean;
}
export interface CoordinationState {
swarmId?: string;
role: AgentRole;
peers: string[];
coordinationLevel: number;
lastSync: Date;
pendingCoordination: CoordinationTask[];
}
export interface CoordinationTask {
id: string;
type: 'sync' | 'decision' | 'merge' | 'barrier';
priority: number;
deadline?: Date;
participants: string[];
data: any;
}
export interface PerformanceMetrics {
requestCount: number;
averageResponseTime: number;
totalTokensUsed: number;
errorRate: number;
efficiency: number;
}
export interface SessionError {
timestamp: Date;
error: Error;
context: string;
recovery?: string;
}
export type AgentType = 'researcher' | 'coder' | 'analyst' | 'architect' | 'tester' | 'coordinator' | 'optimizer' | 'monitor' | 'specialist';
export type AgentRole = 'leader' | 'follower' | 'coordinator' | 'specialist' | 'monitor';
export interface SwarmConfig {
swarmId: string;
topology: 'hierarchical' | 'mesh' | 'ring' | 'star';
maxAgents: number;
strategy: 'balanced' | 'specialized' | 'adaptive';
coordination: CoordinationConfig;
}
export interface CoordinationConfig {
syncInterval: number;
memorySharing: boolean;
consensusRequired: boolean;
leaderElection: boolean;
faultTolerance: number;
}
export interface TaskContext {
taskId: string;
description: string;
priority: number;
dependencies: string[];
assignedAgents: string[];
progress: TaskProgress;
results: TaskResult[];
}
export interface TaskProgress {
started: Date;
progress: number;
currentStep: string;
completedSteps: string[];
errors: TaskError[];
}
export interface TaskResult {
agentId: string;
timestamp: Date;
result: any;
confidence: number;
tokens: number;
}
export interface TaskError {
agentId: string;
timestamp: Date;
error: Error;
recovery: string;
}
export interface GeminiMessage {
role: 'user' | 'model';
parts: {
text: string;
}[];
}
export interface GeminiResponse {
candidates: {
content: {
parts: {
text: string;
}[];
role: string;
};
finishReason: string;
index: number;
}[];
usageMetadata?: {
promptTokenCount: number;
candidatesTokenCount: number;
totalTokenCount: number;
};
}
//# sourceMappingURL=gemini.d.ts.map