Skip to content

feat: set up a managed ZCode runtime and Node.js from the settings screen - #39

Merged
supermomonga merged 16 commits into
mainfrom
feat/managed-zcode-runtime
Oct 6, 2026
Merged

supermomonga merged 16 commits into
mainfrom
feat/managed-zcode-runtime

Conversation

@supermomonga

@supermomonga supermomonga commented Oct 6, 2026 •

Copy link
Copy Markdown
Owner

Problem

ZCode does not publish its integrated CLI, so users had to build the upstream monorepo and install Node.js 24 themselves before this provider worked. Official artifacts are not enough: the Desktop packages contain the Agent (glm/zcode.cjs) but not the stdio Services Server (zcode-server.cjs), and the CDN remote-component manifests list a server bundle whose archives return 404.

Resulting behavior (ADR 15)

  • Settings → Plugins → zcode-provider → Setup lists each download (source, size, SHA-256, license) and installs on request:
    • Node.js 24.21.0 from nodejs.org (checksums from the signed SHASUMS256.txt).
    • The ZCode runtime 3.14.3 from this repository's zcode-runtime-v3.14.3 release: an unofficial, attested build of the unmodified public source with the upstream LICENSE, NOTICE.md, THIRD-PARTY-NOTICES.md and BUILD-INFO.json added.
  • Archives are size-limited, SHA-256 checked, extracted with the system tar, verified and renamed into $XDG_DATA_HOME/paseo-plugin-zcode-provider/runtimes (default ~/.local/share/...). PATH is untouched; setup RPCs accept no URLs, paths or versions from clients. A lock prevents concurrent setup; stale versions are removed.
  • After setup the screen shows a quoted zcode.mjs login command; Remove deletes the managed runtime.
  • Discovery uses the managed runtime unless both PASEO_ZCODE_RUNTIME and PASEO_ZCODE_NODE are set (one alone is an error). Without either, sessions fail with RUNTIME_SETUP_REQUIRED pointing to the Setup screen. Diagnostics show which source is in use.
  • Managed platforms: darwin-arm64, linux-x64, linux-arm64, win-x64, win-arm64.
  • The ZCode source baseline moves to the public v3.14.3 tag (29628c9); vendored RPC/V4 changes are additive. Closes Support ZCode 3.14.1 #23, closes Support ZCode 3.14.3 #25. 3.14.4 has no public source yet (Support ZCode 3.14.4 #32 stays open).

CI and release

  • zcode-runtime-release.yml builds the official distribution from the pinned source, packages it, runs test:stdio-runtime on all five platforms and, for zcode-runtime-v<version> tags, attests and publishes a non-latest release.
  • CI now installs the pinned managed runtime with the plugin's own installer and runs the runtime contract on all five platforms (plugin on Node 22); the real-model E2E also uses it.
  • check-stdio-runtime.mjs runs on Windows (isolated profile variables, system temp dir).

Verification

  • Unit tests (152), typecheck, build, format, vendored source check (97 files) and the actual Paseo 0.9.0-beta.1 compiler/adapter check pass.
  • Release workflow and CI: runtime contract passed on darwin-arm64, linux-x64, linux-arm64, win-x64 and win-arm64; real-model E2E passed on the managed runtime.
  • macOS arm64: real-download setup (12.6 s) and test:stdio-runtime with source: "managed".
  • Real UI on an isolated Paseo 0.9.0-beta.2 daemon (headless Chrome, 1280 px and 420 px): setup listing, progress, completion, login command, Diagnostics, removal; a real-model agent answered through the managed runtime; after removal, new sessions show the setup guidance. Two layout issues found there were fixed.
  • test:native-restore still fails upstream on 3.14.3 (yolo / false instead of edit / true), outside the supported contract (ADR 14).

Screenshots

Isolated Paseo 0.9.0-beta.2 daemon, headless Chrome. Paths point at the temporary data directory used for the check.

Before setup During setup
Setup screen before installation Setup progress while downloading Node.js
After setup: login command and removal Diagnostics on the managed runtime
Installed components, login command and Remove action Diagnostics showing the managed runtime and Node.js

Compact width (420 px):

Setup screen at compact width

Not verified

Real account login through the displayed command, Paseo daemons running on Windows or Linux arm64 driving setup from the UI, proxy-only networks, Desktop and mobile clients.

Resynchronize the vendored RPC and V4 contracts from the public v3.14.3
tag (29628c9). The upstream changes are additive: an optional
workflowRunDeltas capability gates the new workflowRun.* deltas, which
the provider does not request, so it keeps receiving state.updated.

Point CI, the source manifest and the documentation at the new baseline
and the 3.14.3 integrated CLI archive.
The reviewed changelog release now matches the pinned public source tag.
3.14.4 is listed in the changelog but has no public source yet, so it
remains a separate follow-up.
Record the build inputs, artifact hashes and results of the stdio
runtime contract (passing) and the unsupported settings-free restore
check (still failing upstream) on macOS arm64.
ADR 15 replaces the user-installed runtime premise of ADR 13 with a
settings-screen setup that downloads a pinned integrated CLI archive
from this repository's releases and official Node.js builds. It amends
ADR 8 to allow setup actions and supersedes ADR 10's diagnostics-only
screen.
Release tooling now reads pins from server/discovery/manifest.ts through
one helper, so the runtime packaging script can reuse it.
Use the system temporary directory on Windows, keep the system variables
Windows processes require and isolate the profile directories. POSIX
keeps /tmp so Unix socket paths stay short.
Build the integrated CLI from the pinned unmodified source, add the
upstream LICENSE, NOTICE.md, THIRD-PARTY-NOTICES.md and build
provenance, and run the stdio runtime contract on darwin-arm64,
linux-x64, linux-arm64, win-x64 and win-arm64. A zcode-runtime-v<version>
tag publishes the verified archive with a build provenance attestation.
Pin Node.js 24.21.0 archives from nodejs.org (checksums from the signed
SHASUMS256.txt) and the published zcode-runtime-v3.14.3 archive. The
installer downloads into a staging directory, enforces the pinned size
and SHA-256, extracts with the system tar, checks Node's version and the
runtime layout, and renames the result into place behind a marker. A
lock owned by a live process blocks concurrent setup; a stale lock is
reclaimed. Older versions are removed after a successful setup.
Without PASEO_ZCODE_RUNTIME and PASEO_ZCODE_NODE, discovery uses the
installed managed runtime or fails with RUNTIME_SETUP_REQUIRED pointing
to the Setup screen. Setting only one variable is a configuration
error. Diagnostics report which source is in use.
The screen lists each pinned download with its source, SHA-256, size
and license, starts setup on request, shows progress and removal, and
offers a quoted login command for the official CLI once both components
are installed. The RPCs take no URLs, paths or versions from clients.
Install the pinned runtime with the plugin's installer and run the stdio
runtime contract on darwin-arm64, linux-x64, linux-arm64, win-x64 and
win-arm64, with the plugin on Node 22 like a real daemon. The real-model
E2E job uses the managed runtime as well.
Describe the Setup screen, environment overrides, runtime releases and
their licensing, local verification with XDG_DATA_HOME and the remaining
checks.
Long explanatory values squeezed the label column. Split the overview
into short rows and show the login command as a full-width monospace
block. Found while checking the screen in a real Paseo daemon.
Paseo's client runtime returns a cleanup for every settings screen
registration. The stub now does the same and checks that both the Setup
and Diagnostics screens are registered and removed.
Record the published runtime archive, its attestation and Node.js
checksum verification, the five-platform CI results, the local install
and the real UI and model checks, plus what remains unverified.
Windows now installs under the non-roaming %LOCALAPPDATA% instead of
creating .local in the user profile; macOS and Linux keep
~/.local/share. An absolute XDG_DATA_HOME still overrides the base on
every OS for isolation, and relative values are ignored as the XDG
specification requires. ADR 15 and the README describe the locations.
@supermomonga
supermomonga marked this pull request as ready for review October 6, 2026 05:36
@supermomonga
supermomonga merged commit cd2b227 into main Oct 6, 2026
14 checks passed
@supermomonga
supermomonga deleted the feat/managed-zcode-runtime branch October 6, 2026 05:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support ZCode 3.14.3 Support ZCode 3.14.1

1 participant