/** * Deep research workflow. * Built-in workflow for comprehensive research across multiple sources. */ import { type ToolDefinition } from "@earendil-works/pi-coding-agent"; export interface DeepResearchConfig { /** Number of distinct search angles/queries to explore. */ angles: number; /** Minimum distinct sources required for a claim to survive cross-checking. */ minSupport: number; } /** * Modest, documented bounds for `/deep-research` (issue #122). They keep * unusually large model output from overflowing / clipping the agent-result * channel while staying generous enough for ordinary research. */ export declare const DEEP_RESEARCH_BOUNDS: Readonly<{ /** Max research-question length in characters. */ readonly maxQuestionChars: 2000; /** Min/max number of search angles (fan-out width). */ readonly minAngles: 1; readonly maxAngles: 8; /** Cap on gathered sources fed into cross-checking (fan-in). */ readonly maxSources: 32; /** Per-source claim cap. */ readonly maxClaimsPerSource: 12; /** Char cap on a single source URL. */ readonly maxUrlChars: 400; /** Char cap on a single extracted claim. */ readonly maxClaimChars: 800; /** Char cap on the JSON payload handed to the verify/report agents. */ readonly maxSourcesJsonChars: 60000; /** Char cap on the final report text. */ readonly maxReportChars: 8000; }>; /** * Tool pool for `/deep-research` subagents: read-only repository tools plus the * real `web_search` / `web_fetch` tools. Research agents cannot mutate the * workspace because `createReadOnlyTools` returns only `read`, `grep`, `find`, * `ls` (no `bash`, `edit`, `write`). The handler additionally sets the run-level * `readOnly` fence (see `deepResearchSafetyOptions`) so an `agentType` * allowlist / harness config can never re-grant a write tool. */ export declare function createDeepResearchTools(cwd: string): ToolDefinition[]; /** * The safety-relevant subset of `/deep-research`'s `runWorkflow` options — * extracted as a pure, testable seam. Spreading this into the handler's run * options guarantees the run is read-only and web-enabled without relying on * prompt text alone. */ export declare function deepResearchSafetyOptions(cwd: string): { tools: ToolDefinition[]; readOnly: true; }; /** * Generate a deep-research workflow that uses the real web_search/web_fetch tools. * * The script is static and reads its inputs from `args` (question/angles/minSupport), * so the question is never string-interpolated into source — no escaping hazards. * Inject the web tools at run time via the agent's `tools` option. * * Bounds (issue #122): question/angles/minSupport are validated up front and * fail with a clear `Error` message; gathered sources and the final report are * capped with explicit truncation notes so unusually large output never silently * overflows the agent-result channel. */ export declare function generateDeepResearchWorkflow(): string; /** * Generate a codebase audit workflow. */ export declare function generateCodebaseAuditWorkflow(scope: string, checks: string[]): string;