/** * evolve-filter — Pure scoring and filtering logic for evolve proposals. * * No side effects. All functions are deterministic. * Also exports createEvolveScoreTool() for LLM-facing tool registration. */ import { tool } from "@opencode-ai/plugin"; import { z } from "zod"; export interface EvolveProposal { title: string; priority: "P0" | "P1" | "P2"; effort: "Low" | "Medium" | "High"; description: string; files?: string[]; currentState?: string; inspiration?: string; } /** * JSONL schema for evolve proposals. * * Accepts both canonical keys (description/currentState) and legacy keys * (why/how/current_state) used by older evolve prompts. */ export declare const EvolveProposalSchema: z.ZodType; export type ProposalJsonlValidation = { ok: true; proposal: EvolveProposal; } | { ok: false; error: string; }; /** * Parse and validate a single JSONL line. * * Returns {ok:false,error} for invalid lines so callers can skip with reason. */ export declare function validateProposalJsonl(line: string): ProposalJsonlValidation; /** * Merge existing + incoming proposals, skipping duplicates by normalized title. * * Normalization: lowercase + punctuation/symbol/whitespace removed. */ export declare function deduplicateProposals(existing: EvolveProposal[], incoming: EvolveProposal[]): EvolveProposal[]; export interface FilteredProposal extends EvolveProposal { score: number; accepted: boolean; reason?: string; } export interface FilterConfig { minScore?: number; maxProposals?: number; } export declare function scoreProposal(p: EvolveProposal): number; export declare function filterProposals(proposals: EvolveProposal[], config?: FilterConfig): FilteredProposal[]; /** * Parse Sisyphus evolve output into structured proposals. * * Expected format (from keyword-detector EVOLVE_MESSAGE Phase 3): * ``` * ## Improvement: [Feature Name] * **Inspiration**: [Plugin name] — [what it does] * **Current state**: [what opencode-ultra has now] * **Why**: [concrete benefit] * **How**: [which file to modify, what to add] * **Effort**: Low / Medium / High * **Priority**: P0 / P1 / P2 * ``` */ export declare function parseProposalsFromMarkdown(markdown: string): EvolveProposal[]; /** * Tool: evolve_score * * Takes evolve proposal markdown, parses it, scores each proposal, * and returns a prioritized list. Pure computation, no agent spawning. */ export declare function createEvolveScoreTool(): ReturnType;