@struktoai/mirage-core
Version:
A Unified Virtual Filesystem For AI Agents
102 lines • 4.42 kB
TypeScript
import type { CommitFacts } from './format.ts';
export declare const SKIPPED = "...";
export declare const BOUNDARY = "o";
/**
* The `--graph` column to the left of a log, one commit at a time. Every
* walked commit moves the graph on; a commit the log does not print draws
* nothing, and the next printed one is preceded by a `...` row. Lines move
* one cell per row, skipping a column another line stands in, and slide under
* a run of standing columns with `_`; a printed commit owes the rows its
* lines need to settle. A `--boundary` commit is drawn with `o`; a line leads
* on from it only to a parent the graph draws too. A path-limited walk hands
* over the parents it drew its history with.
*
* A root, a commit none of whose parents is in the walk and that no merge drew
* as a later parent, stands a column right of its own when the commit walked
* next has no line leading to it, unless that one is a root too with more
* walked after it. Each root after a root, but the last commit walked, climbs
* a column further right, back to its own column every fourth; one a line
* leads to joins a run already climbing. A line leading to a root a column
* right bends on a row of its own, which is the separator a format puts before
* the commit, or none after a `...` row. Pinned against git 2.56.0. `order`
* is every commit the graph is walked through, in order. Mirrors CommitGraph
* in graph.py.
*/
export declare class CommitGraph {
private readonly interesting;
private readonly firstParent;
private readonly order;
private readonly boundary;
private readonly parents;
private lines;
private pending;
private walked;
private skipped;
private resumed;
private afterRoot;
private stairs;
private readonly fanned;
private owed;
private ahead;
private width;
private mergedAt;
constructor(interesting: (oid: string) => boolean, firstParent: boolean, order: readonly CommitFacts[], boundary?: ReadonlySet<string>, parents?: ReadonlyMap<string, readonly string[]> | null);
/** Move on to the next walked commit, printed or not. */
walk(commit: CommitFacts): void;
/**
* The rows before the walked commit's own, each with its newline, then the
* cells of its own row, to be followed by its first line; once the commit is
* drawn, the cells in front of a further header.
*/
leadIn(): string;
/** The cells in front of the commit's next line of text. */
nextRow(): string;
/**
* The cells in front of a line once the commit's rows are out. Before a
* walked commit yet to be drawn it is the `...` row when commits were
* skipped, the commit's first row when it spreads the lines to its right or
* bends the line leading to it, and otherwise a row as wide as the commit's
* where the lines stop. Before a commit leaving with a lead and two or more
* parents besides, the lines right of it stand a cell over, and the row
* widens by the octopus's dashes and a cell.
*/
filler(): string;
/**
* The commit's text with the graph in front of each further line, then the
* rows the commit still owes; when the text ends with a newline the owed
* rows end with one too.
*/
around(text: string): string;
private skipRow;
private columns;
private ownParents;
private isRoot;
private followed;
private parentsOf;
private shape;
/**
* Move the lines through a commit's rows, each row yielded as it is drawn,
* so that a commit the log skips holds none of them.
*/
private place;
private spreadRows;
private commitRow;
private mergeRow;
private settled;
/**
* Move a line one row toward its column: the cells it draws and their
* glyphs. `standing` holds the cells of columns whose lines stand still this
* row, which a moving line passes under; `glide` whether it may slide under
* a run of them; `taken` the cells lines start a collapsing row in.
*/
private step;
private collapseRow;
private join;
/**
* A row of every line in its column; with `settle` the lines stop too,
* otherwise a line still on its way keeps going on the next commit's row;
* with `past` the lines right of that cell are drawn a cell further right.
*/
private rest;
}
//# sourceMappingURL=graph.d.ts.map