import { type TaskResearchResult } from '@xopcai/gateway-contract'; import { z } from 'zod'; export { taskInstructionSequence } from './task-instruction-sequence.js'; export declare const TaskResearchSubmissionSchema: z.ZodObject<{ followUp: z.ZodOptional; nextStep: z.ZodString; reason: z.ZodString; }, z.core.$strict>, z.ZodObject<{ state: z.ZodLiteral<"waiting">; waitingFor: z.ZodString; nextStep: z.ZodOptional; }, z.core.$strict>, z.ZodObject<{ state: z.ZodLiteral<"review_goal">; reason: z.ZodString; }, z.core.$strict>], "state">>; finalText: z.ZodOptional; finalArtifactIds: z.ZodOptional>; replacementArtifactIds: z.ZodOptional>; mode: z.ZodOptional>; retireClaimIds: z.ZodOptional>; sources: z.ZodDefault; excerpt: z.ZodOptional; excerptRange: z.ZodOptional>; url: z.ZodOptional; }, z.core.$strict>>>; claims: z.ZodDefault; sourceIds: z.ZodArray; }, z.core.$strict>>>; }, z.core.$strict>; export type TaskResearchSubmission = z.infer; export declare function mergeResearchSubmission(input: TaskResearchSubmission, previous?: TaskResearchResult): TaskResearchSubmission; declare const ReviewSchema: z.ZodObject<{ claims: z.ZodArray; note: z.ZodString; }, z.core.$strip>>; checks: z.ZodArray; claimIds: z.ZodArray; note: z.ZodString; }, z.core.$strip>>; instructions: z.ZodOptional; claimIds: z.ZodArray; note: z.ZodString; }, z.core.$strip>>>; }, z.core.$strict>; export type ResearchReview = z.infer; type RetrievalObservation = { tool: string; target: string; outcome: 'read' | 'empty' | 'failed'; }; export type ResearchReviewer = (input: { conversationId: string; brief: string; criteria: string[]; result: TaskResearchResult; artifacts?: Array<{ title: string; content?: string; contentReviewed: boolean; }>; retrieval?: RetrievalObservation[]; }, signal?: AbortSignal) => Promise; export type ToolRecord = { toolCallId: string; toolName: string; body: string; url?: string; observedAt: number; }; /** Quotes are matched against persisted successful reads from this execution, never worker-supplied snapshots. */ export declare function bindResearchSources(submission: TaskResearchSubmission, tools: ToolRecord[]): TaskResearchResult['sources']; export declare function applyResearchReview(result: TaskResearchResult, raw: unknown, criteria: string[]): TaskResearchResult; export declare const reviewResearchResult: ResearchReviewer; export declare function currentTaskResearchResult(runId: string): TaskResearchResult | undefined; export declare function supersededTaskInstructionIds(taskId: string): Set; export declare function verifiesTaskInstructions(taskId: string, research: TaskResearchResult): boolean; /** Read the execution transcript only; worker drafts, failures and other runs never become evidence. */ export declare function taskResearchEvidence(conversationId: string): { rows: { payload_json: string; created_at: number; }[]; tools: ToolRecord[]; }; export declare function submitTaskResearchResult(conversationId: string, toolCallId: string, raw: unknown, signal?: AbortSignal, reviewer?: ResearchReviewer): Promise;