Skip to main content

@flow-state-dev/harness-manager/work-place

Interfaces​

WorkPlace​

Where a run's work went.

Properties​

attachedTo​
readonly attachedTo: string | null;

The session that owns the worktree, when the viewer is another session attached to it; else null.

baseCommit​
readonly baseCommit: string | null;

The commit the branch was cut at, or null when none was recorded.

branch​
readonly branch: string;
commands​
readonly commands: WorkPlaceCommands;
commits​
readonly commits: number | null;

How many commits the branch has past its base; null when unknown, never a guessed zero.

name​
readonly name: string | null;

The worktree's descriptive name, when the source is a worktree row.

path​
readonly path: string | null;

The run's checkout, or null when the source names none.

state​
readonly state: string | null;

The row's state (ready, removed, lost, ...), or null when the source has none.


WorkPlaceCommands​

The commands that take a person to a run's work.

Properties​

cd​
readonly cd: string | null;

cd <path> into the run's own checkout; null when the source names none.

log​
readonly log: string | null;

git log <baseCommit>..<branch>, the run's commits; null when no base was recorded.

switch​
readonly switch: string;

git switch <branch>, run in the repository the branch lives in.


WorkPlaceViewer​

Who is looking: the viewing session, so a row owned by another session says whose it is.

Properties​

session?​
readonly session?: string;

Functions​

shellWord()​

function shellWord(value): string;

One shell word: as it is when it is plainly safe, else single-quoted.

Parameters​

value​

string

Returns​

string


workPlace()​

function workPlace(source, viewer?): WorkPlace | null;

Where a run's work went, from a task's output or a worktree row. null when the source names no branch: a run with only kept files, a detached HEAD, a session not yet provisioned, or anything else.

Parameters​

source​

unknown

viewer?​

WorkPlaceViewer

Returns​

WorkPlace | null

Example​

workPlace(task.output);
workPlace(worktreeRow, { session: sessionId });