@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/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
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';
1
+ import { N as NiscRuntime, S as SessionVerifier, L as LayoutVariant, P as PageManifest } from './document-D9khv9jI.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-D9khv9jI.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';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
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';
1
+ import { N as NiscRuntime, S as SessionVerifier, L as LayoutVariant, P as PageManifest } from './document-D9khv9jI.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-D9khv9jI.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';
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-D6E4SV6F.js';
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-ZP3C53AC.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
@@ -2392,6 +2392,7 @@ var createServer = async (app, runtime) => {
2392
2392
  throw new Error(`Charter is incoherent \u2014 refusing to serve:
2393
2393
  ${report.errors.map((e) => ` ${e.rule}: ${e.detail}`).join("\n")}`);
2394
2394
  }
2395
+ let verifiedReport = report;
2395
2396
  for (const cycle of reflect.chainCycles(app.actions)) {
2396
2397
  console.error(`[moss] a chain of steps that never ends: ${cycle.path} \u2014 nova stops it at its budget when it runs (RUNAWAY_CHAIN)`);
2397
2398
  }
@@ -3112,6 +3113,7 @@ ${nextReport.errors.map((e) => ` ${e.rule}: ${e.detail}`).join("\n")}`);
3112
3113
  throw new Error(`Refresh refused \u2014 layout variants incoherent:
3113
3114
  ${nextVariantErrors.map((e) => ` ${e}`).join("\n")}`);
3114
3115
  }
3116
+ verifiedReport = nextReport;
3115
3117
  identities?.invalidateAll();
3116
3118
  policies.clear();
3117
3119
  reachPolicies.clear();
@@ -3149,6 +3151,7 @@ ${nextVariantErrors.map((e) => ` ${e}`).join("\n")}`);
3149
3151
  pages: Object.entries(pageManifests).map(([name, manifest]) => ({ name, path: manifest.path })),
3150
3152
  ...shells !== void 0 ? { shells } : {},
3151
3153
  refresh,
3154
+ charterReport: () => verifiedReport,
3152
3155
  generation: () => generation?.current() ?? -1,
3153
3156
  // Every timer this server owns, stopped once. Absent pieces (an app with no
3154
3157
  // identity seam, no shells) simply have nothing to stop — the `?.` is the
@@ -3228,7 +3231,8 @@ var renderDocument = async (config) => {
3228
3231
  const attributes = Object.entries(config.htmlAttributes?.(snapshot) ?? {}).map(([name, value]) => ` ${name}="${escapeAttribute(value)}"`).join("");
3229
3232
  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
3233
  const head = document.headOf({ frame: () => snapshot.frame, canvasTree: (id) => snapshot.trees[id] ?? [] });
3231
- const html = document.placeHead(placed, head?.head, { ...config.site !== void 0 ? { site: config.site } : {}, path: request.path });
3234
+ for (const why of head?.refused ?? []) console.error(`[moss/document] "${request.path}" \u2014 ${why}`);
3235
+ const html = document.placeHead(placed, head?.elements, { ...config.site !== void 0 ? { site: config.site } : {}, path: request.path });
3232
3236
  return {
3233
3237
  html,
3234
3238
  ...head !== void 0 ? { head } : {},