-
Notifications
You must be signed in to change notification settings - Fork 0
deployment installer
The public installer install.sh builds Prime Agent from the repository source into the current directory and links the prime-agent command globally. It is the quickstart path for end users and is different from the release-pipeline tarball flow, which ships prebuilt branded artifacts. This page describes the source installer and the checks that guard it.
The installer verifies tooling before doing any work, in scripts/check-source-installer.mjs only in the sense that the shell script itself runs the checks inline. install.sh calls command_required for git, node, and npm, then runs node_is_supported which requires Node 22.8.0 or newer (major > 22, or 22 with minor > 8, or 22.8.x). It selects pnpm either from the system (pnpm_is_supported requires pnpm major 11) or falls back to an ephemeral npm exec --package pnpm@... install.
install.sh reads three environment variables for testing or pinned installs:
-
PRIME_AGENT_REPOSITORY_URL, the repository to clone (defaulthttps://github.com/Qredence/fleet-prime-agent.git). -
PRIME_AGENT_REPOSITORY_REF, the branch or tag to clone (defaultmain). -
PRIME_AGENT_PNPM_VERSION, the ephemeral pnpm version when no system pnpm 11 is present (default11.15.1).
install.sh does not always clone. prepare_checkout first calls checkout_matches_repository, which accepts the current directory when it is already a git checkout whose remote.origin.url matches the target repository (normalized to strip a trailing slash or .git, plus a small allowlist of the canonical Qredence URL forms). If it matches, the installer prints Using existing ... checkout and reuses it. Otherwise checkout_is_empty requires the directory to be empty; a non-empty, unrelated directory causes it to refuse with refusing to overwrite it. When it does clone, it runs git clone --branch <ref> --single-branch <url> ..
build_checkout performs, in order:
-
npm ci --no-audit --no-fundto install the root npm workspace (packages/*). -
pnpm install --dir web --frozen-lockfileto install theweb/pnpm workspace (via the selected system or ephemeral pnpm). -
npm run buildto buildpackages/tui,packages/ai,packages/agent,packages/coding-agentin order. -
pnpm --dir web --filter @prime-agent/web buildfollowed bynode scripts/build-web-release.mjsto produce the packaged production web runtime underpackages/coding-agent/dist/web.
link_cli then runs npm link ./packages/coding-agent, which makes the prime-agent bin from packages/coding-agent/package.json available on PATH. If the bin is not found after linking, it prints the global npm bin directory so the user can add it to PATH. The finished message tells the user to run prime-agent web from a project directory.
The source-built web runtime is what prime-agent web launches. scripts/build-web-release.mjs bundles the TanStack Start server into packages/coding-agent/dist/web/server, copies the client build to packages/coding-agent/dist/web/client, and copies the launcher to packages/coding-agent/dist/web/launcher.mjs. The web CLI command in packages/coding-agent/src/cli/web-command.ts spawns that launcher.
scripts/prime-agent-web-launcher.mjs is the launcher: it creates an HTTP server that serves the static client and proxies all other requests to the bundled web/server entry. It binds to 127.0.0.1:3000 by default and accepts --host and --port (and passes --cwd for the workspace root). It registers SIGINT and SIGTERM handlers to shut down cleanly.
The repo does not trust the installer by inspection alone. The check gate npm run check runs npm run check:installer and npm run check:browser-smoke:
-
scripts/check-source-installer.mjshas two modes.--static(thecheck:installertarget) runssh -nfor syntax and asserts the installer contains the required source-install steps (git clone,npm ci,--frozen-lockfile,npm run build,scripts/build-web-release.mjs,npm link ./packages/coding-agent) and does not contain release-only behavior (R2 URLs,install-beta.sh, globalnpm install -g).--smoke(thetest:source-installertarget) copies the working tree into a temp git mirror, runs the installer against it twice (once exercising the clone path, once the reuse path), verifies the global link and that the packaged web launcher starts and serves the root, health, and workspace-tree endpoints, and confirms the installer refuses an unrelated non-empty directory. -
scripts/check-web-release.mjs(npm run check:web:release) verifies the packaged release layout, recomputes theSHA256SUMSmanifest, installs the packed tarball globally into a temp prefix, and smoke-tests the installed CLI'swebcommand against a scratch workspace, asserting the root page,/api/health,/api/workspace/tree, and a served client asset. -
scripts/check-browser-smoke.mjs(thecheck:browser-smoketarget) bundlesscripts/browser-smoke-entry.tsfor the browser with esbuild, marking@opentelemetry/apiexternal, to prove the SDK graph builds for a browser target.
- Deployment, the shipping model
- Getting started, install and run commands
- Release pipeline, the prebuilt tarball and npm release flow
-
Build tools, the
npm run checkgate