@niscorp/moss 0.2.3 → 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/CHANGELOG.md +47 -0
- package/DESIGN.md +10 -0
- package/DOCS.md +19 -3
- package/README.md +6 -0
- package/dist/{chunk-2AHJ6VDR.js → chunk-3CJCJKKY.js} +9 -5
- package/dist/chunk-3CJCJKKY.js.map +1 -0
- package/dist/{chunk-JBRD2TDQ.js → chunk-DPFWL7BS.js} +3 -3
- package/dist/{chunk-JBRD2TDQ.js.map → chunk-DPFWL7BS.js.map} +1 -1
- package/dist/{document-Dg1BZxCz.d.cts → document-Jhfii6kd.d.cts} +4 -0
- package/dist/{document-Dg1BZxCz.d.ts → document-Jhfii6kd.d.ts} +4 -0
- package/dist/index.cjs +7 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +1 -1
- package/dist/node.cjs +6 -3
- package/dist/node.cjs.map +1 -1
- package/dist/node.d.cts +3 -2
- package/dist/node.d.ts +3 -2
- package/dist/node.js +2 -2
- package/dist/terminal/index.cjs +10 -0
- package/dist/terminal/index.cjs.map +1 -1
- package/dist/terminal/index.js +10 -0
- package/dist/terminal/index.js.map +1 -1
- package/dist/vite.cjs +7 -3
- package/dist/vite.cjs.map +1 -1
- package/dist/vite.d.cts +3 -1
- package/dist/vite.d.ts +3 -1
- package/dist/vite.js +3 -2
- package/dist/vite.js.map +1 -1
- package/package.json +9 -9
- package/dist/chunk-2AHJ6VDR.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { N as NiscRuntime, S as SessionVerifier, L as LayoutVariant, P as PageManifest } from './document-
|
|
2
|
-
export { B as Bundle, C as CLOSE_INVALID_TOKEN, a as CLOSE_SHELL_FAILED, b as CLOSE_SIGNED_OUT, c as CallIntegration, d as Catalog, e as ClientMessage, f as Connection, g as Contract, D as DEFAULT_IDENTITY_IDLE_MS, h as DEFAULT_IDENTITY_MAX, i as DEFAULT_IDLE_MS, j as DEFAULT_REVALIDATE_MS, k as DocumentConfig, l as DrawnDocument, E as Emit, m as ExecuteAs, n as ExportedDocument, F as Fabric, o as FabricApply, p as FabricMessage, q as FabricSignal, r as FactIntake, s as FunctionSession, I as IdentityCache, t as IdentityCacheContext, u as IdentityRecord, v as IdentityReport, w as IntakeContext, x as IntakeResult, y as IntegrationRow, M as MOSS_SEQUENCE, z as MossServer, A as NiscApp, G as PressResult, R as RunRecord, H as RunSink, J as RunTurn, K as SNAPSHOT_ELEMENT_ID, O as ServerMessage, Q as ShellHost, T as ShellManifest, U as ShellNeed, V as ShellOpening, W as ShellReport, X as ShellSession, Y as ShellSnapshot, Z as SocketAccept, _ as SocketContext, $ as SpanClock, a0 as StorePress, a1 as Telemetry, a2 as TelemetrySpan, a3 as buildContract, a4 as callIntegrationWith, a5 as contractAsMarkdown, a6 as copyPress, a7 as createIdentityCache, a8 as createServer, a9 as createShellHost, aa as createSocket, ab as defineApp, ac as describePlacements, ad as devSession, ae as documentHeaders, af as embedSnapshot, ag as emitterOf, ah as exportDocuments, ai as filterInstalled, aj as initIntegrations, ak as integrationByKey, al as integrationOfAction, am as listAttachments, an as listIntegrations, ao as listPlacements, ap as loadIntegrationActions, aq as memoKeyOf, ar as mintDevToken, as as renderDocument, at as resolveCatalog, au as resolveCatalogForRoles, av as resolvePolicy, aw as resolvePolicyAtReach, ax as resolvePolicyForRoles, ay as resolveRoles, az as resolveVariants, aA as resolveVariantsForRoles, aB as runIntake, aC as shellNeedOf, aD as spanClock, aE as tokenFromCookie, aF as verifyVariants, aG as wearableOf, aH as wireFabric } from './document-
|
|
1
|
+
import { N as NiscRuntime, S as SessionVerifier, L as LayoutVariant, P as PageManifest } from './document-Jhfii6kd.cjs';
|
|
2
|
+
export { B as Bundle, C as CLOSE_INVALID_TOKEN, a as CLOSE_SHELL_FAILED, b as CLOSE_SIGNED_OUT, c as CallIntegration, d as Catalog, e as ClientMessage, f as Connection, g as Contract, D as DEFAULT_IDENTITY_IDLE_MS, h as DEFAULT_IDENTITY_MAX, i as DEFAULT_IDLE_MS, j as DEFAULT_REVALIDATE_MS, k as DocumentConfig, l as DrawnDocument, E as Emit, m as ExecuteAs, n as ExportedDocument, F as Fabric, o as FabricApply, p as FabricMessage, q as FabricSignal, r as FactIntake, s as FunctionSession, I as IdentityCache, t as IdentityCacheContext, u as IdentityRecord, v as IdentityReport, w as IntakeContext, x as IntakeResult, y as IntegrationRow, M as MOSS_SEQUENCE, z as MossServer, A as NiscApp, G as PressResult, R as RunRecord, H as RunSink, J as RunTurn, K as SNAPSHOT_ELEMENT_ID, O as ServerMessage, Q as ShellHost, T as ShellManifest, U as ShellNeed, V as ShellOpening, W as ShellReport, X as ShellSession, Y as ShellSnapshot, Z as SocketAccept, _ as SocketContext, $ as SpanClock, a0 as StorePress, a1 as Telemetry, a2 as TelemetrySpan, a3 as buildContract, a4 as callIntegrationWith, a5 as contractAsMarkdown, a6 as copyPress, a7 as createIdentityCache, a8 as createServer, a9 as createShellHost, aa as createSocket, ab as defineApp, ac as describePlacements, ad as devSession, ae as documentHeaders, af as embedSnapshot, ag as emitterOf, ah as exportDocuments, ai as filterInstalled, aj as initIntegrations, ak as integrationByKey, al as integrationOfAction, am as listAttachments, an as listIntegrations, ao as listPlacements, ap as loadIntegrationActions, aq as memoKeyOf, ar as mintDevToken, as as renderDocument, at as resolveCatalog, au as resolveCatalogForRoles, av as resolvePolicy, aw as resolvePolicyAtReach, ax as resolvePolicyForRoles, ay as resolveRoles, az as resolveVariants, aA as resolveVariantsForRoles, aB as runIntake, aC as shellNeedOf, aD as spanClock, aE as tokenFromCookie, aF as verifyVariants, aG as wearableOf, aH as wireFabric } from './document-Jhfii6kd.cjs';
|
|
3
3
|
import { Sequence } from '@niscorp/strata';
|
|
4
4
|
import { PgPool, QueryEngine, DatabaseSchema, SeedEntry, SeedMutation, WriteEvent } from '@niscorp/vex';
|
|
5
5
|
import { TideStore, Tide, Fact, Retention } from '@niscorp/tide';
|
|
6
6
|
import { ActionDefinition } from '@niscorp/nova';
|
|
7
7
|
import { ClosureAuditor } from '@niscorp/charter';
|
|
8
|
+
import '@niscorp/nova/document';
|
|
8
9
|
import 'zod';
|
|
9
10
|
import '@niscorp/nova/i18n';
|
|
10
11
|
import 'hono';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { N as NiscRuntime, S as SessionVerifier, L as LayoutVariant, P as PageManifest } from './document-
|
|
2
|
-
export { B as Bundle, C as CLOSE_INVALID_TOKEN, a as CLOSE_SHELL_FAILED, b as CLOSE_SIGNED_OUT, c as CallIntegration, d as Catalog, e as ClientMessage, f as Connection, g as Contract, D as DEFAULT_IDENTITY_IDLE_MS, h as DEFAULT_IDENTITY_MAX, i as DEFAULT_IDLE_MS, j as DEFAULT_REVALIDATE_MS, k as DocumentConfig, l as DrawnDocument, E as Emit, m as ExecuteAs, n as ExportedDocument, F as Fabric, o as FabricApply, p as FabricMessage, q as FabricSignal, r as FactIntake, s as FunctionSession, I as IdentityCache, t as IdentityCacheContext, u as IdentityRecord, v as IdentityReport, w as IntakeContext, x as IntakeResult, y as IntegrationRow, M as MOSS_SEQUENCE, z as MossServer, A as NiscApp, G as PressResult, R as RunRecord, H as RunSink, J as RunTurn, K as SNAPSHOT_ELEMENT_ID, O as ServerMessage, Q as ShellHost, T as ShellManifest, U as ShellNeed, V as ShellOpening, W as ShellReport, X as ShellSession, Y as ShellSnapshot, Z as SocketAccept, _ as SocketContext, $ as SpanClock, a0 as StorePress, a1 as Telemetry, a2 as TelemetrySpan, a3 as buildContract, a4 as callIntegrationWith, a5 as contractAsMarkdown, a6 as copyPress, a7 as createIdentityCache, a8 as createServer, a9 as createShellHost, aa as createSocket, ab as defineApp, ac as describePlacements, ad as devSession, ae as documentHeaders, af as embedSnapshot, ag as emitterOf, ah as exportDocuments, ai as filterInstalled, aj as initIntegrations, ak as integrationByKey, al as integrationOfAction, am as listAttachments, an as listIntegrations, ao as listPlacements, ap as loadIntegrationActions, aq as memoKeyOf, ar as mintDevToken, as as renderDocument, at as resolveCatalog, au as resolveCatalogForRoles, av as resolvePolicy, aw as resolvePolicyAtReach, ax as resolvePolicyForRoles, ay as resolveRoles, az as resolveVariants, aA as resolveVariantsForRoles, aB as runIntake, aC as shellNeedOf, aD as spanClock, aE as tokenFromCookie, aF as verifyVariants, aG as wearableOf, aH as wireFabric } from './document-
|
|
1
|
+
import { N as NiscRuntime, S as SessionVerifier, L as LayoutVariant, P as PageManifest } from './document-Jhfii6kd.js';
|
|
2
|
+
export { B as Bundle, C as CLOSE_INVALID_TOKEN, a as CLOSE_SHELL_FAILED, b as CLOSE_SIGNED_OUT, c as CallIntegration, d as Catalog, e as ClientMessage, f as Connection, g as Contract, D as DEFAULT_IDENTITY_IDLE_MS, h as DEFAULT_IDENTITY_MAX, i as DEFAULT_IDLE_MS, j as DEFAULT_REVALIDATE_MS, k as DocumentConfig, l as DrawnDocument, E as Emit, m as ExecuteAs, n as ExportedDocument, F as Fabric, o as FabricApply, p as FabricMessage, q as FabricSignal, r as FactIntake, s as FunctionSession, I as IdentityCache, t as IdentityCacheContext, u as IdentityRecord, v as IdentityReport, w as IntakeContext, x as IntakeResult, y as IntegrationRow, M as MOSS_SEQUENCE, z as MossServer, A as NiscApp, G as PressResult, R as RunRecord, H as RunSink, J as RunTurn, K as SNAPSHOT_ELEMENT_ID, O as ServerMessage, Q as ShellHost, T as ShellManifest, U as ShellNeed, V as ShellOpening, W as ShellReport, X as ShellSession, Y as ShellSnapshot, Z as SocketAccept, _ as SocketContext, $ as SpanClock, a0 as StorePress, a1 as Telemetry, a2 as TelemetrySpan, a3 as buildContract, a4 as callIntegrationWith, a5 as contractAsMarkdown, a6 as copyPress, a7 as createIdentityCache, a8 as createServer, a9 as createShellHost, aa as createSocket, ab as defineApp, ac as describePlacements, ad as devSession, ae as documentHeaders, af as embedSnapshot, ag as emitterOf, ah as exportDocuments, ai as filterInstalled, aj as initIntegrations, ak as integrationByKey, al as integrationOfAction, am as listAttachments, an as listIntegrations, ao as listPlacements, ap as loadIntegrationActions, aq as memoKeyOf, ar as mintDevToken, as as renderDocument, at as resolveCatalog, au as resolveCatalogForRoles, av as resolvePolicy, aw as resolvePolicyAtReach, ax as resolvePolicyForRoles, ay as resolveRoles, az as resolveVariants, aA as resolveVariantsForRoles, aB as runIntake, aC as shellNeedOf, aD as spanClock, aE as tokenFromCookie, aF as verifyVariants, aG as wearableOf, aH as wireFabric } from './document-Jhfii6kd.js';
|
|
3
3
|
import { Sequence } from '@niscorp/strata';
|
|
4
4
|
import { PgPool, QueryEngine, DatabaseSchema, SeedEntry, SeedMutation, WriteEvent } from '@niscorp/vex';
|
|
5
5
|
import { TideStore, Tide, Fact, Retention } from '@niscorp/tide';
|
|
6
6
|
import { ActionDefinition } from '@niscorp/nova';
|
|
7
7
|
import { ClosureAuditor } from '@niscorp/charter';
|
|
8
|
+
import '@niscorp/nova/document';
|
|
8
9
|
import 'zod';
|
|
9
10
|
import '@niscorp/nova/i18n';
|
|
10
11
|
import 'hono';
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
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 } from './chunk-
|
|
1
|
+
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 } from './chunk-3CJCJKKY.js';
|
|
2
2
|
export { CLOSE_INVALID_TOKEN, CLOSE_SHELL_FAILED, CLOSE_SIGNED_OUT, DEFAULT_REVALIDATE_MS, createSocket, emitterOf, spanClock } from './chunk-ZOEUEMDX.js';
|
|
3
3
|
|
|
4
4
|
// src/app.ts
|
package/dist/node.cjs
CHANGED
|
@@ -21,6 +21,7 @@ var zod = require('zod');
|
|
|
21
21
|
var reflect = require('@niscorp/nova/reflect');
|
|
22
22
|
var i18n = require('@niscorp/nova/i18n');
|
|
23
23
|
var prism = require('@niscorp/prism');
|
|
24
|
+
var document = require('@niscorp/nova/document');
|
|
24
25
|
|
|
25
26
|
// src/node.ts
|
|
26
27
|
|
|
@@ -3182,8 +3183,6 @@ ${nextVariantErrors.map((e) => ` ${e}`).join("\n")}`);
|
|
|
3182
3183
|
...identities !== void 0 ? { identities: { list: identities.list, meter: identities.meter } } : {}
|
|
3183
3184
|
});
|
|
3184
3185
|
};
|
|
3185
|
-
|
|
3186
|
-
// src/document.ts
|
|
3187
3186
|
var SNAPSHOT_ELEMENT_ID = "nisc-snapshot";
|
|
3188
3187
|
var DEFAULT_TOKEN_KEY = "nisc.token";
|
|
3189
3188
|
var DEFAULT_ROOT = '<div id="root"></div>';
|
|
@@ -3227,9 +3226,13 @@ var renderDocument = async (config) => {
|
|
|
3227
3226
|
});
|
|
3228
3227
|
const screen = await draw(snapshot);
|
|
3229
3228
|
const attributes = Object.entries(config.htmlAttributes?.(snapshot) ?? {}).map(([name, value]) => ` ${name}="${escapeAttribute(value)}"`).join("");
|
|
3230
|
-
const
|
|
3229
|
+
const placed = template.replace(root, () => `${root.replace("></div>", () => `>${screen}</div>`)}${embedSnapshot(snapshot, principal, request.path)}`).replace(/<html([^>]*)>/, (whole, existing) => attributes === "" ? whole : `<html${existing}${attributes}>`);
|
|
3230
|
+
const head = document.headOf({ frame: () => snapshot.frame, canvasTree: (id) => snapshot.trees[id] ?? [] });
|
|
3231
|
+
for (const why of head?.refused ?? []) console.error(`[moss/document] "${request.path}" \u2014 ${why}`);
|
|
3232
|
+
const html = document.placeHead(placed, head?.elements, { ...config.site !== void 0 ? { site: config.site } : {}, path: request.path });
|
|
3231
3233
|
return {
|
|
3232
3234
|
html,
|
|
3235
|
+
...head !== void 0 ? { head } : {},
|
|
3233
3236
|
headers: {
|
|
3234
3237
|
...documentHeaders(principal),
|
|
3235
3238
|
...token !== null && principal === null ? { "set-cookie": `${encodeURIComponent(tokenKey)}=; Path=/; Max-Age=0; SameSite=Lax` } : {}
|