@niscorp/moss 0.3.0 → 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.
@@ -5,7 +5,7 @@ import { PgPool, MutationClient, CacheBackend, ScopePolicy, ScopeBehaviors, Seed
5
5
  import * as _niscorp_tide from '@niscorp/tide';
6
6
  import { Upgrader, Sequence } from '@niscorp/strata';
7
7
  import { z } from 'zod';
8
- import { Charter } from '@niscorp/charter';
8
+ import { Charter, VerifyReport } from '@niscorp/charter';
9
9
  import { Phrasebook, PhraseKeys } from '@niscorp/nova/i18n';
10
10
  import { Context, Next, Hono } from 'hono';
11
11
 
@@ -934,6 +934,7 @@ type MossServer = Hono<Env> & {
934
934
  path: string;
935
935
  }[];
936
936
  refresh: () => void;
937
+ charterReport: () => VerifyReport;
937
938
  invalidateIdentity: (principal: string) => boolean;
938
939
  identity: (principal: string | null) => Promise<IdentityRecord>;
939
940
  executeAs: ExecuteAs;
@@ -5,7 +5,7 @@ import { PgPool, MutationClient, CacheBackend, ScopePolicy, ScopeBehaviors, Seed
5
5
  import * as _niscorp_tide from '@niscorp/tide';
6
6
  import { Upgrader, Sequence } from '@niscorp/strata';
7
7
  import { z } from 'zod';
8
- import { Charter } from '@niscorp/charter';
8
+ import { Charter, VerifyReport } from '@niscorp/charter';
9
9
  import { Phrasebook, PhraseKeys } from '@niscorp/nova/i18n';
10
10
  import { Context, Next, Hono } from 'hono';
11
11
 
@@ -934,6 +934,7 @@ type MossServer = Hono<Env> & {
934
934
  path: string;
935
935
  }[];
936
936
  refresh: () => void;
937
+ charterReport: () => VerifyReport;
937
938
  invalidateIdentity: (principal: string) => boolean;
938
939
  identity: (principal: string | null) => Promise<IdentityRecord>;
939
940
  executeAs: ExecuteAs;
package/dist/index.cjs CHANGED
@@ -569,7 +569,7 @@ var createTideStore = (pool, options = {}) => {
569
569
  await ready;
570
570
  if (client.transaction === void 0)
571
571
  throw new Error("tide store: this pool cannot transact \u2014 fan-out and attempt recording are transactions, not conventions");
572
- return client.transaction((tx) => fn(build({ ...client, query: tx.query })));
572
+ return client.transaction((tx) => fn(build({ ...client, query: (text, values) => tx.query(text, values) })));
573
573
  }
574
574
  };
575
575
  return store;
@@ -2677,6 +2677,7 @@ var createServer = async (app, runtime) => {
2677
2677
  throw new Error(`Charter is incoherent \u2014 refusing to serve:
2678
2678
  ${report.errors.map((e) => ` ${e.rule}: ${e.detail}`).join("\n")}`);
2679
2679
  }
2680
+ let verifiedReport = report;
2680
2681
  for (const cycle of reflect.chainCycles(app.actions)) {
2681
2682
  console.error(`[moss] a chain of steps that never ends: ${cycle.path} \u2014 nova stops it at its budget when it runs (RUNAWAY_CHAIN)`);
2682
2683
  }
@@ -3397,6 +3398,7 @@ ${nextReport.errors.map((e) => ` ${e.rule}: ${e.detail}`).join("\n")}`);
3397
3398
  throw new Error(`Refresh refused \u2014 layout variants incoherent:
3398
3399
  ${nextVariantErrors.map((e) => ` ${e}`).join("\n")}`);
3399
3400
  }
3401
+ verifiedReport = nextReport;
3400
3402
  identities?.invalidateAll();
3401
3403
  policies.clear();
3402
3404
  reachPolicies.clear();
@@ -3434,6 +3436,7 @@ ${nextVariantErrors.map((e) => ` ${e}`).join("\n")}`);
3434
3436
  pages: Object.entries(pageManifests).map(([name, manifest]) => ({ name, path: manifest.path })),
3435
3437
  ...shells !== void 0 ? { shells } : {},
3436
3438
  refresh,
3439
+ charterReport: () => verifiedReport,
3437
3440
  generation: () => generation?.current() ?? -1,
3438
3441
  // Every timer this server owns, stopped once. Absent pieces (an app with no
3439
3442
  // identity seam, no shells) simply have nothing to stop — the `?.` is the