dreamcmd

package
v1.4.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 21, 2026 License: MIT Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
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.

View Source
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

func HasDryRun(line string) bool

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

func LockHeld(memoryRoot string) bool

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

func RenderReportLine(r dream.Report) string

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

func RenderReportTable(out io.Writer, r dream.Report)

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.

Types

type Result

type Result struct {
	Report dream.Report
	Stderr string
}

Result is the parsed outcome of one spawn: the decoded Report plus whatever the child wrote to stderr (surfaced in error messages so a failing run is diagnosable).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL