MCPcopy Index your code
hub / github.com/winfunc/opcode / AgentState

Interface AgentState

src/stores/agentStore.ts:7–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5import type { AgentRunWithMetrics } from '@/lib/api';
6
7interface AgentState {
8 // Agent runs data
9 agentRuns: AgentRunWithMetrics[];
10 runningAgents: Set<string>;
11 sessionOutputs: Record<string, string>;
12
13 // UI state
14 isLoadingRuns: boolean;
15 isLoadingOutput: boolean;
16 error: string | null;
17 lastFetchTime: number;
18
19 // Actions
20 fetchAgentRuns: (forceRefresh?: boolean) => Promise<void>;
21 fetchSessionOutput: (runId: number) => Promise<void>;
22 createAgentRun: (data: { agentId: number; projectPath: string; task: string; model?: string }) => Promise<AgentRunWithMetrics>;
23 cancelAgentRun: (runId: number) => Promise<void>;
24 deleteAgentRun: (runId: number) => Promise<void>;
25 clearError: () => void;
26
27 // Real-time updates
28 handleAgentRunUpdate: (run: AgentRunWithMetrics) => void;
29
30 // Polling management
31 startPolling: (interval?: number) => void;
32 stopPolling: () => void;
33 pollingInterval: NodeJS.Timeout | null;
34}
35
36const agentStore: StateCreator<
37 AgentState,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected