@niscorp/moss 0.2.4 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/vite.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/document.ts","../src/node.ts","../src/vite.ts"],"names":["headOf","placeHead","WebSocketServer","getRequestListener","path","readFile","resolve"],"mappings":";;;;;;;;;;AAqCO,IAAM,mBAAA,GAAsB,eAAA;AAEnC,IAAM,iBAAA,GAAoB,YAAA;AAC1B,IAAM,YAAA,GAAe,uBAAA;AAId,IAAM,eAAA,GAAkB,CAAC,MAAA,EAAmC,QAAA,GAAW,iBAAA,KAAqC;AACjH,EAAA,IAAI,MAAA,KAAW,MAAA,IAAa,MAAA,KAAW,IAAA,EAAM,OAAO,IAAA;AACpD,EAAA,MAAM,MAAA,GAAS,mBAAmB,QAAQ,CAAA;AAC1C,EAAA,KAAA,MAAW,IAAA,IAAQ,MAAA,CAAO,KAAA,CAAM,GAAG,CAAA,EAAG;AACpC,IAAA,MAAM,EAAA,GAAK,IAAA,CAAK,OAAA,CAAQ,GAAG,CAAA;AAC3B,IAAA,IAAI,EAAA,GAAK,KAAK,IAAA,CAAK,KAAA,CAAM,GAAG,EAAE,CAAA,CAAE,IAAA,EAAK,KAAM,MAAA,EAAQ;AACnD,IAAA,IAAI;AACF,MAAA,MAAM,KAAA,GAAQ,mBAAmB,IAAA,CAAK,KAAA,CAAM,KAAK,CAAC,CAAA,CAAE,MAAM,CAAA;AAC1D,MAAA,OAAO,KAAA,KAAU,KAAK,IAAA,GAAO,KAAA;AAAA,IAC/B,CAAA,CAAA,MAAQ;AACN,MAAA,OAAO,IAAA;AAAA,IACT;AAAA,EACF;AACA,EAAA,OAAO,IAAA;AACT,CAAA;AAMO,IAAM,aAAA,GAAgB,CAAC,QAAA,EAAyB,SAAA,EAA0B,IAAA,KAA0B;AACzG,EAAA,MAAM,EAAE,KAAA,EAAO,KAAA,EAAO,IAAA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gB,0BAA0B,CAAA;AACxD,QAAA,KAAA,MAAW,CAAC,IAAA,EAAM,KAAK,CAAA,IAAK,MAAA,CAAO,OAAA,CAAQ,IAAA,CAAK,OAAO,CAAA,EAAG,GAAA,CAAI,SAAA,CAAU,IAAA,EAAM,KAAK,CAAA;AACnF,QAAA,GAAA,CAAI,GAAA,CAAI,KAAK,IAAI,CAAA;AAAA,MACnB,CAAC,CAAA,CAEA,KAAA,CAAM,MAAM,MAAM,CAAA;AAAA,IACvB,CAAC,CAAA;AAAA,EACH;AACF,CAAA","file":"vite.cjs","sourcesContent":["import { headOf, placeHead } from '@niscorp/nova/document';\nimport type { ScreenHead } from '@niscorp/nova/document';\nimport type { ShellSnapshot } from './shells';\nimport type { MossServer } from './server';\n\n// ═══════════════════════════════════════════════════════════════\n// The document — what a page request is answered with when the server draws\n// the first screen itself.\n//\n// A page request names a path and carries, at most, a cookie. From those two:\n// WHICH shell (a page's, if the path leads to one; otherwise the app's), for\n// WHOM (the cookie's principal, or nobody), read as it stands\n// (`shells.snapshot`), drawn to a string by a terminal the app hands in\n// (./terminal/react/server and its siblings), and written into the app's own\n// index.html beside the snapshot it was drawn from. The browser's terminal\n// starts from that snapshot (../client's `readDocumentSnapshot`) and adopts the\n// elements already there.\n//\n// Moss holds no opinion about the page around the screen: the template is the\n// app's file, the kit is the app's, and so is the route this is called from.\n//\n// What the screen says about itself — a head node in a layout (nova's\n// `nova:head`) — is in the snapshot's trees like everything else on it, and is\n// written into the template's <head> as the screen is written into its root.\n//\n// TWO RULES LIVE HERE, each in one place:\n//\n// WHO MAY KEEP A PAGE follows from who asked, and from nothing else\n// (`documentHeaders`). A page drawn for nobody is the same for everybody; a\n// page drawn for somebody is theirs. No page declares which it is.\n//\n// NOTHING HERE CAN FAIL A PAGE. Whatever goes wrong — a kit component that\n// throws, a shell that will not build — the answer is the template as it is,\n// and the terminal paints it the way it did before any of this existed.\n// ═══════════════════════════════════════════════════════════════\n\n// The element id the terminal looks for — the same constant ../client reads by.\nexport const SNAPSHOT_ELEMENT_ID = 'nisc-snapshot';\n\nconst DEFAULT_TOKEN_KEY = 'nisc.token';\nconst DEFAULT_ROOT = '<div id=\"root\"></div>';\n\n// The session token, out of a `Cookie` header. The name is the wire's token key\n// (`browserEnv({ tokenKey, cookie: true })` writes the copy this reads).\nexport const tokenFromCookie = (header: string | null | undefined, tokenKey = DEFAULT_TOKEN_KEY): string | null => {\n if (header === undefined || header === null) return null;\n const wanted = encodeURIComponent(tokenKey);\n for (const part of header.split(';')) {\n const at = part.indexOf('=');\n if (at < 0 || part.slice(0, at).trim() !== wanted) continue;\n try {\n const value = decodeURIComponent(part.slice(at + 1).trim());\n return value === '' ? null : value;\n } catch {\n return null;\n }\n }\n return null;\n};\n\n// The snapshot, as an element to put in the page. A tree carries what people\n// typed (a name, a note), and it sits inside a <script>: every `<` is written\n// as its escape, so nothing in a tree can close the element or open another.\n// U+2028/2029 go the same way — legal in JSON, line breaks to an HTML parser.\nexport const embedSnapshot = (snapshot: ShellSnapshot, principal: string | null, path?: string): string => {\n const { frame, trees, seed, live } = snapshot;\n const text = JSON.stringify({ frame, trees, principal: principal !== null, live, ...(seed !== undefined ? { seed } : {}), ...(path !== undefined ? { path } : {}) })\n .replace(/</g, '\\\\u003c')\n .replace(/\\u2028/g, '\\\\u2028')\n .replace(/\\u2029/g, '\\\\u2029');\n return `<script type=\"application/json\" id=\"${SNAPSHOT_ELEMENT_ID}\">${text}</script>`;\n};\n\n// A page drawn for somebody is theirs alone: nothing between here and their\n// browser may keep it. A page drawn for nobody is the same for everybody and\n// may be kept — but it must never be handed to a request that carried a\n// credential, so the two are told apart on the cookie.\nexport const documentHeaders = (principal: string | null): Record<string, string> =>\n principal === null ? { 'cache-control': 'no-cache', vary: 'Cookie' } : { 'cache-control': 'private, no-store', vary: 'Cookie' };\n\nconst escapeAttribute = (value: string): string => value.replace(/&/g, '&amp;').replace(/\"/g, '&quot;').replace(/</g, '&lt;');\n\nexport type DocumentConfig = {\n server: MossServer;\n // The app's index.html, as it would be served undrawn. It must hold the empty\n // root (`root`, default `<div id=\"root\"></div>`) exactly once — that is where\n // the screen goes.\n template: string;\n // What the request named and carried.\n request: { path: string; cookie?: string | null };\n // A terminal that draws to a string: the app's kit, bound to one of moss's\n // server targets (`renderSnapshot` from ./terminal/react/server, /vue/server,\n // /dom/server).\n draw: (snapshot: ShellSnapshot) => string | Promise<string>;\n // Attributes for the page's <html>, read off the screen — what a kit would\n // otherwise set from an effect that never runs here (a palette, a scheme).\n // Names are the app's and are written as given; values are escaped.\n htmlAttributes?: (snapshot: ShellSnapshot) => Record<string, string>;\n // The address the site is served at (\"https://example.com\"). With it, every\n // path's document says its own canonical address, and a head's picture is\n // given a whole one. Without it, where a document lives is left as the\n // template says.\n site?: string;\n // The wire's token key (and so the cookie's name). Default `nisc.token`.\n tokenKey?: string;\n // How long the screen may take to settle before it is drawn as it stands.\n waitMs?: number;\n root?: string;\n};\n\nexport type DrawnDocument = {\n html: string;\n headers: Record<string, string>;\n // whether the screen is in the page (false: the template went out as it is)\n drawn: boolean;\n // who it was drawn for\n principal: string | null;\n // the page the path led to, when it led to one\n page?: string;\n // the head the screen had, and the action it stood in — absent when the\n // document's head is the template's own\n head?: ScreenHead;\n // the snapshot's own account of itself (see ShellSnapshot) — present when drawn\n live?: boolean;\n why?: string[];\n drawnWith?: string[];\n settled?: boolean;\n};\n\nexport const renderDocument = async (config: DocumentConfig): Promise<DrawnDocument> => {\n const { server, template, request, draw } = config;\n const tokenKey = config.tokenKey ?? DEFAULT_TOKEN_KEY;\n const root = config.root ?? DEFAULT_ROOT;\n const undrawn: DrawnDocument = { html: template, headers: documentHeaders(null), drawn: false, principal: null };\n if (!template.includes(root)) return undrawn;\n\n try {\n const token = tokenFromCookie(request.cookie, tokenKey);\n // A token that no longer resolves is nobody: the page is drawn for nobody,\n // and the dead copy is taken back so the next request does not carry it. A\n // verifier that THROWS is a fault, not a sign-out — the page goes out\n // undrawn and the socket, which asks again, is where it is settled.\n const principal = token === null ? null : await server.principalOf(token);\n const route = server.page(request.path);\n const host = route?.host ?? server.shells;\n if (host === undefined) return undrawn;\n\n const snapshot = await host.snapshot(principal === null ? null : token, principal, {\n ...(config.waitMs !== undefined ? { waitMs: config.waitMs } : {}),\n ...(route !== undefined ? { inputs: route.inputs } : {}),\n });\n const screen = await draw(snapshot);\n const attributes = Object.entries(config.htmlAttributes?.(snapshot) ?? {})\n .map(([name, value]) => ` ${name}=\"${escapeAttribute(value)}\"`)\n .join('');\n const placed = template\n // functions, both, so nothing in the screen is read as a replacement pattern\n .replace(root, () => `${root.replace('></div>', () => `>${screen}</div>`)}${embedSnapshot(snapshot, principal, request.path)}`)\n .replace(/<html([^>]*)>/, (whole, existing: string) => (attributes === '' ? whole : `<html${existing}${attributes}>`));\n const head = headOf({ frame: () => snapshot.frame, canvasTree: (id) => snapshot.trees[id] ?? [] });\n const html = placeHead(placed, head?.head, { ...(config.site !== undefined ? { site: config.site } : {}), path: request.path });\n\n return {\n html,\n ...(head !== undefined ? { head } : {}),\n headers: {\n ...documentHeaders(principal),\n ...(token !== null && principal === null ? { 'set-cookie': `${encodeURIComponent(tokenKey)}=; Path=/; Max-Age=0; SameSite=Lax` } : {}),\n },\n drawn: true,\n principal,\n ...(route !== undefined ? { page: route.name } : {}),\n live: snapshot.live,\n why: snapshot.why,\n drawnWith: snapshot.drawnWith,\n settled: snapshot.settled,\n };\n } catch (error) {\n console.error(`[moss/document] \"${request.path}\" could not be drawn — serving it undrawn:`, error);\n return undrawn;\n }\n};\n\n// ── pages, as files ──\n//\n// The same draw, for NOBODY, once per path: what a static host serves. There is\n// no credential to pass and no way to pass one — a file is the page as nobody\n// in particular sees it, which is the only page that may be kept.\n//\n// A page that is LIVE is still written, and said so: its file is a true first\n// screen, and its terminal will look for a socket. Whether that is acceptable\n// (a server stands beside the files) or a mistake (there is no server) is the\n// build's to decide, from the report — nothing here guesses.\n\nexport type ExportedDocument = {\n path: string;\n html: string;\n page?: string;\n head?: ScreenHead;\n drawn: boolean;\n live: boolean;\n why: string[];\n // reads whose answers are in the file as they were when it was written\n drawnWith: string[];\n settled: boolean;\n};\n\nexport const exportDocuments = async (config: Omit<DocumentConfig, 'request'> & { paths: readonly string[] }): Promise<ExportedDocument[]> => {\n const { paths, ...rest } = config;\n const out: ExportedDocument[] = [];\n for (const path of paths) {\n const page = await renderDocument({ ...rest, request: { path, cookie: null } });\n out.push({\n path,\n html: page.html,\n ...(page.page !== undefined ? { page: page.page } : {}),\n ...(page.head !== undefined ? { head: page.head } : {}),\n drawn: page.drawn,\n // undrawn is not concluded finished\n live: page.live ?? true,\n why: page.why ?? (page.drawn ? [] : ['the page could not be drawn']),\n drawnWith: page.drawnWith ?? [],\n settled: page.settled ?? false,\n });\n }\n return out;\n};\n","import { readFile } from 'node:fs/promises';\nimport { extname, join, relative } from 'node:path';\nimport { serve as listen } from '@hono/node-server';\nimport { serveStatic } from '@hono/node-server/serve-static';\nimport { WebSocketServer } from 'ws';\nimport type { IncomingMessage } from 'node:http';\nimport type { Duplex } from 'node:stream';\nimport { createServer } from './server';\nimport type { MossServer } from './server';\nimport type { NiscApp } from './app';\nimport type { NiscRuntime } from './runtime';\nimport type { SocketAccept } from './socket';\nimport { renderDocument } from './document';\nimport type { DocumentConfig } from './document';\n\n// ═══════════════════════════════════════════════════════════════\n// The Node entry — runtime-specific by design: the transport is a seam, so\n// the Bun flip swaps this file, never the app. Two exports: the\n// websocket transport for hosts that run their own listener (the dev\n// checks, vite), and the batteries-included `serve`.\n// ═══════════════════════════════════════════════════════════════\n\n// Anything that emits Node upgrade events — http.Server structurally, so\n// the @hono/node-server return type needs no narrowing.\ntype Upgradeable = {\n on: (event: 'upgrade', handler: (req: IncomingMessage, socket: Duplex, head: Buffer) => void) => unknown;\n};\n\n// The `ws` half of the transport seam: RFC 6455 stays library-handled\n// (permessage-deflate on by default — see `runtime.socketCompression`); the\n// protocol above the seam is nisc's own (../socket.ts) and identical on every\n// runtime.\nexport const attachSocket = (\n httpServer: Upgradeable,\n accept: SocketAccept,\n path = '/socket',\n options?: { compression?: boolean | Record<string, unknown> },\n): void => {\n const wss = new WebSocketServer({ noServer: true, perMessageDeflate: options?.compression ?? true });\n httpServer.on('upgrade', (req, socket, head) => {\n const url = req.url ?? '/';\n // Not ours: leave it for whichever other listener owns it (vite's HMR\n // upgrade rides the same server in dev).\n if (new URL(url, 'http://nisc.local').pathname !== path) return;\n wss.handleUpgrade(req, socket, head, (ws) => {\n // accept promises to handle its own failures (see socket.ts). This is\n // the floor under that promise: an await added there without a guard\n // degrades to one logged close here instead of an unhandled rejection\n // taking every session on the box down with it.\n accept(url, {\n send: (text) => ws.send(text),\n close: (code, reason) => ws.close(code, reason),\n onMessage: (fn) => ws.on('message', (data) => fn(String(data))),\n onClose: (fn) => ws.on('close', () => fn()),\n }).catch((error: unknown) => {\n console.error('[moss/node] a connection escaped accept:', error);\n try {\n ws.close(1011, 'accept failed');\n } catch {\n // already gone\n }\n });\n });\n });\n};\n\n// THE BUILT TERMINAL, served by the same process as the app — one origin, so the\n// socket is `/socket` wherever the page came from.\n//\n// `dist` is what the app's bundler wrote: index.html and its assets. Every GET\n// that nothing registered earlier answers is a file from it, or a PAGE:\n// index.html with the caller's screen drawn into it (./document) — the app's own\n// for `/`, one of the manifest's pages for a path that leads to one. index.html\n// itself is never served as a file: it is the template, and goes out drawn.\n//\n// A name with an extension that is neither a file in `dist` nor a page of the\n// manifest is a MISSING FILE, and is answered 404 — not with a screen. A browser\n// holding a page from before a deploy asks for that page's script by its old\n// name; what it needs back is \"gone\", not a document that is not a script.\n//\n// Register the app's own routes FIRST; this is the catch-all. `owned` names the\n// prefixes that are never a page (default: moss's own surfaces) — an unknown\n// path under one is a 404, not a screen.\nexport type SiteConfig = Pick<DocumentConfig, 'draw' | 'htmlAttributes' | 'site' | 'tokenKey' | 'waitMs'> & {\n dist: string;\n owned?: RegExp;\n};\n\n// The paths the app server answers itself; everything else is the site's.\nexport const MOSS_PATHS = /^\\/(api|catalog|socket|operator|integrations)(\\/|$)/;\n\nexport const mountSite = (server: MossServer, config: SiteConfig): void => {\n const { dist, owned = MOSS_PATHS, ...drawing } = config;\n // serveStatic resolves `root` against the working directory.\n const root = relative(process.cwd(), dist) || '.';\n const files = serveStatic({ root });\n server.use('/*', async (c, next) => {\n const path = c.req.path;\n if (owned.test(path) || path === '/' || path === '/index.html' || server.page(path) !== undefined) return next();\n return files(c, next);\n });\n server.get('*', async (c) => {\n if (owned.test(c.req.path)) return c.notFound();\n // the static server above found no such file, and no page is at this path\n if (extname(c.req.path) !== '' && c.req.path !== '/index.html' && server.page(c.req.path) === undefined) return c.notFound();\n const template = await readFile(join(dist, 'index.html'), 'utf8');\n const page = await renderDocument({\n ...drawing,\n server,\n template,\n request: { path: c.req.path === '/index.html' ? '/' : c.req.path, cookie: c.req.header('cookie') ?? null },\n });\n return c.html(page.html, 200, page.headers);\n });\n};\n\nexport const serve = async (app: NiscApp, runtime: NiscRuntime & { port?: number }): Promise<MossServer> => {\n const server = await createServer(app, runtime);\n const port = runtime.port ?? 8787;\n const httpServer = listen({ fetch: server.fetch, port });\n attachSocket(httpServer, server.socket, '/socket', { ...(runtime.socketCompression !== undefined ? { compression: runtime.socketCompression } : {}) });\n console.log(`moss serving http://localhost:${port}`);\n console.log(`surfaces: GET /catalog · GET|POST /api/vex · GET|POST /api/<resource>/vex · ws://localhost:${port}/socket`);\n return server;\n};\n","import { readFile } from 'node:fs/promises';\nimport { resolve } from 'node:path';\nimport type { Plugin, ViteDevServer } from 'vite';\nimport { getRequestListener } from '@hono/node-server';\nimport { renderDocument } from './document';\nimport type { DocumentConfig } from './document';\nimport { attachSocket, MOSS_PATHS } from './node';\nimport type { MossServer } from './server';\n\n// ═══════════════════════════════════════════════════════════════\n// @niscorp/moss/vite — the app server inside vite's dev process.\n//\n// One `nisc dev`, no proxy, no second terminal: the app boots in vite's own\n// process, through vite's own module loading (`ssrLoadModule`), so the boot it\n// runs is the source on disk and an edit is a fresh boot. What it does, in the\n// order a request meets it:\n//\n// the socket attached ONCE, delegating to whichever server is current —\n// a re-boot swaps what it delegates to, never the handler\n// /dev/as/:who a signed-in URL, when the app can mint a dev token\n// a page `/`, or a path one of the manifest's pages answers: index.html\n// through vite first (its client, the framework's refresh\n// preamble), then the screen drawn into it (`renderDocument`)\n// moss's paths /api, /catalog, /operator, /integrations — the app server's\n// the rest vite's: source files, assets, its own urls\n//\n// A change under one of the watched directories re-boots the whole app — a\n// fresh database, fresh seed, fresh shells — then reloads the page so the\n// browser reconnects to the new server. The outgoing server keeps answering\n// until the new one is up, so a broken edit does not take the dev server down,\n// and is then let go, timers included.\n// ═══════════════════════════════════════════════════════════════\n\nexport type DevApp = {\n server: MossServer;\n // how to let it go (default: `server.close()`)\n close?: () => void | Promise<void>;\n // How one of its screens is drawn. Absent: pages go out as vite's index.html,\n // undrawn, and the terminal paints them as it always did.\n draw?: DocumentConfig['draw'];\n htmlAttributes?: DocumentConfig['htmlAttributes'];\n site?: DocumentConfig['site'];\n tokenKey?: string;\n // A dev-only signed-in URL: `/dev/as/<who>` stores the token this returns —\n // where the wire keeps it and in the cookie copy a page is drawn by — and\n // goes to `/`. `null` is nobody of that name. It lives in vite's middleware\n // and nowhere else, so it cannot ship.\n signIn?: (who: string) => string | null | Promise<string | null>;\n};\n\nexport type MossDevOptions = {\n // Stand the app up. `load` is vite's own module loader: what it loads is the\n // source as it is on disk now, with the app's aliases resolved.\n app: (load: (id: string) => Promise<Record<string, unknown>>) => Promise<DevApp>;\n // Which edits re-boot the app (default: anything under src/app, src/server,\n // src/db or src/ui — the kit is in it because the SERVER holds the component\n // registry too — and the nisc config).\n watch?: RegExp;\n // The page template, relative to vite's root (default `index.html`).\n index?: string;\n // The paths the app server answers (default: moss's own).\n owned?: RegExp;\n // The name in vite's log (default `moss`).\n label?: string;\n};\n\nconst DEFAULT_WATCH = /([\\\\/]src[\\\\/](app|server|db|ui)[\\\\/])|([\\\\/]nisc\\.config\\.[cm]?[jt]s$)/;\nconst REBOOT_DEBOUNCE_MS = 200;\n\ntype Booted = { app: DevApp; listener: ReturnType<typeof getRequestListener> };\n\nconst retire = async (booted: Booted): Promise<void> => {\n booted.app.server.socket.stop();\n await (booted.app.close ?? ((): void => booted.app.server.close()))();\n};\n\nconst said = (error: unknown): string => (error instanceof Error ? error.message : String(error));\n\nexport const mossDev = (options: MossDevOptions): Plugin => ({\n name: 'moss-dev',\n apply: 'serve',\n configureServer: (vite: ViteDevServer) => {\n const label = options.label ?? 'moss';\n const watch = options.watch ?? DEFAULT_WATCH;\n const owned = options.owned ?? MOSS_PATHS;\n const load = (id: string): Promise<Record<string, unknown>> => vite.ssrLoadModule(id);\n\n const boot = async (): Promise<Booted> => {\n const app = await options.app(load);\n return { app, listener: getRequestListener(app.server.fetch) };\n };\n let current = boot();\n current.catch((error: unknown) => vite.config.logger.error(`[${label}] the app did not boot: ${said(error)}`, { timestamp: true }));\n\n if (vite.httpServer !== null) {\n attachSocket(\n vite.httpServer,\n Object.assign(async (url: string, connection: Parameters<MossServer['socket']>[1]) => (await current).app.server.socket(url, connection), {\n // whichever server is current owns the revalidation timer; this handler owns none\n stop: (): void => void current.then(({ app }) => app.server.socket.stop(), () => undefined),\n }),\n );\n }\n\n let timer: ReturnType<typeof setTimeout> | undefined;\n const reboot = (file: string): void => {\n if (!watch.test(file)) return;\n clearTimeout(timer);\n timer = setTimeout(() => {\n const outgoing = current;\n current = boot();\n current.then(\n () => {\n void outgoing.then(retire, () => undefined);\n vite.config.logger.info(`[${label}] app server re-booted`, { timestamp: true });\n vite.ws.send({ type: 'full-reload' });\n },\n (error: unknown) => {\n // the old server goes on answering until an edit boots\n current = outgoing;\n vite.config.logger.error(`[${label}] re-boot failed: ${said(error)}`, { timestamp: true });\n },\n );\n }, REBOOT_DEBOUNCE_MS);\n };\n vite.watcher.on('change', reboot);\n vite.watcher.on('add', reboot);\n vite.watcher.on('unlink', reboot);\n vite.httpServer?.once('close', () => void current.then(retire, () => undefined));\n\n vite.middlewares.use((req, res, next) => {\n const url = req.url ?? '/';\n const path = url.split('?')[0] ?? '/';\n\n const who = /^\\/dev\\/as\\/([\\w.@%-]+)$/.exec(path)?.[1];\n if (who !== undefined) {\n void current\n .then(async ({ app }) => {\n if (app.signIn === undefined) {\n next();\n return;\n }\n const token = await app.signIn(decodeURIComponent(who));\n const key = JSON.stringify(app.tokenKey ?? 'nisc.token');\n res.setHeader('content-type', 'text/html; charset=utf-8');\n res.end(\n token === null\n ? `<p>nobody called ${who.replace(/[<&\"]/g, '')}</p>`\n : `<script>localStorage.setItem(${key},${JSON.stringify(token)});document.cookie=encodeURIComponent(${key})+'='+encodeURIComponent(${JSON.stringify(token)})+'; Path=/; SameSite=Lax';location.replace('/')</script>`,\n );\n })\n .catch(() => {\n res.statusCode = 500;\n res.end('the dev sign-in failed');\n });\n return;\n }\n\n if (owned.test(path)) {\n void current.then(({ listener }) => listener(req, res)).catch(() => {\n res.statusCode = 503;\n res.end('the app server did not boot — see the dev server’s log');\n });\n return;\n }\n\n if (req.method !== 'GET') {\n next();\n return;\n }\n void current\n .then(async ({ app }) => {\n if (app.draw === undefined || (path !== '/' && path !== '/index.html' && app.server.page(path) === undefined)) {\n next();\n return;\n }\n const template = await vite.transformIndexHtml(url, await readFile(resolve(vite.config.root, options.index ?? 'index.html'), 'utf8'));\n const page = await renderDocument({\n server: app.server,\n template,\n request: { path: path === '/index.html' ? '/' : path, cookie: req.headers.cookie ?? null },\n draw: app.draw,\n ...(app.htmlAttributes !== undefined ? { htmlAttributes: app.htmlAttributes } : {}),\n ...(app.site !== undefined ? { site: app.site } : {}),\n ...(app.tokenKey !== undefined ? { tokenKey: app.tokenKey } : {}),\n });\n res.statusCode = 200;\n res.setHeader('content-type', 'text/html; charset=utf-8');\n for (const [name, value] of Object.entries(page.headers)) res.setHeader(name, value);\n res.end(page.html);\n })\n // not drawn is not broken: vite serves index.html as it always did\n .catch(() => next());\n });\n },\n});\n"]}
1
+ {"version":3,"sources":["../src/document.ts","../src/node.ts","../src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A0B,CAAA;AACxD,QAAA,KAAA,MAAW,CAAC,IAAA,EAAM,KAAK,CAAA,IAAK,MAAA,CAAO,OAAA,CAAQ,IAAA,CAAK,OAAO,CAAA,EAAG,GAAA,CAAI,SAAA,CAAU,IAAA,EAAM,KAAK,CAAA;AACnF,QAAA,GAAA,CAAI,GAAA,CAAI,KAAK,IAAI,CAAA;AAAA,MACnB,CAAC,CAAA,CAEA,KAAA,CAAM,MAAM,MAAM,CAAA;AAAA,IACvB,CAAC,CAAA;AAAA,EACH;AACF,CAAA","file":"vite.cjs","sourcesContent":["import { headOf, placeHead } from '@niscorp/nova/document';\nimport type { ScreenHead } from '@niscorp/nova/document';\nimport type { ShellSnapshot } from './shells';\nimport type { MossServer } from './server';\n\n// ═══════════════════════════════════════════════════════════════\n// The document — what a page request is answered with when the server draws\n// the first screen itself.\n//\n// A page request names a path and carries, at most, a cookie. From those two:\n// WHICH shell (a page's, if the path leads to one; otherwise the app's), for\n// WHOM (the cookie's principal, or nobody), read as it stands\n// (`shells.snapshot`), drawn to a string by a terminal the app hands in\n// (./terminal/react/server and its siblings), and written into the app's own\n// index.html beside the snapshot it was drawn from. The browser's terminal\n// starts from that snapshot (../client's `readDocumentSnapshot`) and adopts the\n// elements already there.\n//\n// Moss holds no opinion about the page around the screen: the template is the\n// app's file, the kit is the app's, and so is the route this is called from.\n//\n// The page's <head> is a node in a layout too (nova's `nova:head`, holding the\n// elements a head holds), so it is in the snapshot's trees like everything\n// else on the screen, and is written into the template's <head> as the screen\n// is written into its root.\n//\n// TWO RULES LIVE HERE, each in one place:\n//\n// WHO MAY KEEP A PAGE follows from who asked, and from nothing else\n// (`documentHeaders`). A page drawn for nobody is the same for everybody; a\n// page drawn for somebody is theirs. No page declares which it is.\n//\n// NOTHING HERE CAN FAIL A PAGE. Whatever goes wrong — a kit component that\n// throws, a shell that will not build — the answer is the template as it is,\n// and the terminal paints it the way it did before any of this existed.\n// ═══════════════════════════════════════════════════════════════\n\n// The element id the terminal looks for — the same constant ../client reads by.\nexport const SNAPSHOT_ELEMENT_ID = 'nisc-snapshot';\n\nconst DEFAULT_TOKEN_KEY = 'nisc.token';\nconst DEFAULT_ROOT = '<div id=\"root\"></div>';\n\n// The session token, out of a `Cookie` header. The name is the wire's token key\n// (`browserEnv({ tokenKey, cookie: true })` writes the copy this reads).\nexport const tokenFromCookie = (header: string | null | undefined, tokenKey = DEFAULT_TOKEN_KEY): string | null => {\n if (header === undefined || header === null) return null;\n const wanted = encodeURIComponent(tokenKey);\n for (const part of header.split(';')) {\n const at = part.indexOf('=');\n if (at < 0 || part.slice(0, at).trim() !== wanted) continue;\n try {\n const value = decodeURIComponent(part.slice(at + 1).trim());\n return value === '' ? null : value;\n } catch {\n return null;\n }\n }\n return null;\n};\n\n// The snapshot, as an element to put in the page. A tree carries what people\n// typed (a name, a note), and it sits inside a <script>: every `<` is written\n// as its escape, so nothing in a tree can close the element or open another.\n// U+2028/2029 go the same way — legal in JSON, line breaks to an HTML parser.\nexport const embedSnapshot = (snapshot: ShellSnapshot, principal: string | null, path?: string): string => {\n const { frame, trees, seed, live } = snapshot;\n const text = JSON.stringify({ frame, trees, principal: principal !== null, live, ...(seed !== undefined ? { seed } : {}), ...(path !== undefined ? { path } : {}) })\n .replace(/</g, '\\\\u003c')\n .replace(/\\u2028/g, '\\\\u2028')\n .replace(/\\u2029/g, '\\\\u2029');\n return `<script type=\"application/json\" id=\"${SNAPSHOT_ELEMENT_ID}\">${text}</script>`;\n};\n\n// A page drawn for somebody is theirs alone: nothing between here and their\n// browser may keep it. A page drawn for nobody is the same for everybody and\n// may be kept — but it must never be handed to a request that carried a\n// credential, so the two are told apart on the cookie.\nexport const documentHeaders = (principal: string | null): Record<string, string> =>\n principal === null ? { 'cache-control': 'no-cache', vary: 'Cookie' } : { 'cache-control': 'private, no-store', vary: 'Cookie' };\n\nconst escapeAttribute = (value: string): string => value.replace(/&/g, '&amp;').replace(/\"/g, '&quot;').replace(/</g, '&lt;');\n\nexport type DocumentConfig = {\n server: MossServer;\n // The app's index.html, as it would be served undrawn. It must hold the empty\n // root (`root`, default `<div id=\"root\"></div>`) exactly once — that is where\n // the screen goes.\n template: string;\n // What the request named and carried.\n request: { path: string; cookie?: string | null };\n // A terminal that draws to a string: the app's kit, bound to one of moss's\n // server targets (`renderSnapshot` from ./terminal/react/server, /vue/server,\n // /dom/server).\n draw: (snapshot: ShellSnapshot) => string | Promise<string>;\n // Attributes for the page's <html>, read off the screen — what a kit would\n // otherwise set from an effect that never runs here (a palette, a scheme).\n // Names are the app's and are written as given; values are escaped.\n htmlAttributes?: (snapshot: ShellSnapshot) => Record<string, string>;\n // The address the site is served at (\"https://example.com\"). With it, every\n // path's document says its own canonical address. Without it, where a\n // document lives is left as the template says.\n site?: string;\n // The wire's token key (and so the cookie's name). Default `nisc.token`.\n tokenKey?: string;\n // How long the screen may take to settle before it is drawn as it stands.\n waitMs?: number;\n root?: string;\n};\n\nexport type DrawnDocument = {\n html: string;\n headers: Record<string, string>;\n // whether the screen is in the page (false: the template went out as it is)\n drawn: boolean;\n // who it was drawn for\n principal: string | null;\n // the page the path led to, when it led to one\n page?: string;\n // what the screen's head held, and the actions that said it — absent when\n // the screen has no head and the document's is the template's own\n head?: ScreenHead;\n // the snapshot's own account of itself (see ShellSnapshot) — present when drawn\n live?: boolean;\n why?: string[];\n drawnWith?: string[];\n settled?: boolean;\n};\n\nexport const renderDocument = async (config: DocumentConfig): Promise<DrawnDocument> => {\n const { server, template, request, draw } = config;\n const tokenKey = config.tokenKey ?? DEFAULT_TOKEN_KEY;\n const root = config.root ?? DEFAULT_ROOT;\n const undrawn: DrawnDocument = { html: template, headers: documentHeaders(null), drawn: false, principal: null };\n if (!template.includes(root)) return undrawn;\n\n try {\n const token = tokenFromCookie(request.cookie, tokenKey);\n // A token that no longer resolves is nobody: the page is drawn for nobody,\n // and the dead copy is taken back so the next request does not carry it. A\n // verifier that THROWS is a fault, not a sign-out — the page goes out\n // undrawn and the socket, which asks again, is where it is settled.\n const principal = token === null ? null : await server.principalOf(token);\n const route = server.page(request.path);\n const host = route?.host ?? server.shells;\n if (host === undefined) return undrawn;\n\n const snapshot = await host.snapshot(principal === null ? null : token, principal, {\n ...(config.waitMs !== undefined ? { waitMs: config.waitMs } : {}),\n ...(route !== undefined ? { inputs: route.inputs } : {}),\n });\n const screen = await draw(snapshot);\n const attributes = Object.entries(config.htmlAttributes?.(snapshot) ?? {})\n .map(([name, value]) => ` ${name}=\"${escapeAttribute(value)}\"`)\n .join('');\n const placed = template\n // functions, both, so nothing in the screen is read as a replacement pattern\n .replace(root, () => `${root.replace('></div>', () => `>${screen}</div>`)}${embedSnapshot(snapshot, principal, request.path)}`)\n .replace(/<html([^>]*)>/, (whole, existing: string) => (attributes === '' ? whole : `<html${existing}${attributes}>`));\n const head = headOf({ frame: () => snapshot.frame, canvasTree: (id) => snapshot.trees[id] ?? [] });\n // what a head may not hold was left out: say so, where somebody can see it\n for (const why of head?.refused ?? []) console.error(`[moss/document] \"${request.path}\" — ${why}`);\n const html = placeHead(placed, head?.elements, { ...(config.site !== undefined ? { site: config.site } : {}), path: request.path });\n\n return {\n html,\n ...(head !== undefined ? { head } : {}),\n headers: {\n ...documentHeaders(principal),\n ...(token !== null && principal === null ? { 'set-cookie': `${encodeURIComponent(tokenKey)}=; Path=/; Max-Age=0; SameSite=Lax` } : {}),\n },\n drawn: true,\n principal,\n ...(route !== undefined ? { page: route.name } : {}),\n live: snapshot.live,\n why: snapshot.why,\n drawnWith: snapshot.drawnWith,\n settled: snapshot.settled,\n };\n } catch (error) {\n console.error(`[moss/document] \"${request.path}\" could not be drawn — serving it undrawn:`, error);\n return undrawn;\n }\n};\n\n// ── pages, as files ──\n//\n// The same draw, for NOBODY, once per path: what a static host serves. There is\n// no credential to pass and no way to pass one — a file is the page as nobody\n// in particular sees it, which is the only page that may be kept.\n//\n// A page that is LIVE is still written, and said so: its file is a true first\n// screen, and its terminal will look for a socket. Whether that is acceptable\n// (a server stands beside the files) or a mistake (there is no server) is the\n// build's to decide, from the report — nothing here guesses.\n\nexport type ExportedDocument = {\n path: string;\n html: string;\n page?: string;\n head?: ScreenHead;\n drawn: boolean;\n live: boolean;\n why: string[];\n // reads whose answers are in the file as they were when it was written\n drawnWith: string[];\n settled: boolean;\n};\n\nexport const exportDocuments = async (config: Omit<DocumentConfig, 'request'> & { paths: readonly string[] }): Promise<ExportedDocument[]> => {\n const { paths, ...rest } = config;\n const out: ExportedDocument[] = [];\n for (const path of paths) {\n const page = await renderDocument({ ...rest, request: { path, cookie: null } });\n out.push({\n path,\n html: page.html,\n ...(page.page !== undefined ? { page: page.page } : {}),\n ...(page.head !== undefined ? { head: page.head } : {}),\n drawn: page.drawn,\n // undrawn is not concluded finished\n live: page.live ?? true,\n why: page.why ?? (page.drawn ? [] : ['the page could not be drawn']),\n drawnWith: page.drawnWith ?? [],\n settled: page.settled ?? false,\n });\n }\n return out;\n};\n","import { readFile } from 'node:fs/promises';\nimport { extname, join, relative } from 'node:path';\nimport { serve as listen } from '@hono/node-server';\nimport { serveStatic } from '@hono/node-server/serve-static';\nimport { WebSocketServer } from 'ws';\nimport type { IncomingMessage } from 'node:http';\nimport type { Duplex } from 'node:stream';\nimport { createServer } from './server';\nimport type { MossServer } from './server';\nimport type { NiscApp } from './app';\nimport type { NiscRuntime } from './runtime';\nimport type { SocketAccept } from './socket';\nimport { renderDocument } from './document';\nimport type { DocumentConfig } from './document';\n\n// ═══════════════════════════════════════════════════════════════\n// The Node entry — runtime-specific by design: the transport is a seam, so\n// the Bun flip swaps this file, never the app. Two exports: the\n// websocket transport for hosts that run their own listener (the dev\n// checks, vite), and the batteries-included `serve`.\n// ═══════════════════════════════════════════════════════════════\n\n// Anything that emits Node upgrade events — http.Server structurally, so\n// the @hono/node-server return type needs no narrowing.\ntype Upgradeable = {\n on: (event: 'upgrade', handler: (req: IncomingMessage, socket: Duplex, head: Buffer) => void) => unknown;\n};\n\n// The `ws` half of the transport seam: RFC 6455 stays library-handled\n// (permessage-deflate on by default — see `runtime.socketCompression`); the\n// protocol above the seam is nisc's own (../socket.ts) and identical on every\n// runtime.\nexport const attachSocket = (\n httpServer: Upgradeable,\n accept: SocketAccept,\n path = '/socket',\n options?: { compression?: boolean | Record<string, unknown> },\n): void => {\n const wss = new WebSocketServer({ noServer: true, perMessageDeflate: options?.compression ?? true });\n httpServer.on('upgrade', (req, socket, head) => {\n const url = req.url ?? '/';\n // Not ours: leave it for whichever other listener owns it (vite's HMR\n // upgrade rides the same server in dev).\n if (new URL(url, 'http://nisc.local').pathname !== path) return;\n wss.handleUpgrade(req, socket, head, (ws) => {\n // accept promises to handle its own failures (see socket.ts). This is\n // the floor under that promise: an await added there without a guard\n // degrades to one logged close here instead of an unhandled rejection\n // taking every session on the box down with it.\n accept(url, {\n send: (text) => ws.send(text),\n close: (code, reason) => ws.close(code, reason),\n onMessage: (fn) => ws.on('message', (data) => fn(String(data))),\n onClose: (fn) => ws.on('close', () => fn()),\n }).catch((error: unknown) => {\n console.error('[moss/node] a connection escaped accept:', error);\n try {\n ws.close(1011, 'accept failed');\n } catch {\n // already gone\n }\n });\n });\n });\n};\n\n// THE BUILT TERMINAL, served by the same process as the app — one origin, so the\n// socket is `/socket` wherever the page came from.\n//\n// `dist` is what the app's bundler wrote: index.html and its assets. Every GET\n// that nothing registered earlier answers is a file from it, or a PAGE:\n// index.html with the caller's screen drawn into it (./document) — the app's own\n// for `/`, one of the manifest's pages for a path that leads to one. index.html\n// itself is never served as a file: it is the template, and goes out drawn.\n//\n// A name with an extension that is neither a file in `dist` nor a page of the\n// manifest is a MISSING FILE, and is answered 404 — not with a screen. A browser\n// holding a page from before a deploy asks for that page's script by its old\n// name; what it needs back is \"gone\", not a document that is not a script.\n//\n// Register the app's own routes FIRST; this is the catch-all. `owned` names the\n// prefixes that are never a page (default: moss's own surfaces) — an unknown\n// path under one is a 404, not a screen.\nexport type SiteConfig = Pick<DocumentConfig, 'draw' | 'htmlAttributes' | 'site' | 'tokenKey' | 'waitMs'> & {\n dist: string;\n owned?: RegExp;\n};\n\n// The paths the app server answers itself; everything else is the site's.\nexport const MOSS_PATHS = /^\\/(api|catalog|socket|operator|integrations)(\\/|$)/;\n\nexport const mountSite = (server: MossServer, config: SiteConfig): void => {\n const { dist, owned = MOSS_PATHS, ...drawing } = config;\n // serveStatic resolves `root` against the working directory.\n const root = relative(process.cwd(), dist) || '.';\n const files = serveStatic({ root });\n server.use('/*', async (c, next) => {\n const path = c.req.path;\n if (owned.test(path) || path === '/' || path === '/index.html' || server.page(path) !== undefined) return next();\n return files(c, next);\n });\n server.get('*', async (c) => {\n if (owned.test(c.req.path)) return c.notFound();\n // the static server above found no such file, and no page is at this path\n if (extname(c.req.path) !== '' && c.req.path !== '/index.html' && server.page(c.req.path) === undefined) return c.notFound();\n const template = await readFile(join(dist, 'index.html'), 'utf8');\n const page = await renderDocument({\n ...drawing,\n server,\n template,\n request: { path: c.req.path === '/index.html' ? '/' : c.req.path, cookie: c.req.header('cookie') ?? null },\n });\n return c.html(page.html, 200, page.headers);\n });\n};\n\nexport const serve = async (app: NiscApp, runtime: NiscRuntime & { port?: number }): Promise<MossServer> => {\n const server = await createServer(app, runtime);\n const port = runtime.port ?? 8787;\n const httpServer = listen({ fetch: server.fetch, port });\n attachSocket(httpServer, server.socket, '/socket', { ...(runtime.socketCompression !== undefined ? { compression: runtime.socketCompression } : {}) });\n console.log(`moss serving http://localhost:${port}`);\n console.log(`surfaces: GET /catalog · GET|POST /api/vex · GET|POST /api/<resource>/vex · ws://localhost:${port}/socket`);\n return server;\n};\n","import { readFile } from 'node:fs/promises';\nimport { resolve } from 'node:path';\nimport type { Plugin, ViteDevServer } from 'vite';\nimport { getRequestListener } from '@hono/node-server';\nimport { renderDocument } from './document';\nimport type { DocumentConfig } from './document';\nimport { attachSocket, MOSS_PATHS } from './node';\nimport type { MossServer } from './server';\n\n// ═══════════════════════════════════════════════════════════════\n// @niscorp/moss/vite — the app server inside vite's dev process.\n//\n// One `nisc dev`, no proxy, no second terminal: the app boots in vite's own\n// process, through vite's own module loading (`ssrLoadModule`), so the boot it\n// runs is the source on disk and an edit is a fresh boot. What it does, in the\n// order a request meets it:\n//\n// the socket attached ONCE, delegating to whichever server is current —\n// a re-boot swaps what it delegates to, never the handler\n// /dev/as/:who a signed-in URL, when the app can mint a dev token\n// a page `/`, or a path one of the manifest's pages answers: index.html\n// through vite first (its client, the framework's refresh\n// preamble), then the screen drawn into it (`renderDocument`)\n// moss's paths /api, /catalog, /operator, /integrations — the app server's\n// the rest vite's: source files, assets, its own urls\n//\n// A change under one of the watched directories re-boots the whole app — a\n// fresh database, fresh seed, fresh shells — then reloads the page so the\n// browser reconnects to the new server. The outgoing server keeps answering\n// until the new one is up, so a broken edit does not take the dev server down,\n// and is then let go, timers included.\n// ═══════════════════════════════════════════════════════════════\n\nexport type DevApp = {\n server: MossServer;\n // how to let it go (default: `server.close()`)\n close?: () => void | Promise<void>;\n // How one of its screens is drawn. Absent: pages go out as vite's index.html,\n // undrawn, and the terminal paints them as it always did.\n draw?: DocumentConfig['draw'];\n htmlAttributes?: DocumentConfig['htmlAttributes'];\n site?: DocumentConfig['site'];\n tokenKey?: string;\n // A dev-only signed-in URL: `/dev/as/<who>` stores the token this returns —\n // where the wire keeps it and in the cookie copy a page is drawn by — and\n // goes to `/`. `null` is nobody of that name. It lives in vite's middleware\n // and nowhere else, so it cannot ship.\n signIn?: (who: string) => string | null | Promise<string | null>;\n};\n\nexport type MossDevOptions = {\n // Stand the app up. `load` is vite's own module loader: what it loads is the\n // source as it is on disk now, with the app's aliases resolved.\n app: (load: (id: string) => Promise<Record<string, unknown>>) => Promise<DevApp>;\n // Which edits re-boot the app (default: anything under src/app, src/server,\n // src/db or src/ui — the kit is in it because the SERVER holds the component\n // registry too — and the nisc config).\n watch?: RegExp;\n // The page template, relative to vite's root (default `index.html`).\n index?: string;\n // The paths the app server answers (default: moss's own).\n owned?: RegExp;\n // The name in vite's log (default `moss`).\n label?: string;\n};\n\nconst DEFAULT_WATCH = /([\\\\/]src[\\\\/](app|server|db|ui)[\\\\/])|([\\\\/]nisc\\.config\\.[cm]?[jt]s$)/;\nconst REBOOT_DEBOUNCE_MS = 200;\n\ntype Booted = { app: DevApp; listener: ReturnType<typeof getRequestListener> };\n\nconst retire = async (booted: Booted): Promise<void> => {\n booted.app.server.socket.stop();\n await (booted.app.close ?? ((): void => booted.app.server.close()))();\n};\n\nconst said = (error: unknown): string => (error instanceof Error ? error.message : String(error));\n\nexport const mossDev = (options: MossDevOptions): Plugin => ({\n name: 'moss-dev',\n apply: 'serve',\n configureServer: (vite: ViteDevServer) => {\n const label = options.label ?? 'moss';\n const watch = options.watch ?? DEFAULT_WATCH;\n const owned = options.owned ?? MOSS_PATHS;\n const load = (id: string): Promise<Record<string, unknown>> => vite.ssrLoadModule(id);\n\n const boot = async (): Promise<Booted> => {\n const app = await options.app(load);\n return { app, listener: getRequestListener(app.server.fetch) };\n };\n let current = boot();\n current.catch((error: unknown) => vite.config.logger.error(`[${label}] the app did not boot: ${said(error)}`, { timestamp: true }));\n\n if (vite.httpServer !== null) {\n attachSocket(\n vite.httpServer,\n Object.assign(async (url: string, connection: Parameters<MossServer['socket']>[1]) => (await current).app.server.socket(url, connection), {\n // whichever server is current owns the revalidation timer; this handler owns none\n stop: (): void => void current.then(({ app }) => app.server.socket.stop(), () => undefined),\n }),\n );\n }\n\n let timer: ReturnType<typeof setTimeout> | undefined;\n const reboot = (file: string): void => {\n if (!watch.test(file)) return;\n clearTimeout(timer);\n timer = setTimeout(() => {\n const outgoing = current;\n current = boot();\n current.then(\n () => {\n void outgoing.then(retire, () => undefined);\n vite.config.logger.info(`[${label}] app server re-booted`, { timestamp: true });\n vite.ws.send({ type: 'full-reload' });\n },\n (error: unknown) => {\n // the old server goes on answering until an edit boots\n current = outgoing;\n vite.config.logger.error(`[${label}] re-boot failed: ${said(error)}`, { timestamp: true });\n },\n );\n }, REBOOT_DEBOUNCE_MS);\n };\n vite.watcher.on('change', reboot);\n vite.watcher.on('add', reboot);\n vite.watcher.on('unlink', reboot);\n vite.httpServer?.once('close', () => void current.then(retire, () => undefined));\n\n vite.middlewares.use((req, res, next) => {\n const url = req.url ?? '/';\n const path = url.split('?')[0] ?? '/';\n\n const who = /^\\/dev\\/as\\/([\\w.@%-]+)$/.exec(path)?.[1];\n if (who !== undefined) {\n void current\n .then(async ({ app }) => {\n if (app.signIn === undefined) {\n next();\n return;\n }\n const token = await app.signIn(decodeURIComponent(who));\n const key = JSON.stringify(app.tokenKey ?? 'nisc.token');\n res.setHeader('content-type', 'text/html; charset=utf-8');\n res.end(\n token === null\n ? `<p>nobody called ${who.replace(/[<&\"]/g, '')}</p>`\n : `<script>localStorage.setItem(${key},${JSON.stringify(token)});document.cookie=encodeURIComponent(${key})+'='+encodeURIComponent(${JSON.stringify(token)})+'; Path=/; SameSite=Lax';location.replace('/')</script>`,\n );\n })\n .catch(() => {\n res.statusCode = 500;\n res.end('the dev sign-in failed');\n });\n return;\n }\n\n if (owned.test(path)) {\n void current.then(({ listener }) => listener(req, res)).catch(() => {\n res.statusCode = 503;\n res.end('the app server did not boot — see the dev server’s log');\n });\n return;\n }\n\n if (req.method !== 'GET') {\n next();\n return;\n }\n void current\n .then(async ({ app }) => {\n if (app.draw === undefined || (path !== '/' && path !== '/index.html' && app.server.page(path) === undefined)) {\n next();\n return;\n }\n const template = await vite.transformIndexHtml(url, await readFile(resolve(vite.config.root, options.index ?? 'index.html'), 'utf8'));\n const page = await renderDocument({\n server: app.server,\n template,\n request: { path: path === '/index.html' ? '/' : path, cookie: req.headers.cookie ?? null },\n draw: app.draw,\n ...(app.htmlAttributes !== undefined ? { htmlAttributes: app.htmlAttributes } : {}),\n ...(app.site !== undefined ? { site: app.site } : {}),\n ...(app.tokenKey !== undefined ? { tokenKey: app.tokenKey } : {}),\n });\n res.statusCode = 200;\n res.setHeader('content-type', 'text/html; charset=utf-8');\n for (const [name, value] of Object.entries(page.headers)) res.setHeader(name, value);\n res.end(page.html);\n })\n // not drawn is not broken: vite serves index.html as it always did\n .catch(() => next());\n });\n },\n});\n"]}
package/dist/vite.js CHANGED
@@ -1,5 +1,5 @@
1
- import { MOSS_PATHS, attachSocket } from './chunk-CDNJ2CBA.js';
2
- import { renderDocument } from './chunk-D6E4SV6F.js';
1
+ import { MOSS_PATHS, attachSocket } from './chunk-DPFWL7BS.js';
2
+ import { renderDocument } from './chunk-3CJCJKKY.js';
3
3
  import './chunk-ZOEUEMDX.js';
4
4
  import { readFile } from 'fs/promises';
5
5
  import { resolve } from 'path';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@niscorp/moss",
3
- "version": "0.2.4",
3
+ "version": "0.3.0",
4
4
  "description": "moss — the nisc app server: serves existence (catalog, scoped vex, the socket), derived from artifacts",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -171,12 +171,12 @@
171
171
  "zod": "^4.2.0",
172
172
  "vue": "^3.5.0",
173
173
  "vite": ">=6",
174
- "@niscorp/prism": "^0.1.2",
175
- "@niscorp/tide": "^0.1.2",
176
174
  "@niscorp/charter": "^0.1.1",
175
+ "@niscorp/prism": "^0.2.0",
177
176
  "@niscorp/strata": "^0.1.1",
178
- "@niscorp/vex": "^0.1.1",
179
- "@niscorp/nova": "^0.1.4"
177
+ "@niscorp/tide": "^0.1.2",
178
+ "@niscorp/nova": "^0.2.0",
179
+ "@niscorp/vex": "^0.2.0"
180
180
  },
181
181
  "peerDependenciesMeta": {
182
182
  "vite": {
@@ -211,12 +211,12 @@
211
211
  "vitest": "^4.1.2",
212
212
  "vue": "^3.5.43",
213
213
  "zod": "^4.6.5",
214
+ "@niscorp/prism": "^0.2.0",
214
215
  "@niscorp/charter": "^0.1.1",
215
- "@niscorp/nova": "^0.1.4",
216
- "@niscorp/prism": "^0.1.2",
216
+ "@niscorp/nova": "^0.2.0",
217
217
  "@niscorp/strata": "^0.1.1",
218
- "@niscorp/tide": "^0.1.2",
219
- "@niscorp/vex": "^0.1.1"
218
+ "@niscorp/vex": "^0.2.0",
219
+ "@niscorp/tide": "^0.1.2"
220
220
  },
221
221
  "scripts": {
222
222
  "build": "node -e \"fs.rmSync('dist',{recursive:true,force:true})\" && tsup",