Skip to content

zidane-ui/machines/headless

import { … } from 'zidane-ui/machines/headless'ui/src/machines/headless/index.ts

Functions#

agoTextFunction#

"just now", "5m ago", "3h ago", "2d ago", then a date.

createHostSyncReadsFunction#

Per-server live reads, one per id (the same id answers the same read): each reads when first subscribed, again on refresh and whenever listen reports a change for that server (or for every server), and goes back to null after its last subscriber leaves. A read that fails is null; one that started before a newer one never wins.

createMachineListsFunction#

The machine lists of every server, one per id, each read when first subscribed and again whenever one of that server's machines comes online or goes offline.

createOnlineMachinesFunction#

The names of the machines last heard online, from status pushes. It keeps listening once read, so a machine that comes back while nothing shows the list still counts.

createPresenceStoreFunction#

Creates the presence stores over a feed. The feed starts with the first reader (of the map or of any session) and stops after the last, which forgets the snapshot.

daemonStatusTextFunction#

The daemon menu's headline, detail and badge facts for a status.

hostCheckMessageFunction#

What to do about a refused test, add or rename.

hostCheckOkLineFunction#

A successful test: who answered, its version, how fast.

hostOfSettingsFocusFunction#

The host a settings focus key opens, or null when the key names something else.

hostSettingsFocusFunction#

The settings focus key that opens a host's page in Settings › Hosts.

hostStatusTextFunction#

One word for a host's status, through the machines labels.

hostStatusToneFunction#

A host's status as a chip tone: (re)connecting is not a failure.

isMachinesErrorFunction#

Whether a value is a MachinesError.

isPermittedFunction#

Whether permitted lets an action through: always without the store (undefined), never while it is not known (null).

lazyReadableFunction#

A store that starts listening on its first subscriber and stops after its last.

linkStateTextFunction#

A machine link's state, with why it is not connected; Off without a link.

machinesErrorFunction#

A MachinesError from whatever a backend threw.

shortListFunction#

Three names, then "+N".

syncBlockedReasonFunction#

Why the server can't take category now; undefined: it can (or it is not known yet).

syncOutcomeFunction#

The outcome of a server's last push; null while there is nothing to report (sync off, never pushed).

updateStateLineFunction#

One line for where a server's self-update stands, and its tone.

uptimeTextFunction#

How long a process has been up: 12 min, 3 h 5 min, 4 d.

Constants#

DEFAULT_MACHINES_LABELSConstant#

The default English strings of the machines components. Override any of them through MachinesProvider or LabelsProvider.

UPDATE_BUSY_STATESConstant#

The update states during which the updater is working (the panel follows it).

Interfaces#

DaemonControlInterface#

The desktop app's local daemon: its health, status and recovery actions.

DaemonStatusInterface#

The desktop app's local daemon, as daemon:status reports it.

HostCapabilitiesInterface#

A host's probed capabilities, as host.capabilities returns them.

HostProviderAuthInterface#

Sign-in state of one provider on a host, from auth.status. Holds no secret.

HostsStateInterface#

The hosts the app knows.

HostSummaryInterface#

One agent host as the machines components show it: This computer or a server.

HostSyncInterface#

Settings sync from this computer to a server, and the server's own record. Every action rejects with a MachinesError (sync).

HostSyncAccountInterface#

A provider this computer has an API key or a sign-in for.

HostSyncConfigInterface#

One saved server's sync from this computer.

HostSyncPatchInterface#

What a configure changes; fields left out keep their value.

HostSyncReadInterface#

One server's value, kept current while subscribed.

HostSyncStateInterface#

This computer's sync to one server: what the Sync section shows.

LazyReadableOptionsInterface#

Options of lazyReadable.

LazySinkInterface#

A store and how to set it, for lazyReadable's start.

MachineInfoInterface#

A machine as clients see it (machines.list, environments.list).

MachineInviteInterface#

A one-time machine join code (tokens.machineInvite): a new machine runs zidane machine setup --join <join>.

This computer's machine links: shared with servers (it is their machine), and servers used as machines.

MachineLinksStatusInterface#

Status of every machine link of a local host.

MachineListInterface#

One server's machines, kept current while subscribed (a machine coming online or going offline re-reads).

MachineListStateInterface#

One server's machines as last read.

MachinesDirectoryInterface#

The machines servers hold.

MachinesErrorInterface#

What went wrong, for the UI to word through its labels. detail is the backend's own message.

MachinesHostInterface#

What the machines components read and the actions they send.

MachinesPresenceInterface#

Every session's presence, and one session's.

SavedHostsInterface#

The saved-server registry, kept current while subscribed.

SavedHostsStateInterface#

The saved servers as the registry lists them, with the dates the live statuses lack.

ServerTokenInterface#

A server's client token as listed: never its secret.

ServerTokensInterface#

A server's client tokens. Every method rejects with a MachinesError.

ServerUpdatesInterface#

A server's self-update. Every method rejects with a MachinesError.

ServerUpdateStatusInterface#

Where a server's self-update stands, as server.update.* reports it.

SessionPresenceInterface#

One session's presence.

SyncOutcomeInterface#

The result of a server's last push, for its chip.

SyncPushResultInterface#

sync.push: what happened to each field of the snapshot.

SyncStatusInterface#

sync.status: the server's record, no values.

ToolInstallResultInterface#

What an install did: it worked, its output's end, and the server's capabilities after it.

Types#

DaemonHealthType#

Daemon connection health — the one model behind the status dot in both clients' footers.

Three states, because "connected: boolean" cannot express the one users actually want to see: a daemon that is being spawned or reconnected is not DOWN, and painting it red for the seconds that takes teaches people to ignore red. So:

  • connected — handshake done, signals live. green (accent)
  • connecting — spawning / reconnecting / first attempt. amber (warn)
  • disconnected — reachable daemon absent, last attempt failed. red (error)

Tones are theme SLOTS, not colors, so the dot recolors with the palette on both surfaces. Node-free; re-exported from zidane/chat/pure.

HostCheckErrorType#

A registry refusal's code: what is wrong with a server's URL, token or name, or why it did not answer.

HostCheckResultType#

A test, an add or a rename, answered as data. message is the backend's own words.

HostSignInTargetType#

What a sign-in on a server is for: a provider, or an MCP server of its catalog (in cwd's project).

MachineActionResultType#

A machine link action's outcome. needsToken: the server could not mint a machine token, paste one.

MachinesActionType#

An action permitted may withhold.

MachinesLabelsType#

The machines components' strings: the shape of DEFAULT_MACHINES_LABELS.

MachinesToneType#

The tone of a line or chip: plain, good, worth a look, failed.

PresenceFeedType#

Starts the feed: hands each snapshot to apply (every live session), and returns how to stop. Re-list on a reconnect: the last snapshot predates it.

ServerTokenScopeType#

A token's scope on a server: a client scope, or machine (it lends a computer).

SyncBlockedReasonType#

Why a server can't take a category now.

SyncCategoryType#

Settings sync, this computer → a server (one-way, opt-in): the shapes both sides share. Node-free, re-exported from zidane/chat/pure for the GUI renderer.

A server keeps one sync record (<dataDir>/sync.json): the device that syncs to it (one source per server), the categories that device sends, the fields it set ("synced from <device>") and the fields edited on the server since (overrides, which sync leaves alone until reset). The client keeps, per saved server, a mode, the categories, the API keys it opted in and the categories still to push (hosts-sync.json).

Fields are named <kind>:<name>: setting:approvalMode, safelist:/srv/app, system-md, skill:deploy, mcp:github, extension:greeter, environment:e2b, key:anthropic.

SyncModeType#

Off (default), Import once (a snapshot now), or Keep in sync (changes pushed as they happen).