Skip to content

core/charts/conditions.ts ​

Generated from the exports of core/charts/conditions.ts · npm run docs:gen

Standards that cite this file: alta.chart/0.1: the Agent Chart

Exports ​

CONDITION_STATES const ​

ts
const CONDITION_STATES = ["Unknown", "Unsupported", "Blocked", "NeedsInput", "Planned", "Running", "Ready", "Drifted", "Repairing", "Failed"] as const

ConditionState type ​

ts
type ConditionState = (typeof CONDITION_STATES)[number];

CONDITION_REASONS const ​

Closed list of reasons (rule condition.reason).

ts
const CONDITION_REASONS = [ "OsNotListed", "ArchNotListed", "HostedNo", "NeedsMissing", "ResourcesShort", "RequiresMissing", "PartFirst", …

ConditionReason type ​

ts
type ConditionReason = (typeof CONDITION_REASONS)[number];

Condition interface ​

ts
interface Condition {
  state: ConditionState;
  reason?: ConditionReason;
  /** ISO date of the last change of state. */
  since: string;
  /** One short line (a FAIL line of the engine, what is missing): never a secret, never a path of the owner's files. */
  detail?: string;
}

WORST_FIRST const ​

The order of worst: the first that appears wins.

ts
const WORST_FIRST: readonly ConditionState[]

fromStep function ​

An alta.step/1 status (engine/STEPS.md). verb: the engine verb that answered (ok of an apply waits for its proof).

ts
function fromStep(status: string, verb: "plan" | "apply" | "check", since: string, detail?: string): Condition

fromRun function ​

A run of the run engine (server/runs/engine.mjs).

ts
function fromRun(state: string, since: string, detail?: string): Condition

fromJob function ​

A job (server/lib/jobs.mjs): unknown is a job the server lost at a restart.

ts
function fromJob(state: "running" | "done" | "failed" | "unknown", since: string, detail?: string): Condition

fromCheck function ​

A check result. A failing proof of something that was Ready is a drift; before that it keeps its state.

ts
function fromCheck(status: "pass" | "fail" | "unverifiable", previous: Condition | undefined, since: string): Condition

worst function ​

The worst of several conditions (a release's condition); Unknown when there are none.

ts
function worst(list: readonly (Condition | undefined)[], since = new Date(0).toISOString()): Condition

conditionProblems function ​

Problems of a condition read from a file (a release record): state and reason in the closed lists.

ts
function conditionProblems(at: string, c: unknown): string[]

conditionKey const ​

The copy key of a state or a reason, for the page (content/copy/<lang>/conditions.json).

ts
const conditionKey = (c: Pick<Condition, "state" | "reason">) => …

Alta OS is open source (MIT).