For agentic workers: REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (
- [ ]) syntax for tracking.
Goal: Build a static-source ZCode Lite artifact that users can install from an intranet file server and run as a local Web app.
Architecture: The build script packages the existing Vite Web dist, HTTP server dist, and zcode.cjs agent bundle into a tarball plus install.sh and latest.json. Runtime uses the existing plain Web same-origin /ws path, with optional token protection when binding to non-local hosts.
Tech Stack: Node.js 24, Vite Web dist, Hono HTTP server, ZCode service RPC over WebSocket, POSIX shell install script, tar/gzip artifacts.
127.0.0.1; default port is an automatically selected free port.--host 0.0.0.0 must default to token-protected access and no automatic browser open./ws; it must not change /remote relay or replayable semantics.pnpm typecheck and pnpm lint are required before completion.Files:
packages/server/src/http.tspackages/server/src/entry-http.tspackages/server/test/serverInfoHttp.test.tsInterfaces:
HttpServerOptions.staticRoot?: string, HttpServerOptions.spaFallback?: boolean, HttpServerOptions.host?: string, HttpServerOptions.authToken?: string.Consumes: Existing createHttpServer(services, port, options) call sites remain compatible.
[ ] Add static file serving with SPA fallback after API and WebSocket routes.
[ ] Add token guard for /api/*, /ws, and /ws/remote/*.
[ ] Read HOST, ZCODE_SERVER_HOST, ZCODE_WEB_STATIC_ROOT, and ZCODE_SERVER_AUTH_TOKEN in entry-http.ts.
[ ] Add tests for /api/server-info token rejection/acceptance and static index.html fallback.
Files:
packages/web/src/main.tsxInterfaces:
initialWorkspaceAbsPath from /api/server-info.Consumes: Existing ServerRemoteInfo.workspaces response.
[ ] Fetch /api/server-info in plain Web bootstrap.
[ ] Use the first workspace path as initialWorkspaceAbsPath.
[ ] Keep bootstrap tolerant when /api/server-info is unavailable.
Files:
scripts/build-zcode-lite.mjspackage.jsonInterfaces:
pnpm build:lite.Produces: dist/zcode-lite/install.sh, dist/zcode-lite/latest.json, and dist/zcode-lite/releases/<version>/zcode-lite-<version>.tar.gz.
[ ] Build or reuse existing web/server/agent outputs.
[ ] Stage web, server, agent/zcode.cjs, runtime node_modules, and bin/zcode-lite.mjs.
[ ] Patch node-pty/prebuilds with available @lydell/node-pty-* macOS/Linux prebuilds.
[ ] Generate install.sh, latest.json, tarball, and sha256.txt.
Files:
Interfaces:
dist/zcode-lite output.Produces: remote static directory at /Users/dev/shared/zcode/deps/zcode-lite.
[ ] Run targeted tests for server HTTP behavior.
[ ] Run pnpm build:lite.
[ ] Smoke run the unpacked lite server locally.
[ ] Run pnpm typecheck.
[ ] Run pnpm lint.
[ ] Upload generated dist/zcode-lite contents to the static source over SSH/SCP without committing upload logic.
[ ] Commit source changes with Conventional Commit format.