@niscorp/moss 0.2.4 → 0.3.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,96 @@
1
1
  # @niscorp/moss
2
2
 
3
+ ## 0.3.2
4
+
5
+ ### Patch Changes
6
+
7
+ - a7d4de4: `server.charterReport()` — the charter report the server was verified by.
8
+
9
+ `createServer` runs `verifyCharter` at boot and again on every `refresh`, refuses on the report's `errors`, and read nothing else of it. The rest was computed and dropped: the `warnings` (an action no role grants, an `allow` that matches nothing) and each role's closure `issues`. A host that wanted them had to run `verifyCharter` itself, over a data universe it built by hand.
10
+
11
+ `charterReport()` returns that report: boot's, then that of each `refresh` that passed. A refresh that is refused leaves the one the server is still serving on. Nothing is printed, and boot refuses exactly what it refused before.
12
+
13
+ ```ts
14
+ const server = await createServer(app, runtime);
15
+ for (const warning of server.charterReport().warnings)
16
+ console.warn(`${warning.rule}: ${warning.detail}`);
17
+ ```
18
+
19
+ DOCS.md says one thing about what it holds: a push whose target is a binding (`@event.payload`, `$.target`) is listed among a role's `issues` as "not in the catalog", though it is resolved when the step runs.
20
+
21
+ **What to change:** nothing.
22
+
23
+ - f70d461: DOCS and DESIGN say what boot refuses. `createServer` refuses on `verifyCharter`'s errors. The closure audit's findings are filed under each role's `issues` in the report and are neither refused nor printed: a role granted an action that pushes one it is not granted boots, and the press does nothing. Two source comments now say the same. No code changed.
24
+
25
+ **What to change:** nothing.
26
+
27
+ - a7d4de4: The docs say a charter defines a role named `public`. A request with no session, and a signed-in principal with no assignment, resolve to that role, and the name is fixed. A charter without it still boots and nothing is said; those requests then fail with `Unknown role "public"` (a 500, a socket closed `4500`, a page served undrawn). `public: []` grants nothing. README, DOCS and DESIGN now say so, and a test holds it. No code changed.
28
+
29
+ **What to change:** nothing, for a charter that has the role. One that names its visitor role something else adds `public` beside it.
30
+
31
+ - 979b3e3: `src/principal.ts` is text again. One separator in `wearableOf` was written as a raw NUL byte where the same file writes the escape `'\0'` two functions down, so git treated the whole file as binary: its diffs showed `Bin`, and a text search (`git grep -I`) skipped the file that defines `wearableOf`, `resolveFor` and `verifyCharter`.
32
+
33
+ The byte is now the escape. The string it produces is the same one, and the built package is the same code: every built file is identical apart from the names of two chunks, which are hashes that take the embedded source text in.
34
+
35
+ **What to change:** nothing.
36
+
37
+ ## 0.3.1
38
+
39
+ ### Patch Changes
40
+
41
+ - fe30458: Every package exports its `package.json`, so an app can say which version of a package it runs by reading it from the package:
42
+
43
+ ```ts
44
+ import prism from '@niscorp/prism/package.json' with { type: 'json' };
45
+ prism.version; // the version that is installed, not the range that asked for it
46
+ ```
47
+
48
+ Until now the `exports` map hid it, and the only way to the version was a path into `node_modules`. `check:packages` installs the tarballs and reads every package's version this way.
49
+
50
+ **What to change:** nothing. An app that read a version by path can read it by name.
51
+
52
+ - 1e6d55d: A pool's `query` and `transaction` are called on the pool, and a transaction's `query` on the transaction — never taken off the object first. A driver's own object has them as methods that need their receiver, and taken off they failed inside the driver, on a property nothing in nisc names:
53
+ - **strata** — `migrate` and `upgradeStore` over a `PGlite` threw `Cannot read properties of undefined (reading '_checkReady')`; `status` and `readLedger` did too, once a ledger existed. A pool whose `transaction` hands a checked-out `pg` client through as the transaction failed in `migrate` the same way.
54
+ - **moss** — `createTideStore` took `query` off the transaction. Over a pool that hands its client through, every transaction of the store failed inside the driver, and tide recorded the run as deferred: nothing threw, and the effect never ran.
55
+ - **vex** — `createPostgresAdapter` with a read limit set (`limitReads`) threw on a pool whose `transaction` is a method.
56
+
57
+ A `PGlite` now works as a pool as it is, and so does a `pg` wrapper that passes its client through. A pool built from closures (`createPglitePool`, a wrapper that builds its own `query`) behaves as before.
58
+
59
+ **What to change:** nothing.
60
+
61
+ ## 0.3.0
62
+
63
+ ### Minor Changes
64
+
65
+ - f1cec45: A Prism config that validates no longer names an op Prism does not have. `validate` accepted `{ card: { $fetch: … } }` and `{ $eval: "…" }`: the plain-object branch refused only the names of ops that exist, so any other `$` key passed as a template key. Such a config could be stored — an endpoint request, a vex mapping, a strata migration — and then failed every time it was evaluated (`E_NODE_SHAPE`, "Unsupported node shape").
66
+
67
+ A key that starts with `$` is now an op's name and nothing else. The template branch refuses every `$` key — the rule the evaluator already held — so `validate` reports it with the key and where it is (`card.$fetch: Not a Prism op. A key that starts with "$" names an op; data with such a key goes in $const.`), and `evaluate` and `compile` fail with `E_SCHEMA` before anything runs. An op's name used as a template key keeps its own message. `E_NODE_SHAPE` is left for a tree that never went through the schema: an IR handed to `execute`. Adding an op no longer takes a key away from templates.
68
+ - **prism** — the change, and a grammar narrowing: `nisc.prism` 2, a marker with no document step (a key that never evaluated has nothing to be rewritten to). `$` keys that are data are untouched: a `$const` payload, `$with` names, `$renameKeys` and `$fromEntries` keys. The JSON Schema's template key pattern is `^(?!\$)` instead of a list of every op.
69
+ - **nova, vex, moss, loom, cli, nisc** — no change of their own. They depend on prism and are released with it, so the set installs together; the configs they hand to prism (endpoint `request` and `response`, `$prism` bindings, vex mappings) are held to the same rule.
70
+ - **create-nisc** — the templates' sources are recorded at `nisc.prism` 2.
71
+
72
+ **What to change:** in a config with a `$`-prefixed key that is not a Prism op, remove the key — or put the object in `$const` if it is literal data. An app that keeps a `strata.lock.json` runs `pnpm strata upgrade`, then `pnpm strata verify`; there is nothing to edit unless it has such a config. Everything else: nothing.
73
+
74
+ BREAKING — approved by moccadroid, 2026-10-04: a config with a `$`-prefixed key that is not a Prism op no longer validates, compiles or evaluates — also where evaluation never reached the key (an untaken `$case` branch, a short-circuited `$or`, a `$map` body over an empty array), which used to work. A vex seed mapping with one fails when it is seeded, at boot, instead of on each replay. Code that matched `E_NODE_SHAPE` from `evaluate` gets `E_SCHEMA`. The `@niscorp` packages that depend on prism move with it, so an app moves them together (`@niscorp/nisc` 0.3.0).
75
+
76
+ ### Patch Changes
77
+
78
+ - de6d980: A fix for the last fix: `nova:head` is the document's `<head>`, and holds what a head holds. 0.1.4 gave it five props (`title`, `description`, `image`, `kind`, `structured`) and wrote tags from them, which closed a head to whatever nova had been taught: no `og:image:alt`, no `og:type` but two, no whole address inside structured data. That was wrong, and it is replaced, not extended. The maintainer withdrew 0.1.4's props on 2026-10-04; this ships as a patch on that decision.
79
+
80
+ **What to change** (only an app that used 0.1.4's props): a `nova:head` node no longer takes props. Write its children instead — `nova:title`, `nova:meta`, `nova:link`, `nova:script` — each with the element's attributes as its props. `{ title: X }` becomes `{ component: 'nova:title', children: X }`; `description` becomes `nova:meta` with `name: 'description'`; `image` and `kind` become `nova:meta` with `property: 'og:image'` and `property: 'og:type'`; `structured` becomes `nova:script` with `type: 'application/ld+json'` and `data`. `og:title` and `og:description` are no longer written from the title and description: say them if they are wanted. An address is written as given — a picture's is not made whole from `site`. Code that called `headOf`, `placeHead` or `createTitleKeeper`, or read `head` off `renderDocument`'s result or a route report, takes the new shapes below.
81
+ - **nova** — a head's children are the elements a head holds, named as HTML names them, and **a child's props are that element's attributes, written as given**: nova keeps no list of them, so any `name`, `property` or `rel` can be said. Nothing in a head is drawn on the screen and no name has to be registered. With more than one head on a screen they are read in the order the screen is drawn, and an element that says the same thing as an earlier one (the title, a `<meta>` of that name or property, the canonical address) takes its place; anything else stands beside its like. What runs or styles is refused, left out and named: a script a browser would execute (`nova:script` is a data block — a JSON `type`, never a `src`), a stylesheet, `http-equiv`, a handler attribute. `headOf(api)` returns `{ elements, actions, refused }`. In `@niscorp/nova/document`, `placeHead(html, elements, { site, path })` writes them — an element takes the place of the tag that said the same thing, where it stood; what it wrote is marked `data-nova-head`, and a tag that gave way is kept inert in a `<template data-nova-own>` — and `createHeadKeeper(document)` replaces `createTitleKeeper`: the whole head follows the screen in the page, and the document's own tags come back when the screen stops saying them. Removed: the five props, the `Head` and `HeadProps` types, `createTitleKeeper`.
82
+ - **cli** — `build`, `export` and `start` write each path's head from those elements. A head that holds what it may not fails the path, like any other check. `site` still gives every path its own canonical address and `og:url`; it no longer touches a picture's address.
83
+ - **moss** — `renderDocument` and `exportDocuments` do the same from the snapshot (`head` on the result is `{ elements, actions, refused }`; a refusal is logged and left out), and the terminal keeps the whole head off the wire.
84
+ - **create-nisc** — the two own-shell templates write their welcome screen's head this way.
85
+
86
+ **Where a script goes:** in the app's own `index.html`, which holds anything and from which every page is written, or in the kit component that needs it. A layout is data and does not carry one.
87
+
88
+ - Updated dependencies [de6d980]
89
+ - Updated dependencies [f1cec45]
90
+ - @niscorp/nova@0.2.0
91
+ - @niscorp/prism@0.2.0
92
+ - @niscorp/vex@0.2.0
93
+
3
94
  ## 0.2.4
4
95
 
5
96
  ### Patch Changes
package/DESIGN.md CHANGED
@@ -107,7 +107,10 @@ The organizing principle: an app hands over **artifacts** and an
107
107
  live in the terminal.
108
108
  - **Coherence is refused, not documented.** `createServer` runs `verifyCharter`
109
109
  (with nova's closure audit injected over effective definitions) and
110
- `verifyVariants`, and throws on errors. If it boots, it's coherent.
110
+ `verifyVariants`, and throws on errors. The closure audit's findings are not
111
+ errors: they are filed under each role's `issues` in the report, and boot
112
+ neither refuses on them nor prints them. If it boots, the charter and the
113
+ variants are coherent; a push to an ungranted action can still be in it.
111
114
 
112
115
  The test of the principle: moss adds no new vocabulary. Reads are vex, writes are
113
116
  vex, compute is functions, UI is actions, permissions are the charter. The server
@@ -304,7 +307,10 @@ the shell for the life of the process.
304
307
  The shell is built from the manifest: canvases and fragments are data; a canvas's
305
308
  `initial` may be a candidate list, and the first action the principal holds
306
309
  mounts — so login is the anonymous principal's application (the charter's
307
- `public` grant) by derivation, not a special case. `inputs(session)` and
310
+ `public` grant) by derivation, not a special case. The role name is fixed and
311
+ the charter has to define it, as `public: []` if it grants nothing: boot does
312
+ not check that it is there, and a request that resolves to a missing `public`
313
+ fails. `inputs(session)` and
308
314
  `seeds(session)` are the app's per-principal boot hooks — boot data and boot
309
315
  instances. Endpoint calls ride the server's own HTTP surfaces
310
316
  with the session's token — the server shell is just another principal-bound
@@ -362,14 +368,14 @@ drawing a signed-in screen to a string is 0.4–0.7 ms; a whole anonymous docume
362
368
  page carries its screen twice (markup and snapshot), 3–5 KB compressed.
363
369
 
364
370
  **The head of the page is part of the screen.** A title, a description and a
365
- preview card are facts about what the screen shows, so they are a node in a
366
- layout (nova's `nova:head`) and ride in the same trees as everything else:
367
- `renderDocument` reads the node off the snapshot and writes it into the
368
- template's `<head>`, and the terminal reads it off the wire to keep the tab's
369
- title. Nothing was added to the snapshot, the wire or the manifest for it. The
370
- one thing a head cannot say is where the page lives — a layout never holds its
371
- own address — so the canonical address is the `site` plus the path the
372
- document was drawn at, both of which the writer already holds.
371
+ preview card are facts about what the screen shows, so the page's `<head>` is a
372
+ node in a layout (nova's `nova:head`, holding the elements a head holds) and
373
+ rides in the same trees as everything else: `renderDocument` reads the
374
+ elements off the snapshot and writes them into the template's `<head>`, and the
375
+ terminal reads them off the wire to keep the page's head. Nothing was added to
376
+ the snapshot, the wire or the manifest for it. Where the page lives is known to
377
+ the writer without being told: the `site` plus the path the document was drawn
378
+ at.
373
379
 
374
380
  Six things had to be true, and each is a small, separate decision:
375
381
 
package/DOCS.md CHANGED
@@ -301,12 +301,14 @@ harness wants and a deployment must opt into out loud.
301
301
  #### `createServer(app, runtime): Promise<MossServer>`
302
302
 
303
303
  Stands up the data layer, **refuses to boot** on an incoherent charter
304
- (`verifyCharter` + nova's closure audit), memoizes per-principal policy,
304
+ (`verifyCharter`'s errors), memoizes per-principal policy,
305
305
  catalogs, and ring-2 variant bindings, mounts the vex surfaces and `/catalog`, and — when the manifest
306
306
  declares a shell — the shell host behind the socket. Also refused at boot: an
307
307
  entry whose `reach` names no profile the behaviors declare, and two pages that
308
- could answer one path. Returns a Hono app extended with the `MossServer`
309
- members below.
308
+ could answer one path. A broken closure is not among them: the closure audit's
309
+ findings land in the report's `perRole[].issues`, which boot does not read. A
310
+ role granted an action that pushes one it is not granted boots, and the press
311
+ does nothing. Returns a Hono app extended with the `MossServer` members below.
310
312
 
311
313
  What the server answers over HTTP:
312
314
 
@@ -330,7 +332,7 @@ is the anonymous principal. There is no `/fns` surface.
330
332
  #### `MossServer`
331
333
 
332
334
  `Hono<Env> & { socket: SocketAccept; shells?: ShellHost; principalOf; page; pages;
333
- refresh; invalidateIdentity; invalidateTenant; identity; executeAs;
335
+ refresh; charterReport; invalidateIdentity; invalidateTenant; identity; executeAs;
334
336
  callIntegration; nudge; generation; close; identities? }`.
335
337
  It's a Hono app — mount it, extend it, or hand it to a listener.
336
338
 
@@ -351,6 +353,15 @@ It's a Hono app — mount it, extend it, or hand it to a listener.
351
353
  on an incoherent charter or variant set, and the old resolution keeps
352
354
  serving. It also moves the generation pointer, so every other process on the
353
355
  same database does the same within one poll.
356
+ - `charterReport(): VerifyReport` — the report `verifyCharter` gave this server:
357
+ boot's, then that of each `refresh` that passed. `{ errors, warnings,
358
+ perRole }`, over the universes boot resolved against. Boot and `refresh` read
359
+ `errors` alone and print nothing of the rest, so this is where a host reads
360
+ it, to draw, log or hold a deploy on: `warnings` (an action no role grants, an
361
+ `allow` that matches nothing) and each role's closure `issues`. `errors` is
362
+ always empty here. A push whose target is a binding (`@event.payload`,
363
+ `$.target`) is listed among the `issues` as "not in the catalog", though it is
364
+ resolved when the step runs; a `{{…}}` target is not listed.
354
365
  - `generation(): number` — the generation this process last observed (`-1`
355
366
  before the first read).
356
367
  - `invalidateIdentity(principal): boolean` — forget one principal's identity
@@ -470,19 +481,21 @@ const page = await renderDocument({
470
481
  - **`htmlAttributes`** is for what a kit would otherwise set on `<html>` from an
471
482
  effect, which never runs on a server: a palette, a colour scheme. Read it off
472
483
  the same node the effect reads it from. Values are escaped.
473
- - **The page's head is its screen's own.** What a screen says about itself is
474
- a node in a layout — nova's `nova:head`, with `title`, `description`,
475
- `image`, `kind` and `structured` bound to the action's data. It is in the
476
- snapshot's trees like everything else on the screen, so it is read off them
477
- and written into the template's `<head>`: what it says takes the place of
478
- the tag that said the same thing, and the rest of the head is left as the
479
- template has it. `head` in the result is what was read (`{ head, action? }`);
480
- absent, the page went out with the template's. In the browser the terminal
481
- keeps the tab's title on the same node as the screen moves.
482
- - **`site`** is the address the site is served at. A layout never holds its
483
- own page's address: with `site`, every path's document says its own
484
- canonical address (`<link rel="canonical">`, `og:url`) and a picture a head
485
- names is given a whole one. Without it the template's is left as it is.
484
+ - **The page's `<head>` is its screen's own.** It is a node in a layout —
485
+ nova's `nova:head`, whose children (`nova:title`, `nova:meta`, `nova:link`,
486
+ `nova:script`) are the elements a head holds, their props the elements'
487
+ attributes. It is in the snapshot's trees like everything else on the screen,
488
+ so the elements are read off them and written into the template's `<head>`:
489
+ one takes the place of the tag that said the same thing, anything else is
490
+ added, and the rest of the head is left as the template has it. `head` in the
491
+ result is what was read (`{ elements, actions, refused }`); absent, the
492
+ screen has no head and the page went out with the template's. What a head may
493
+ not hold — something that runs, or styles — is left out and logged. In the
494
+ browser the terminal keeps the page's head on the same node as the screen
495
+ moves, and the template's own tags come back when it stops saying them.
496
+ - **`site`** is the address the site is served at. With it, every path's
497
+ document says its own canonical address (`<link rel="canonical">`, `og:url`).
498
+ Without it the template's is left as it is.
486
499
  - **`template`** must hold the empty root (`root`, default
487
500
  `<div id="root"></div>`). The screen goes inside it, the snapshot element
488
501
  straight after.
@@ -682,7 +695,11 @@ measures the end.
682
695
  ### Resolution (exposed for tools)
683
696
 
684
697
  - `resolveRoles(app, principal): readonly string[]` — assignment rows; anonymous/
685
- unassigned wears `['public']`.
698
+ unassigned wears `['public']`. The name is fixed, and the charter has to
699
+ define it (`public: []` grants nothing). Where it does not, the server still
700
+ boots and nothing is said; then every request with no session, and every
701
+ signed-in principal with no assignment, fails with `Unknown role "public"` —
702
+ a 500, a socket closed `4500`, a page served undrawn.
686
703
  - `resolvePolicy(app, grants, principal): ScopePolicy` — the compiled vex policy
687
704
  this principal reads and writes under. **One policy per role, merged** — a
688
705
  person may wear several (an instructor who also trains here), and reach belongs
package/README.md CHANGED
@@ -51,6 +51,11 @@ const server = await serve(app, { pool, db, session: 'sessions', port: 3000 });
51
51
  // boot refusal here (createServer runs inside serve); HTTP + ws in one
52
52
  ```
53
53
 
54
+ The charter defines a role named `public`. It is what a request with no session
55
+ resolves to, and a signed-in principal with no assignment. `public: []` grants
56
+ nothing. A charter without the role still boots, and those requests then fail
57
+ with `Unknown role "public"`.
58
+
54
59
  ## The first screen can arrive with the page
55
60
 
56
61
  A page request can be answered with the screen itself: the caller's shell is
@@ -85,11 +90,11 @@ Who may keep the page follows from who asked: drawn for nobody it is the same
85
90
  for everybody; drawn for somebody it is `private, no-store`. A page that cannot
86
91
  be drawn goes out undrawn.
87
92
 
88
- The page's `<head>` is its screen's own: a `nova:head` node in a layout — a
89
- title, a description, a preview picture, bound to the action's data — is read
90
- off the snapshot and written into the template, and the terminal keeps the
91
- tab's title on it as the screen moves. With `site`, every path says its own
92
- canonical address.
93
+ The page's `<head>` is a node in a layout too — nova's `nova:head`, holding
94
+ the elements a head holds, bound to the action's data. It is read off the
95
+ snapshot and written into the template, and the terminal keeps the page's head
96
+ on it as the screen moves. With `site`, every path says its own canonical
97
+ address.
93
98
 
94
99
  `pages` are the other thing a path can lead to: a shell manifest drawn for
95
100
  whoever asks and then let go — a welcome, the docs. A page with nothing left to
@@ -1,4 +1,4 @@
1
- import { renderDocument, createServer } from './chunk-D6E4SV6F.js';
1
+ import { renderDocument, createServer } from './chunk-ZP3C53AC.js';
2
2
  import { readFile } from 'fs/promises';
3
3
  import { relative, extname, join } from 'path';
4
4
  import { serve as serve$1 } from '@hono/node-server';
@@ -60,5 +60,5 @@ var serve = async (app, runtime) => {
60
60
  };
61
61
 
62
62
  export { MOSS_PATHS, attachSocket, mountSite, serve };
63
- //# sourceMappingURL=chunk-CDNJ2CBA.js.map
64
- //# sourceMappingURL=chunk-CDNJ2CBA.js.map
63
+ //# sourceMappingURL=chunk-SUVDISEG.js.map
64
+ //# sourceMappingURL=chunk-SUVDISEG.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/node.ts"],"names":["listen"],"mappings":";;;;;;;AAgCO,IAAM,eAAe,CAC1B,UAAA,E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AA,MACH,MAAA;AAAA,MACA,QAAA;AAAA,MACA,SAAS,EAAE,IAAA,EAAM,CAAA,CAAE,GAAA,CAAI,SAAS,aAAA,GAAgB,GAAA,GAAM,CAAA,CAAE,GAAA,CAAI,MAAM,MAAA,EAAQ,CAAA,CAAE,IAAI,MAAA,CAAO,QAAQ,KAAK,IAAA;AAAK,KAC1G,CAAA;AACD,IAAA,OAAO,EAAE,IAAA,CAAK,IAAA,CAAK,IAAA,EAAM,GAAA,EAAK,KAAK,OAAO,CAAA;AAAA,EAC5C,CAAC,CAAA;AACH;AAEO,IAAM,KAAA,GAAQ,OAAO,GAAA,EAAc,OAAA,KAAkE;AAC1G,EAAA,MAAM,MAAA,GAAS,MAAM,YAAA,CAAa,GAAA,EAAK,OAAO,CAAA;AAC9C,EAAA,MAAM,IAAA,GAAO,QAAQ,IAAA,IAAQ,IAAA;AAC7B,EAAA,MAAM,aAAaA,OAAA,CAAO,EAAE,OAAO,MAAA,CAAO,KAAA,EAAO,MAAM,CAAA;AACvD,EAAA,YAAA,CAAa,YAAY,MAAA,CAAO,MAAA,EAAQ,SAAA,EAAW,EAAE,GAAI,OAAA,CAAQ,iBAAA,KAAsB,MAAA,GAAY,EAAE,aAAa,OAAA,CAAQ,iBAAA,EAAkB,GAAI,IAAK,CAAA;AACrJ,EAAA,OAAA,CAAQ,GAAA,CAAI,CAAA,8BAAA,EAAiC,IAAI,CAAA,CAAE,CAAA;AACnD,EAAA,OAAA,CAAQ,GAAA,CAAI,CAAA,oGAAA,EAA8F,IAAI,CAAA,OAAA,CAAS,CAAA;AACvH,EAAA,OAAO,MAAA;AACT","file":"chunk-CDNJ2CBA.js","sourcesContent":["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"]}
1
+ {"version":3,"sources":["../src/node.ts"],"names":["listen"],"mappings":";;;;;;;AAgCO,IAAM,eAAe,CAC1B,UAAA,EACA,MAAA,EACA,IAAA,GAAO,WACP,OAAA,KACS;AACT,EAAA,MAAM,GAAA,GAAM,IAAI,eAAA,CAAgB,EAAE,QAAA,EAAU,MAAM,iBAAA,EAAmB,OAAA,EAAS,WAAA,IAAe,IAAA,EAAM,CAAA;AACnG,EAAA,UAAA,CAAW,EAAA,CAAG,SAAA,EAAW,CAAC,GAAA,EAAK,QAAQ,IAAA,KAAS;AAC9C,IAAA,MAAM,GAAA,GAAM,IAAI,GAAA,IAAO,GAAA;AAGvB,IAAA,IAAI,IAAI,GAAA,CAAI,GAAA,EAAK,mBAAmB,CAAA,CAAE,aAAa,IAAA,EAAM;AACzD,IAAA,GAAA,CAAI,aAAA,CAAc,GAAA,EAAK,MAAA,EAAQ,IAAA,EAAM,CAAC,EAAA,KAAO;AAK3C,MAAA,MAAA,CAAO,GAAA,EAAK;AAAA,QACV,IAAA,EAAM,CAAC,IAAA,KAAS,EAAA,CAAG,KAAK,IAAI,CAAA;AAAA,QAC5B,OAAO,CAAC,IAAA,EAAM,WAAW,EAAA,CAAG,KAAA,CAAM,MAAM,MAAM,CAAA;AAAA,QAC9C,SAAA,EAAW,CAAC,EAAA,KAAO,EAAA,CAAG,EAAA,CAAG,SAAA,EAAW,CAAC,IAAA,KAAS,EAAA,CAAG,MAAA,CAAO,IAAI,CAAC,CAAC,CAAA;AAAA,QAC9D,OAAA,EAAS,CAAC,EAAA,KAAO,EAAA,CAAG,GAAG,OAAA,EAAS,MAAM,IAAI;AAAA,OAC3C,CAAA,CAAE,KAAA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AAI,CAAA,OAAA,CAAS,CAAA;AACvH,EAAA,OAAO,MAAA;AACT","file":"chunk-SUVDISEG.js","sourcesContent":["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"]}
@@ -502,7 +502,7 @@ var createTideStore = (pool, options = {}) => {
502
502
  await ready;
503
503
  if (client.transaction === void 0)
504
504
  throw new Error("tide store: this pool cannot transact \u2014 fan-out and attempt recording are transactions, not conventions");
505
- return client.transaction((tx) => fn(build({ ...client, query: tx.query })));
505
+ return client.transaction((tx) => fn(build({ ...client, query: (text, values) => tx.query(text, values) })));
506
506
  }
507
507
  };
508
508
  return store;
@@ -2434,6 +2434,7 @@ var createServer = async (app, runtime) => {
2434
2434
  throw new Error(`Charter is incoherent \u2014 refusing to serve:
2435
2435
  ${report.errors.map((e) => ` ${e.rule}: ${e.detail}`).join("\n")}`);
2436
2436
  }
2437
+ let verifiedReport = report;
2437
2438
  for (const cycle of chainCycles(app.actions)) {
2438
2439
  console.error(`[moss] a chain of steps that never ends: ${cycle.path} \u2014 nova stops it at its budget when it runs (RUNAWAY_CHAIN)`);
2439
2440
  }
@@ -3154,6 +3155,7 @@ ${nextReport.errors.map((e) => ` ${e.rule}: ${e.detail}`).join("\n")}`);
3154
3155
  throw new Error(`Refresh refused \u2014 layout variants incoherent:
3155
3156
  ${nextVariantErrors.map((e) => ` ${e}`).join("\n")}`);
3156
3157
  }
3158
+ verifiedReport = nextReport;
3157
3159
  identities?.invalidateAll();
3158
3160
  policies.clear();
3159
3161
  reachPolicies.clear();
@@ -3191,6 +3193,7 @@ ${nextVariantErrors.map((e) => ` ${e}`).join("\n")}`);
3191
3193
  pages: Object.entries(pageManifests).map(([name, manifest]) => ({ name, path: manifest.path })),
3192
3194
  ...shells !== void 0 ? { shells } : {},
3193
3195
  refresh,
3196
+ charterReport: () => verifiedReport,
3194
3197
  generation: () => generation?.current() ?? -1,
3195
3198
  // Every timer this server owns, stopped once. Absent pieces (an app with no
3196
3199
  // identity seam, no shells) simply have nothing to stop — the `?.` is the
@@ -3270,7 +3273,8 @@ var renderDocument = async (config) => {
3270
3273
  const attributes = Object.entries(config.htmlAttributes?.(snapshot) ?? {}).map(([name, value]) => ` ${name}="${escapeAttribute(value)}"`).join("");
3271
3274
  const placed = template.replace(root, () => `${root.replace("></div>", () => `>${screen}</div>`)}${embedSnapshot(snapshot, principal, request.path)}`).replace(/<html([^>]*)>/, (whole, existing) => attributes === "" ? whole : `<html${existing}${attributes}>`);
3272
3275
  const head = headOf({ frame: () => snapshot.frame, canvasTree: (id) => snapshot.trees[id] ?? [] });
3273
- const html = placeHead(placed, head?.head, { ...config.site !== void 0 ? { site: config.site } : {}, path: request.path });
3276
+ for (const why of head?.refused ?? []) console.error(`[moss/document] "${request.path}" \u2014 ${why}`);
3277
+ const html = placeHead(placed, head?.elements, { ...config.site !== void 0 ? { site: config.site } : {}, path: request.path });
3274
3278
  return {
3275
3279
  html,
3276
3280
  ...head !== void 0 ? { head } : {},
@@ -3313,5 +3317,5 @@ var exportDocuments = async (config) => {
3313
3317
  };
3314
3318
 
3315
3319
  export { DEFAULT_GENERATION_POLL_MS, DEFAULT_IDENTITY_IDLE_MS, DEFAULT_IDENTITY_MAX, DEFAULT_IDLE_MS, GENERATION_DDL, MOSS_SEQUENCE, SESSIONS_SEQUENCE, SNAPSHOT_ELEMENT_ID, TIDE_DDL, TIDE_SEQUENCE, TIDE_TABLES, auditClosure, buildContract, callIntegrationWith, contractAsMarkdown, copyPress, createAssertionSigner, createDataLayer, createGeneration, createIdentityCache, createPageRouter, createServer, createShellHost, createTideStore, describePlacements, devSession, documentHeaders, embedSnapshot, exportDocuments, filterInstalled, hashIntegrationKey, initIntegrations, initSessions, integrationByKey, integrationOfAction, listAttachments, listIntegrations, listPlacements, loadIntegrationActions, memoKeyOf, mintDevToken, mintIntegrationKey, mintSession, mintWrites, renderDocument, resolveCatalog, resolveCatalogForRoles, resolvePolicy, resolvePolicyAtReach, resolvePolicyForRoles, resolveRoles, resolveVariants, resolveVariantsForRoles, revokeAllFor, revokeSession, runIntake, sessionOf, sessionVerifierOf, shellNeedOf, tokenFromCookie, verifyAssertion, verifyVariants, wearableOf, wireFabric };
3316
- //# sourceMappingURL=chunk-D6E4SV6F.js.map
3317
- //# sourceMappingURL=chunk-D6E4SV6F.js.map
3320
+ //# sourceMappingURL=chunk-ZP3C53AC.js.map
3321
+ //# sourceMappingURL=chunk-ZP3C53AC.js.map