@hollis-labs/surface-page
v0.28.7
Published
The core of a Surface app's page: the desktop (bar, windows, palette), the agent panel, cards, generated surfaces, ADE's overlays, and the sdk a module's views import. It draws with the app's installed Surface registry components.
Readme
@hollis-labs/surface-page
The core of a Surface app's page: the desktop (the bar, windows that tile, tab and float, the palette), the
agent panel, cards, generated surfaces and ADE's overlays, plus the sdk a module's views import. It is built
from web/src in the Surface repository, where Surface's own apps
compile it from source.
It draws nothing of its own. Every control is one of the app's installed Surface registry components
(@/components/ui/*), so the app installs those first and keeps them in step with the registry:
surface_version=0.26.0-rc.1 # use the exact installed, published package version
npx surface-ui init --ref "v$surface_version"
npx surface-ui add theme --for @hollis-labs/surface-page| Import | What |
|---|---|
| @hollis-labs/surface-page | mountPage({ modules, core?, app?, meta? }) (app and meta are the generated module list's exports), Page, Desktop, CardHost, CardsWindow, coreWeb, registerCard |
| @hollis-labs/surface-page/sdk | What a module's views may import: useEvent, useSetting, useMarks, useAnchor, Icon, CiteText, CiteRef, RecordBody, ObjectActionsMenu, registerObjectAction, useObjectActions, registerNavGroup, registerNavItem, useNavTree, and the SDK types |
| @hollis-labs/surface-page/gallery | galleryViews: the Components window, which needs every registry item installed. Also the specimen catalogue (SPECIMENS, specimenById, GALLERY_SECTIONS, GALLERY_PALETTES), InPalette, Section, Specimen, and one specimen alone: SpecimenView and mountSpecimen |
| @hollis-labs/surface-page/vite | surfacePage(): the Vite settings the package needs |
If the app mounts galleryViews, install the complete registry as well:
npx surface-ui add --all
npx surface-ui verifyA page of one specimen (specimen.html?specimen=<id>&palette=<id>&theme=light|dark&type=mixed|mono, which a
workbench frames) is a three-line entry calling mountSpecimen(root); the repository's registry/README.md,
"One specimen on its own page", has the files. It needs the complete registry too.
The package manifest used by add --for covers the page and SDK. The optional gallery deliberately exercises every registry item, so add --for alone is insufficient. On upgrades, sync refreshes existing copies; run add --all again to install newly introduced gallery items. Install any npm dependencies printed by the CLI before building. Keep the lock ref equal to the exact installed Surface package version.
The page talks to the app's server over /api and /mcp. The full setup is in the repository's
registry/README.md, under "An app in its own repository". The package's version is the Surface tag the app
is on: its registry ref and the other @hollis-labs/surface-* packages move with it.
The surfacePage() Vite plugin emits surface-build.json with the package version and the SHA-256 of the installed theme consumed by the build. It defaults to @/components/surface.css; use surfacePage({ theme: "relative/path.css" }) for another location. Missing or unconsumed themes fail the build. The running app exposes the embedded evidence at /api/version, separately from its Go dependency version.
