@odla-ai/chapter 0.26.0 → 0.27.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.
@@ -36,7 +36,7 @@ interface ChapterCopy {
36
36
  admin: {
37
37
  auth: TextFields<"checking" | "notAuthorized" | "accountNotAuthorized" | "thisAccount" | "signOut" | "loading" | "signInNotConfigured" | "missingPublishableKey" | "noWorkspaces" | "signInTagline">;
38
38
  shell: TextFields<"adminRole" | "adminConsole" | "adminName" | "navigationLabel">;
39
- workspaces: TextFields<"dashboard" | "overview" | "billing" | "people" | "portfolio" | "settings" | "calendar" | "email" | "chapters" | "formations" | "dealFlow" | "dashboardViewsLabel" | "settingsViewsLabel" | "collectionsLabel" | "portfolioViewsLabel">;
39
+ workspaces: TextFields<"dashboard" | "overview" | "billing" | "people" | "network" | "portfolio" | "settings" | "calendar" | "email" | "chapters" | "formations" | "dealFlow" | "dashboardViewsLabel" | "settingsViewsLabel" | "collectionsLabel" | "portfolioViewsLabel">;
40
40
  dashboard: TextFields<"loading" | "loadFailed" | "upcomingCalls" | "callsNeedAttention" | "noUpcomingCalls" | "drift" | "open" | "meet" | "applications" | "newMembers" | "newMembersUnavailable" | "revenueAdded" | "revenue" | "revenueUnavailable" | "pipeline" | "pipelineLabel" | "thisWeek" | "noChange" | "activeMemberships" | "annualRunRate" | "testMode">;
41
41
  billing: TextFields<"loading" | "loadFailed" | "notConfigured" | "active" | "annualized" | "renewingSoon" | "pastDue" | "subscriptions" | "testMode" | "truncated" | "name" | "email" | "application" | "subscription" | "cancelling" | "amount" | "renews">;
42
42
  availability: TextFields<"loading" | "loadFailed" | "saved" | "title" | "days" | "startHour" | "endHour" | "slotMinutes" | "minNoticeHours" | "windowDays" | "timezone" | "summaryTemplate" | "save"> & {
@@ -64,17 +64,41 @@ interface ChapterNetworkTarget {
64
64
  name?: string;
65
65
  /** Absolute follower origin, e.g. `https://chapter.example.com`. */
66
66
  url: string;
67
+ /** Optional Cloudflare service-binding name for Worker-to-Worker delivery.
68
+ * The URL still defines the signed request origin; the binding only supplies
69
+ * the transport when a `workers.dev` subrequest cannot enter another Worker. */
70
+ binding?: string;
67
71
  /** Leader-vault key holding this follower's share secret. Defaults to
68
72
  * `network_share_<id-with-underscores>`. */
69
73
  secretName?: string;
70
74
  /** Per-record-type field allowlist. If present, omitted types cannot be sent
71
75
  * to this target. Without it, package-safe person/company defaults apply. */
72
76
  fields?: Record<string, readonly string[]>;
73
- }
74
- /** Leader/follower network configuration. Followers need no code config to
75
- * receive records; they only vault `network_share_secret`. */
77
+ /** Record types on which leader admins may deliberately share notes with
78
+ * this follower. Omitted by default: a target never gains write permission
79
+ * merely because its records are browsable. */
80
+ sharedNotes?: readonly string[];
81
+ }
82
+ /** One signed peer allowed to browse a privacy-bounded projection of this
83
+ * site's CRM. The follower owns this allowlist; a leader target declaration
84
+ * cannot widen it. */
85
+ interface ChapterNetworkReader {
86
+ /** Stable app/site slug expected in the signed federation envelope. */
87
+ id: string;
88
+ /** Per-record-type field allowlist. Omitted types and fields never leave
89
+ * this site. Record id, name, stage, and timestamps are bounded metadata. */
90
+ fields: Record<string, readonly string[]>;
91
+ /** Record types on which this reader may append an explicitly shared note.
92
+ * Omitted by default: browse permission never silently grants write access.
93
+ * Shared notes land in the follower CRM activity feed. */
94
+ sharedNotes?: readonly string[];
95
+ }
96
+ /** Leader/follower network configuration. A follower needs no code config to
97
+ * receive pushed records. It must explicitly declare `readers` before any peer
98
+ * can browse its CRM. */
76
99
  interface ChapterNetwork {
77
100
  targets?: readonly ChapterNetworkTarget[];
101
+ readers?: readonly ChapterNetworkReader[];
78
102
  }
79
103
  /** Public chapter-formation intake backed by one CRM record type. The host owns
80
104
  * the branded form; Chapter owns the bounded, idempotent write contract. */
@@ -106,12 +130,21 @@ interface ResolvedNetworkTarget {
106
130
  id: string;
107
131
  name: string;
108
132
  url: string;
133
+ binding?: string;
109
134
  secretName: string;
110
135
  fields?: Record<string, readonly string[]>;
136
+ sharedNotes: readonly string[];
137
+ }
138
+ /** A validated follower-owned record projection for one signed reader. */
139
+ interface ResolvedNetworkReader {
140
+ id: string;
141
+ fields: Record<string, readonly string[]>;
142
+ sharedNotes: readonly string[];
111
143
  }
112
144
  /** Fully-resolved leader network configuration. */
113
145
  interface ResolvedNetwork {
114
146
  targets: readonly ResolvedNetworkTarget[];
147
+ readers: readonly ResolvedNetworkReader[];
115
148
  }
116
149
 
117
150
  /** Which feature profile a site runs. `chapter` is the full public member site
@@ -372,8 +405,8 @@ interface ChapterConfig {
372
405
  /** User-visible language for packaged Chapter surfaces. Recursively partial;
373
406
  * `defineChapter()` resolves every omitted leaf from the package defaults. */
374
407
  copy?: ChapterCopyInput;
375
- /** Leader follower delivery targets. Secret values stay in the leader
376
- * tenant vault; see {@link ChapterNetworkTarget}. */
408
+ /** Signed network edges: leader delivery targets and follower-owned,
409
+ * privacy-bounded record readers. Secret values stay in tenant vaults. */
377
410
  network?: ChapterNetwork;
378
411
  /** Enable a public, host-rendered formation application workflow. */
379
412
  formation?: LeaderFormationConfig;
@@ -582,7 +615,7 @@ type Route = (req: Request, url: URL, env: ChapterEnv, ctx: WorkerContext) => Pr
582
615
  * Build the Cloudflare `ExportedHandler` for a chapter/hub site: Clerk-JWT
583
616
  * verification, the source-aware admin gate, the mounted @odla-ai/crm routes, the
584
617
  * hub→chapter network projection, and the static-asset fallback. Hub mode serves
585
- * /api/health, /api/config, /api/me, /api/crm/*, /api/network/shared; chapter mode
618
+ * /api/health, /api/config, /api/me, /api/crm/*, /api/network/*; chapter mode
586
619
  * adds the public member surface (join/apply/pay/book) and the admin surface
587
620
  * (/api/admin/*).
588
621
  *
@@ -36,7 +36,7 @@ interface ChapterCopy {
36
36
  admin: {
37
37
  auth: TextFields<"checking" | "notAuthorized" | "accountNotAuthorized" | "thisAccount" | "signOut" | "loading" | "signInNotConfigured" | "missingPublishableKey" | "noWorkspaces" | "signInTagline">;
38
38
  shell: TextFields<"adminRole" | "adminConsole" | "adminName" | "navigationLabel">;
39
- workspaces: TextFields<"dashboard" | "overview" | "billing" | "people" | "portfolio" | "settings" | "calendar" | "email" | "chapters" | "formations" | "dealFlow" | "dashboardViewsLabel" | "settingsViewsLabel" | "collectionsLabel" | "portfolioViewsLabel">;
39
+ workspaces: TextFields<"dashboard" | "overview" | "billing" | "people" | "network" | "portfolio" | "settings" | "calendar" | "email" | "chapters" | "formations" | "dealFlow" | "dashboardViewsLabel" | "settingsViewsLabel" | "collectionsLabel" | "portfolioViewsLabel">;
40
40
  dashboard: TextFields<"loading" | "loadFailed" | "upcomingCalls" | "callsNeedAttention" | "noUpcomingCalls" | "drift" | "open" | "meet" | "applications" | "newMembers" | "newMembersUnavailable" | "revenueAdded" | "revenue" | "revenueUnavailable" | "pipeline" | "pipelineLabel" | "thisWeek" | "noChange" | "activeMemberships" | "annualRunRate" | "testMode">;
41
41
  billing: TextFields<"loading" | "loadFailed" | "notConfigured" | "active" | "annualized" | "renewingSoon" | "pastDue" | "subscriptions" | "testMode" | "truncated" | "name" | "email" | "application" | "subscription" | "cancelling" | "amount" | "renews">;
42
42
  availability: TextFields<"loading" | "loadFailed" | "saved" | "title" | "days" | "startHour" | "endHour" | "slotMinutes" | "minNoticeHours" | "windowDays" | "timezone" | "summaryTemplate" | "save"> & {
@@ -64,17 +64,41 @@ interface ChapterNetworkTarget {
64
64
  name?: string;
65
65
  /** Absolute follower origin, e.g. `https://chapter.example.com`. */
66
66
  url: string;
67
+ /** Optional Cloudflare service-binding name for Worker-to-Worker delivery.
68
+ * The URL still defines the signed request origin; the binding only supplies
69
+ * the transport when a `workers.dev` subrequest cannot enter another Worker. */
70
+ binding?: string;
67
71
  /** Leader-vault key holding this follower's share secret. Defaults to
68
72
  * `network_share_<id-with-underscores>`. */
69
73
  secretName?: string;
70
74
  /** Per-record-type field allowlist. If present, omitted types cannot be sent
71
75
  * to this target. Without it, package-safe person/company defaults apply. */
72
76
  fields?: Record<string, readonly string[]>;
73
- }
74
- /** Leader/follower network configuration. Followers need no code config to
75
- * receive records; they only vault `network_share_secret`. */
77
+ /** Record types on which leader admins may deliberately share notes with
78
+ * this follower. Omitted by default: a target never gains write permission
79
+ * merely because its records are browsable. */
80
+ sharedNotes?: readonly string[];
81
+ }
82
+ /** One signed peer allowed to browse a privacy-bounded projection of this
83
+ * site's CRM. The follower owns this allowlist; a leader target declaration
84
+ * cannot widen it. */
85
+ interface ChapterNetworkReader {
86
+ /** Stable app/site slug expected in the signed federation envelope. */
87
+ id: string;
88
+ /** Per-record-type field allowlist. Omitted types and fields never leave
89
+ * this site. Record id, name, stage, and timestamps are bounded metadata. */
90
+ fields: Record<string, readonly string[]>;
91
+ /** Record types on which this reader may append an explicitly shared note.
92
+ * Omitted by default: browse permission never silently grants write access.
93
+ * Shared notes land in the follower CRM activity feed. */
94
+ sharedNotes?: readonly string[];
95
+ }
96
+ /** Leader/follower network configuration. A follower needs no code config to
97
+ * receive pushed records. It must explicitly declare `readers` before any peer
98
+ * can browse its CRM. */
76
99
  interface ChapterNetwork {
77
100
  targets?: readonly ChapterNetworkTarget[];
101
+ readers?: readonly ChapterNetworkReader[];
78
102
  }
79
103
  /** Public chapter-formation intake backed by one CRM record type. The host owns
80
104
  * the branded form; Chapter owns the bounded, idempotent write contract. */
@@ -106,12 +130,21 @@ interface ResolvedNetworkTarget {
106
130
  id: string;
107
131
  name: string;
108
132
  url: string;
133
+ binding?: string;
109
134
  secretName: string;
110
135
  fields?: Record<string, readonly string[]>;
136
+ sharedNotes: readonly string[];
137
+ }
138
+ /** A validated follower-owned record projection for one signed reader. */
139
+ interface ResolvedNetworkReader {
140
+ id: string;
141
+ fields: Record<string, readonly string[]>;
142
+ sharedNotes: readonly string[];
111
143
  }
112
144
  /** Fully-resolved leader network configuration. */
113
145
  interface ResolvedNetwork {
114
146
  targets: readonly ResolvedNetworkTarget[];
147
+ readers: readonly ResolvedNetworkReader[];
115
148
  }
116
149
 
117
150
  /** Which feature profile a site runs. `chapter` is the full public member site
@@ -372,8 +405,8 @@ interface ChapterConfig {
372
405
  /** User-visible language for packaged Chapter surfaces. Recursively partial;
373
406
  * `defineChapter()` resolves every omitted leaf from the package defaults. */
374
407
  copy?: ChapterCopyInput;
375
- /** Leader follower delivery targets. Secret values stay in the leader
376
- * tenant vault; see {@link ChapterNetworkTarget}. */
408
+ /** Signed network edges: leader delivery targets and follower-owned,
409
+ * privacy-bounded record readers. Secret values stay in tenant vaults. */
377
410
  network?: ChapterNetwork;
378
411
  /** Enable a public, host-rendered formation application workflow. */
379
412
  formation?: LeaderFormationConfig;
@@ -582,7 +615,7 @@ type Route = (req: Request, url: URL, env: ChapterEnv, ctx: WorkerContext) => Pr
582
615
  * Build the Cloudflare `ExportedHandler` for a chapter/hub site: Clerk-JWT
583
616
  * verification, the source-aware admin gate, the mounted @odla-ai/crm routes, the
584
617
  * hub→chapter network projection, and the static-asset fallback. Hub mode serves
585
- * /api/health, /api/config, /api/me, /api/crm/*, /api/network/shared; chapter mode
618
+ * /api/health, /api/config, /api/me, /api/crm/*, /api/network/*; chapter mode
586
619
  * adds the public member surface (join/apply/pay/book) and the admin surface
587
620
  * (/api/admin/*).
588
621
  *