repos_status_load.ts

Reads fleet git state from the Rust repos binary: runs repos status <keys…> --json through the injected ReposOperations and parses what it printed with the repos_status.ts mirror.

Parsing is pure (parse_repos_status_output): the format version is read first, so a binary and npm package out of step fail with both versions and the install command rather than a schema error; then the document is parsed strictly as a report or, when it carries error, as an error document, whose kind maps to a message saying what to change.

view source

Declarations
#

5 declarations

load_repos_status
#

repos_status_load.ts view source

(options: { keys: string[]; registry?: string | undefined; fetch?: boolean | undefined; repos_ops: ReposOperations; }): Promise<Result<{ report: { version: 18; workspace: string; registry: string; fetched: boolean; sessions: { ...; } | { ...; }; entries: { ...; }[]; unregistered: ({ ...; } | ... 4 more ... | { ...; })[] | null; }; }, ReposStatusLoadFailure>> import {load_repos_status} from '@fuzdev/fuz_repos/repos_status_load.js';

Runs repos status <keys…> --json and parses its report.

options

type { keys: string[]; registry?: string | undefined; fetch?: boolean | undefined; repos_ops: ReposOperations; }

returns

Promise<Result>

the report, or a message saying what went wrong and what to change

parse_repos_status_output
#

repos_status_load.ts view source

(output: ReposCommandOutput): Result<{ report: { version: 18; workspace: string; registry: string; fetched: boolean; sessions: { kind: "available"; unscoped: { pid: number; cwd: string; worktree: string | null; process_cwd: string | null; source: "session_file" | "roster_worker"; }[]; } | { ...; }; entries: { ...; }[]; unregistered: ({ ...; } | ... 4 more ... | { ...; })[] | null; }; }, ReposStatusLoadFailure> import {parse_repos_status_output} from '@fuzdev/fuz_repos/repos_status_load.js';

Parses what repos status --json printed into its report, or a message saying what went wrong and what to change.

output

the command's stdout, stderr, and exit code

returns

Result

the report, or a message naming the error document's kind and hint, a format version mismatch, or output that isn't a status document; an error document rides along as error

REPOS_INSTALL_COMMAND
#

repos_status_load.ts view source

"cargo install --path crates/fuz_repos --locked" import {REPOS_INSTALL_COMMAND} from '@fuzdev/fuz_repos/repos_status_load.js';

How to install the repos binary, run in a fuz_repos checkout. The npm package doesn't carry the binary, so the two are installed separately.

ReposStatusLoadFailure
#

repos_status_load.ts view source

ReposStatusLoadFailure import type {ReposStatusLoadFailure} from '@fuzdev/fuz_repos/repos_status_load.js';

Why repos status gave no report: a message saying what to change, and the error document when repos printed one.

message

type string

error?

type ReposStatusErrorBody

to_repos_command
#

repos_status_load.ts view source

(registry: string | undefined): string import {to_repos_command} from '@fuzdev/fuz_repos/repos_status_load.js';

The repos invocation a suggested fix names: repos, or `repos --registry <path>` when the run passed one, the path POSIX-shell-quoted when it needs it.

registry

the run's --registry, if any

type string | undefined

returns

string

the command prefix, ready for a subcommand

Depends on
#

Imported by
#