Documentation
¶
Overview ¶
Package dreamcmd holds the CLI-side plumbing shared by the REPL and the TUI for the /dream memory-consolidation command: spawning the process-isolated `golder --dream` child, detecting a live consolidation lock, parsing the dry-run flag, and rendering the returned Report. It was extracted from the REPL package so the TUI can offer the same command without importing repl.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var RunTimeout = 10 * time.Minute
RunTimeout bounds one dream subprocess (SPEC §6.3 default 10min): a hung LLM-backed pass is killed rather than wedging the caller forever.
var Spawn = spawnSubprocess
Spawn launches the dream subprocess and decodes its stdout Report. It is a package var so tests can substitute a canned Result (avoiding a real LLM-backed run); the production implementation is spawnSubprocess.
Functions ¶
func HasDryRun ¶
HasDryRun reports whether the command line carries the --dry-run flag. It accepts "--dry-run" as a standalone token so "/dream --dry-run" and "/dream --dry-run" both match, while a bare "/dream" does not.
func LockHeld ¶
LockHeld reports whether a live (non-stale) dream lock exists under memoryRoot. A missing root/lock or a stale lock (older than dream.DefaultStaleAfter, matching the runner's takeover rule) reads as not held. Read-only: it never creates, removes, or takes over the lock — that is the subprocess Runner's job.
func RenderReportLine ¶
RenderReportLine renders a compact one-line summary of a dream Report. It is used by the startup background trigger's non-intrusive notice (SPEC §6.1 background row). A dry-run report is prefixed [DRY-RUN].
func RenderReportTable ¶
RenderReportTable writes the full change report (SPEC §2.2/§6.1 manual row): one aligned row per counter, byte/file before→after, and any Notes. A dry-run report is clearly labeled DRY-RUN and states that nothing was written.