@odla-ai/chapter 0.47.9 → 0.48.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.
@@ -85,6 +85,8 @@ interface ChapterSignupControl {
85
85
  sourceId: string;
86
86
  /** Follower-vault key holding the dedicated edge secret. */
87
87
  secretName?: string;
88
+ /** Optional per-runtime vault keys. When present, unlisted runtimes and legacy untargeted deliveries fail closed. */
89
+ runtimeSecrets?: Readonly<Record<string, string>>;
88
90
  /** Stripe mode this deployed environment accepts. */
89
91
  stripeMode: "test" | "live";
90
92
  }
@@ -92,6 +94,7 @@ interface ChapterSignupControl {
92
94
  interface ResolvedSignupControl {
93
95
  sourceId: string;
94
96
  secretName: string;
97
+ runtimeSecrets?: Readonly<Record<string, string>>;
95
98
  stripeMode: "test" | "live";
96
99
  }
97
100
 
@@ -267,6 +270,9 @@ interface ChapterNetworkReader {
267
270
  * receive pushed records. It must explicitly declare `readers` before any peer
268
271
  * can browse its CRM. */
269
272
  interface ChapterNetwork {
273
+ /** Require the protected super-admin tier for remote mutations and operational
274
+ * detail. Ordinary admins retain routine name/email directory reads. */
275
+ requireSuperAdminWrites?: boolean;
270
276
  targets?: readonly ChapterNetworkTarget[];
271
277
  readers?: readonly ChapterNetworkReader[];
272
278
  }
@@ -321,6 +327,7 @@ interface ResolvedNetworkReader {
321
327
  }
322
328
  /** Fully-resolved leader network configuration. */
323
329
  interface ResolvedNetwork {
330
+ requireSuperAdminWrites?: boolean;
324
331
  targets: readonly ResolvedNetworkTarget[];
325
332
  readers: readonly ResolvedNetworkReader[];
326
333
  }
@@ -458,7 +465,9 @@ interface ChapterScheduling {
458
465
  }
459
466
  /** How a signed-in user's role is determined.
460
467
  *
461
- * - `"claim"` reads a role ladder from a JWT claim (the member-site model:
468
+ * - `"clerk"` reads backend-only private Clerk roles for each authorization
469
+ * check, without trusting public metadata or stale session roles.
470
+ * - `"claim"` reads a role ladder from a JWT claim (the legacy member-site model:
462
471
  * `provisional → member → admin`). Admin is the last (highest) rung; the
463
472
  * Studio-managed super-admin tier sits above it.
464
473
  * - `"table"` gates on the deny-all `admins` allowlist (the hub model):
@@ -466,23 +475,25 @@ interface ChapterScheduling {
466
475
  *
467
476
  * Defaults: `"claim"` in `chapter` mode, `"table"` in `hub` mode. */
468
477
  interface ChapterAuth {
469
- source?: "claim" | "table";
478
+ /** `clerk` reads backend-only private_metadata.role on each request, ignoring
479
+ * JWT/public roles. Select explicitly after the coordinated role migration. */
480
+ source?: "claim" | "table" | "clerk";
470
481
  /** JWT claim holding the role, for `source: "claim"`. Default `"role"`. */
471
482
  claim?: string;
472
- /** Role ladder low→high, for `source: "claim"`. The last entry is admin.
483
+ /** Role ladder low→high, for claim or private Clerk roles. The last entry is admin.
473
484
  * Default `["provisional", "member", "admin"]`. */
474
485
  ladder?: readonly string[];
475
486
  /** Enable the Studio-managed super-admin tier — the only tier that may
476
- * create/modify admins. Default: `true` for `"claim"`, `false` for `"table"`. */
487
+ * create/modify admins. Default: `true` for `"claim"`/`"clerk"`, `false` for `"table"`. */
477
488
  superAdmins?: boolean;
478
489
  /** Authority behind the super-admin tier. `"table"` preserves the legacy
479
- * app allowlist; `"odla"` reads protected `$users.role`. Default `"table"`
480
- * for backward compatibility. */
490
+ * app allowlist; `"odla"` reads protected `$users.role` by exact subject ID.
491
+ * Default `"odla"` for private Clerk mode, `"table"` for legacy modes. */
481
492
  superAdminSource?: "table" | "odla";
482
493
  }
483
494
  /** The fully-resolved auth policy (defaults applied) carried on the {@link Chapter}. */
484
495
  interface ResolvedAuth {
485
- source: "claim" | "table";
496
+ source: "claim" | "table" | "clerk";
486
497
  claim: string;
487
498
  ladder: readonly string[];
488
499
  /** The highest ladder rung (last entry) — the "admin" gate. */