@phren/cli
Version:
Knowledge layer for AI agents - CLI, MCP server, and data layer
60 lines (59 loc) • 3.62 kB
TypeScript
/**
* `phren dream run|status|log|eval`: the CLI over the dream engine (dream/run.ts)
* and its outputs under `<store>/<project>/dreams/`. The MCP `dream_*` tools
* (tools/dream.ts) call the same functions.
*/
import type { DreamMode } from "../config/dreaming.js";
import { type DreamStatus } from "../bridge/dream-schedule.js";
export declare const DREAM_USAGE = "phren dream - reorganize a project's memory offline (docs/dreaming.md)\n\n phren dream run [--project <p>] [--dry-run] [--apply|--propose] [--force] [--json]\n Run a dream now. --dry-run shows the changeset without writing; --apply/--propose\n override dreaming.mode; --force runs even when dreaming is off.\n phren dream apply <runId> [--project <p>] [--only <n,m,...>] [--reject|--resolve <applied|rejected>] [--reason <text>] [--json]\n Apply or reject structured proposals by zero-based index. Resolve a conflict with one index and the chosen outcome.\n phren dream status [--project <p>] [--limit <n>] [--json]\n Timing, last outcome and acceptance by operation over the latest runs\n (every project when --project is omitted and the folder is not a project).\n phren dream log [--project <p>] [--limit <n>] [--json]\n The latest entries of the project's dream journal (dreams/journal.md).\n phren dream eval [--real] [--model <m>] [--json]\n Score the dream engine on the bundled fixture store (a scripted model unless --real).\n\nTurn it on with: phren config dreaming set enabled=true [cadence=nightly|idle|weekly|manual]";
export declare const DREAM_LOG_DEFAULT_LIMIT = 20;
export declare const DREAM_LIST_MAX_LIMIT = 500;
export interface DreamRunArgs {
project?: string;
dryRun: boolean;
mode?: DreamMode;
force: boolean;
scheduled: boolean;
json: boolean;
}
export interface DreamListArgs {
project?: string;
limit: number;
json: boolean;
}
export interface DreamEvalArgs {
real: boolean;
model?: string;
json: boolean;
}
type Parsed<T> = {
ok: true;
value: T;
} | {
ok: false;
error: string;
};
export declare function parseDreamRunArgs(args: string[]): Parsed<DreamRunArgs>;
export declare function parseDreamListArgs(args: string[], verb: "status" | "log" | "apply"): Parsed<DreamListArgs>;
export declare function parseDreamEvalArgs(args: string[]): Parsed<DreamEvalArgs>;
/** The named project, else the one this folder belongs to. */
export declare function resolveDreamProject(phrenPath: string, project: string | undefined, profile?: string, cwd?: string): string | undefined;
export interface DreamRunOutcome {
project: string;
status: string;
result: Record<string, unknown>;
counts?: Record<string, number>;
}
/** Run one dream; the engine owns the marker inside its project lock. */
export declare function runDream(phrenPath: string, project: string, opts: {
dryRun?: boolean;
mode?: DreamMode;
force?: boolean;
trigger?: "manual" | "scheduled";
}): Promise<DreamRunOutcome>;
/** The last `limit` entries of `dreams/journal.md`, newest first. An entry is a non-blank line that is not a heading. */
export declare function readDreamJournal(phrenPath: string, project: string, limit?: number): string[];
/** Status for one project or, with none named or detected, for every project in the profile. */
export declare function dreamStatuses(phrenPath: string, project: string | undefined, profile?: string, now?: Date, limit?: number): DreamStatus[];
export declare function handleDreamCommand(args: string[], phrenPath: string, profile?: string): Promise<void>;
export {};