import type { AgentToolCallEvent, AgentToolDependencies, AgentToolResultEvent } from "./agent-tools.js"; import { discoverAgentRequest, discoverAgentRequestFromContext } from "./agent-browser-discovery.js"; import type { AgentMemoryEntry, AgentPhaseEndEvent, AgentPhaseStartEvent, AgentProviderConfig, SavedAuthUser, SerializedCookie } from "./types.js"; type ContextDiscoveryResult = Awaited>; type PageDiscoveryResult = Awaited>; type PendingAgentFollowUp = { kind: "clarify-objective"; originalInput: string; } | { kind: "provide-page-url"; originalInput: string; }; type AgentWorkflowResult = { memoryEntry: AgentMemoryEntry; responseData: unknown; type: "context-discovery"; } | { memoryEntry: AgentMemoryEntry; responseData: unknown; type: "manual-page-discovery"; } | { memoryEntry: AgentMemoryEntry; responseData: unknown; type: "memory-hit"; } | { followUp?: PendingAgentFollowUp; message: string; type: "unresolved"; }; interface ResolveAgentWorkflowDependencies { discoverFromContext: (options: { cookies: SerializedCookie[]; headed?: boolean; objective: string; projectOrigin: string; }) => Promise; discoverFromPage: (options: { cookies: SerializedCookie[]; headed?: boolean; objective: string; pageUrl: string; projectOrigin: string; }) => Promise; executeRequest: (options: { cookies: SerializedCookie[]; entry: AgentMemoryEntry; projectOrigin: string; }) => Promise; loadMemory: (homeDir: string) => Promise; promptUser: (message: string) => Promise; saveMemory: (homeDir: string, entry: Omit) => Promise; searchMemory: (entries: AgentMemoryEntry[], query: string) => AgentMemoryEntry[]; } export declare function isCorrectionFeedback(input: string): boolean; export declare function buildVisibleKeywordPromptForCorrection(pageUrl: string): string; export declare function shouldClarifyObjectiveBeforeDiscovery(input: string): boolean; export declare function buildClarificationPromptForObjective(input: string): string; export declare function shouldPersistDiscoveryMemory(options: { followUpKind?: PendingAgentFollowUp["kind"]; input: string; keywords?: string[]; pagePath?: string; readOnlyConfirmed?: boolean; requestRelativePath?: string; responseGuide?: string; responseSample?: unknown; selectedRequestSummary?: string; }): boolean; export declare function classifyFollowUpInput(pendingFollowUp: PendingAgentFollowUp, input: string): { kind: PendingAgentFollowUp["kind"]; value: string; }; export declare function canRequestPageUrlAfterContextDiscovery(result?: ContextDiscoveryResult): boolean; export declare function resolveAgentWorkflow(options: { cookies: SerializedCookie[]; followUp?: { kind: PendingAgentFollowUp["kind"]; value: string; }; headed?: boolean; homeDir: string; input: string; projectOrigin: string; }, dependencies: ResolveAgentWorkflowDependencies): Promise; export declare function createAgentTurnRunner(options: { cookies: SerializedCookie[]; headed?: boolean; homeDir: string; onPhaseEnd?: (event: AgentPhaseEndEvent) => Promise | void; onPhaseStart?: (event: AgentPhaseStartEvent) => Promise | void; onToolCall?: (event: AgentToolCallEvent) => Promise | void; onToolResult?: (event: AgentToolResultEvent) => Promise | void; promptUser: (message: string) => Promise; provider: AgentProviderConfig; user: SavedAuthUser; }, dependencies?: Partial): (input: string) => Promise; export declare function createDeterministicMemoryOnlyTurnRunner(options: { cookies: SerializedCookie[]; headed?: boolean; homeDir: string; user: SavedAuthUser; }, dependencies?: Partial): (input: string) => Promise; export {}; //# sourceMappingURL=agent-runtime.d.ts.map