Skip to content

Show core/server/webui versions in the standalone browser shell - #44

Merged
VeryComplexAndLongName merged 5 commits into
mainfrom
feat/standalone-version-display
Aug 18, 2026
Merged

VeryComplexAndLongName merged 5 commits into
mainfrom
feat/standalone-version-display

Conversation

@VeryComplexAndLongName

Copy link
Copy Markdown
Owner

Summary

  • README.md's own "Versioning" section already called for this: package versions, especially core, should be shown separately when the UI displays build information. Nothing did until now.
  • New token-gated GET /api/versions on the server, returning core+server versions read from each package's own package.json (createRequire, not hardcoded).
  • webui's own version is baked into the browser bundle at build time via an esbuild define (__OPENSPEC_UI_WEBUI_VERSION__) — the browser has no filesystem access to read its own package.json at runtime.
  • Standalone-only: the footer is withheld when running inside the VS Code local-server iframe (reuses the existing host-embed.ts signal) — that host already shows its own extension version via VS Code's Extensions view.
  • Stacked on Archive three shipped OpenSpec changes #42 (archived-changes housekeeping).

Test plan

  • npm run verify (typecheck/lint/english-policy/test) passes repo-wide
  • New unit tests: CORE_VERSION matches its own package.json; GET /api/versions returns real core+server versions
  • Real server start (tsx packages/server/src/cli.ts) against a temp workspace + real authenticated curl of /api/versions — returned {"core":"0.18.1","server":"1.7.1"}, matching the bumped versions exactly
  • Real esbuild client build — confirmed 1.8.1 and openspec-shell-version-footer both present in the built dist/app.js
  • openspec change validate --strict standalone-version-display passes

🤖 Generated with Claude Code

VeryComplexAndLongName and others added 5 commits August 18, 2026 08:44
README's own "Versioning" section already called for this: package
versions, especially core, should be shown separately when the UI
displays build information. Adds a token-gated GET /api/versions
endpoint (core+server, read from each package's own package.json) and
bakes webui's own version into the browser bundle at build time
(esbuild define, since the browser can't read package.json at
runtime). Standalone-only: withheld under the VS Code local-server
embed signal, since that host already shows its extension version via
VS Code's own Extensions view.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
CI's "Extension integration and package" job failed: extension
activation threw a TypeError from createRequire(import.meta.url)
inside core/src/version-info.ts. Root cause: both core and server are
bundled transitively into the VS Code extension's CJS
dist/extension.js (core via its wildcard index export, server for the
optional local-server mode) — import.meta.url resolves to undefined
in that bundle, and the eager top-level const evaluated the broken
call at import time regardless of whether the extension used it
(it never does). Same defect existed in server.ts's SERVER_VERSION,
initially masked because the first crash aborted the integration
suite before that test ran.

Fixed by making both getCoreVersion() and getServerVersion() lazy,
cached functions instead of top-level constants — the extension pulls
both modules in but calls neither, so the broken path never executes
there. Re-ran the real Extension Host suite locally: 6/6 passing,
including the previously-hidden second failure.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@VeryComplexAndLongName
VeryComplexAndLongName merged commit aa5d266 into main Aug 18, 2026
6 checks passed
@VeryComplexAndLongName
VeryComplexAndLongName deleted the feat/standalone-version-display branch August 18, 2026 14:38
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.

1 participant