@odla-ai/chapter 0.36.0 → 0.38.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.
@@ -93,6 +93,55 @@ interface ResolvedSignupControl {
93
93
  stripeMode: "test" | "live";
94
94
  }
95
95
 
96
+ /** Optional authenticated member-content surface for a chapter site. */
97
+ interface ChapterMemberContent {
98
+ /** Keep Chapter-admin authoring enabled. Defaults to true. */
99
+ localAuthoring?: boolean;
100
+ /** Optional Parent/Built Not Found authority for signed inherited revisions. */
101
+ parent?: {
102
+ sourceId: string;
103
+ /** Follower-vault key holding the dedicated content edge secret. */
104
+ secretName?: string;
105
+ };
106
+ }
107
+ /** Validated member-content settings carried on a resolved Chapter. */
108
+ interface ResolvedMemberContent {
109
+ enabled: true;
110
+ localAuthoring: boolean;
111
+ parent: {
112
+ sourceId: string;
113
+ secretName: string;
114
+ } | null;
115
+ }
116
+
117
+ /** Scalar kinds accepted by the Chapter schema adapter. */
118
+ type AttrType = "string" | "number" | "boolean" | "json";
119
+ /** One odla-db attribute: its type and index/uniqueness/optionality flags. */
120
+ interface Attr {
121
+ type: AttrType;
122
+ unique: boolean;
123
+ indexed: boolean;
124
+ optional: boolean;
125
+ }
126
+ /** One odla-db namespace: its attribute map. */
127
+ interface Entity {
128
+ attrs: Record<string, Attr>;
129
+ }
130
+ /** A serialized odla-db schema fragment (namespaces + links). */
131
+ interface DbSchema {
132
+ entities: Record<string, Entity>;
133
+ links: Record<string, unknown>;
134
+ }
135
+ /** Per-namespace CEL rule strings (deny-all is `"false"` for each action). */
136
+ interface Rule {
137
+ view: string;
138
+ create: string;
139
+ update: string;
140
+ delete: string;
141
+ }
142
+ /** Namespace → rule set. */
143
+ type DbRules = Record<string, Rule>;
144
+
96
145
  /** One follower site a leader can push CRM records to. The secret VALUE never
97
146
  * lives in config: `secretName` names the leader tenant's vaulted copy of the
98
147
  * follower's `network_share_secret`. */
@@ -214,33 +263,6 @@ interface ChapterPolicy {
214
263
  * (join, Stripe membership, booking, member area, admin, CRM); `hub` is
215
264
  * admin-only and CRM-focused (a directory/registry over the same CRM). */
216
265
  type ChapterMode = "chapter" | "hub";
217
- /** Scalar kinds accepted by the Chapter schema adapter. */
218
- type AttrType = "string" | "number" | "boolean" | "json";
219
- /** One odla-db attribute: its type and index/uniqueness/optionality flags. */
220
- interface Attr {
221
- type: AttrType;
222
- unique: boolean;
223
- indexed: boolean;
224
- optional: boolean;
225
- }
226
- /** One odla-db namespace: its attribute map. */
227
- interface Entity {
228
- attrs: Record<string, Attr>;
229
- }
230
- /** A serialized odla-db schema fragment (namespaces + links). */
231
- interface DbSchema {
232
- entities: Record<string, Entity>;
233
- links: Record<string, unknown>;
234
- }
235
- /** Per-namespace CEL rule strings (deny-all is `"false"` for each action). */
236
- interface Rule {
237
- view: string;
238
- create: string;
239
- update: string;
240
- delete: string;
241
- }
242
- /** Namespace → rule set. */
243
- type DbRules = Record<string, Rule>;
244
266
  /** Typed semantic roles shared by the public site and application surfaces. */
245
267
  interface ChapterBrandTokens {
246
268
  background?: string;
@@ -464,6 +486,8 @@ interface ChapterConfig {
464
486
  network?: ChapterNetwork;
465
487
  /** A separate signed edge that may control this chapter's complete signup. */
466
488
  signupControl?: ChapterSignupControl;
489
+ /** Authenticated parent + chapter member pages with server-enforced tier access. */
490
+ memberContent?: ChapterMemberContent;
467
491
  /** Enable a public, host-rendered formation application workflow. */
468
492
  formation?: LeaderFormationConfig;
469
493
  thesis?: unknown;
@@ -560,6 +584,8 @@ interface Chapter {
560
584
  network: ResolvedNetwork;
561
585
  /** Null unless this follower explicitly delegates signup authority. */
562
586
  signupControl: ResolvedSignupControl | null;
587
+ /** Null unless the standard authenticated member-content surface is enabled. */
588
+ memberContent: ResolvedMemberContent | null;
563
589
  /** Resolved public formation intake contract (disabled when omitted). */
564
590
  formation: ResolvedLeaderFormation;
565
591
  /** Resolved CRM engine (from `defineCrm`). */
@@ -584,6 +610,126 @@ interface Chapter {
584
610
  groupSeed(): Record<string, unknown> | null;
585
611
  }
586
612
 
613
+ /** Versioned contract for authenticated member content. */
614
+ declare const MEMBER_CONTENT_SCHEMA_VERSION: 1;
615
+ /** Authority that authored one independently stored member-content layer. */
616
+ type MemberContentSourceType = "parent" | "chapter";
617
+ /** Stable author identity attached to every member-content document and page. */
618
+ interface MemberContentSource {
619
+ type: MemberContentSourceType;
620
+ appId: string;
621
+ }
622
+ /** Chapter deployment that a parent member-content revision is intended for. */
623
+ interface MemberContentTarget {
624
+ chapterId: string;
625
+ environment: string;
626
+ }
627
+ /** Navigation is data, so agents do not have to coordinate route code. */
628
+ interface MemberPageNavigation {
629
+ section: string;
630
+ order: number;
631
+ parentId?: string;
632
+ }
633
+ /** Explicit sets avoid unsafe assumptions that commercial tiers form a ladder. */
634
+ type MemberPageAudience = {
635
+ kind: "all-members";
636
+ } | {
637
+ kind: "tiers";
638
+ tierIds: readonly string[];
639
+ };
640
+ /** Authored offer copy. Price and provider identity deliberately do not live here. */
641
+ interface MemberPageUpsellOffer {
642
+ tierId: string;
643
+ label?: string;
644
+ bodyMarkdown?: string;
645
+ ctaLabel?: string;
646
+ }
647
+ /** Parent offer authority is explicit; a Chapter can edit only a delegated offer. */
648
+ type MemberPageUpsell = {
649
+ owner: "parent";
650
+ offer: MemberPageUpsellOffer;
651
+ } | {
652
+ owner: "chapter";
653
+ offer?: MemberPageUpsellOffer;
654
+ };
655
+ /** Authored member page whose body is disclosed only after server-side projection. */
656
+ interface MemberContentPage {
657
+ id: string;
658
+ slug: string;
659
+ title: string;
660
+ summary?: string;
661
+ navigation: MemberPageNavigation;
662
+ audience: MemberPageAudience;
663
+ /** Safe Markdown shown while the body is withheld. */
664
+ teaserMarkdown?: string;
665
+ /** Never serialized to a viewer whose audience does not match. */
666
+ bodyMarkdown: string;
667
+ upsell?: MemberPageUpsell;
668
+ }
669
+ /** Chapter-owned offer attached to a Parent page that delegated offer authority. */
670
+ interface MemberPageUpsellOverride {
671
+ pageId: string;
672
+ offer: MemberPageUpsellOffer;
673
+ }
674
+ /** One complete source layer. Parent and Chapter layers are stored independently. */
675
+ interface MemberContentDocument {
676
+ schemaVersion: typeof MEMBER_CONTENT_SCHEMA_VERSION;
677
+ revision: number;
678
+ generatedAt: number;
679
+ source: MemberContentSource;
680
+ target?: MemberContentTarget;
681
+ pages: readonly MemberContentPage[];
682
+ upsellOverrides?: readonly MemberPageUpsellOverride[];
683
+ }
684
+ /** Provider-neutral tier facts used to validate access and resolve safe offers. */
685
+ interface MemberContentTierAuthority {
686
+ id: string;
687
+ name?: string;
688
+ priceCents?: number;
689
+ active?: boolean;
690
+ }
691
+ /** Composed member page retaining the identity of its authoring layer. */
692
+ interface EffectiveMemberContentPage extends MemberContentPage {
693
+ source: MemberContentSource;
694
+ }
695
+ /** Deterministically ordered parent and chapter layers with their source revisions. */
696
+ interface EffectiveMemberContent {
697
+ pages: readonly EffectiveMemberContentPage[];
698
+ parentRevision: number | null;
699
+ chapterRevision: number | null;
700
+ }
701
+ /** Authored upsell joined to active chapter tier name and price authority. */
702
+ interface ResolvedMemberPageUpsell extends MemberPageUpsellOffer {
703
+ tierName: string;
704
+ priceCents: number;
705
+ }
706
+ /** Viewer-safe page result; locked projections never carry bodyMarkdown. */
707
+ interface MemberContentPageProjection {
708
+ id: string;
709
+ slug: string;
710
+ title: string;
711
+ summary?: string;
712
+ navigation: MemberPageNavigation;
713
+ audience: MemberPageAudience;
714
+ source: MemberContentSource;
715
+ access: "allowed" | "locked";
716
+ teaserMarkdown?: string;
717
+ bodyMarkdown?: string;
718
+ upsell?: ResolvedMemberPageUpsell;
719
+ }
720
+ /** Complete viewer-safe member navigation and revision projection. */
721
+ interface MemberContentProjection {
722
+ pages: readonly MemberContentPageProjection[];
723
+ viewer: {
724
+ tierId: string | null;
725
+ admin: boolean;
726
+ };
727
+ revisions: {
728
+ parent: number | null;
729
+ chapter: number | null;
730
+ };
731
+ }
732
+
587
733
  /** Place a resolved or partial copy contract around any Chapter UI surface. */
588
734
  declare function ChapterCopyProvider(props: {
589
735
  copy?: ChapterCopy | ChapterCopyInput;
@@ -592,4 +738,4 @@ declare function ChapterCopyProvider(props: {
592
738
  /** Read the nearest complete Chapter copy contract. */
593
739
  declare function useChapterCopy(): ChapterCopy;
594
740
 
595
- export { ChapterCopyProvider as C, type Chapter as a, type ChapterCopy as b, type ChapterBrand as c, useChapterCopy as u };
741
+ export { ChapterCopyProvider as C, type EffectiveMemberContent as E, type MemberContentDocument as M, type Chapter as a, type ChapterCopy as b, type MemberContentTierAuthority as c, type MemberContentProjection as d, type MemberContentPageProjection as e, type ChapterBrand as f, useChapterCopy as u };