@phren/cli
Version:
Knowledge layer for AI agents - CLI, MCP server, and data layer
41 lines (40 loc) • 1.83 kB
TypeScript
/**
* The dreaming eval: build the fixture in a temp directory, run `dream()` on it
* in propose mode, read back what it proposed and score it.
*
* `model: "scripted"` (the default, used by tests) answers from the prompt with
* `scriptedRunner`. `model: "real"` runs the project's helper (`claude -p`) with
* the owner's own environment, for `phren dream eval --real`; it costs a real
* model call.
*
* The run points PHREN_PATH and HOME at the fixture so collect reads its
* transcripts and nothing else. Both are restored afterwards; do not run the
* eval concurrently with other work in the same process.
*/
import { type DreamFn } from "./dream-adapter.js";
import { type EvalScore } from "./score.js";
export { buildEvalFixture, EVAL_PROJECT, EVAL_NOW, FIDS } from "./fixture.js";
export { scoreChanges, formatScore, extractChanges, readLatestDream } from "./score.js";
export { scriptedRunner, scriptedChanges, scriptedReply } from "./scripted-model.js";
export type { EvalFixture } from "./fixture.js";
export type { EvalScore, EvalCheck } from "./score.js";
export interface DreamEvalOptions {
model?: "scripted" | "real";
/** B's `dream`; defaults to the integrated one. */
dream?: DreamFn;
/** Keep the fixture directory for inspection instead of removing it. */
keep?: boolean;
/** Use this empty directory instead of a fresh temp one (implies keep). */
root?: string;
}
export interface DreamEvalReport {
model: "scripted" | "real";
score: EvalScore;
/** Where the fixture was built; removed unless `keep` or `root` was given. */
root: string;
kept: boolean;
/** Prompts the scripted model saw (empty for a real run). */
prompts: string[];
error?: string;
}
export declare function runDreamEval(opts?: DreamEvalOptions): Promise<DreamEvalReport>;