@odla-ai/chapter 0.18.0 → 0.20.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.
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { CrmConfig, Crm } from '@odla-ai/crm';
1
+ import { CrmConfig, Crm, CrmRecord } from '@odla-ai/crm';
2
2
 
3
3
  /** Which feature profile a site runs. `chapter` is the full public member site
4
4
  * (join, Stripe membership, booking, member area, admin, CRM); `hub` is
@@ -56,13 +56,21 @@ type DbRules = Record<string, Rule>;
56
56
  /** Brand tokens that theme the site: palette, fonts, wordmark, nav, logos. */
57
57
  interface ChapterBrand {
58
58
  /** Palette overrides written into styles.css :root (e.g. `{ moss: "#2F3E34" }`
59
- * or `--ui-*` token names). */
59
+ * or `--ui-*` token names). Applies in BOTH light and dark unless overridden
60
+ * by {@link paletteDark}. */
60
61
  palette?: Record<string, string>;
62
+ /** Dark-mode palette overrides. Same shape as {@link palette}; emitted under
63
+ * `:root[data-theme="dark"]` and `@media (prefers-color-scheme: dark)`, so a
64
+ * site brands both modes. */
65
+ paletteDark?: Record<string, string>;
61
66
  fonts?: {
62
67
  display?: string;
63
68
  body?: string;
64
69
  numeral?: string;
65
70
  };
71
+ /** Short glyph used in compact admin chrome. Defaults to the first three
72
+ * letters of the chapter name. */
73
+ badge?: string;
66
74
  wordmark?: string;
67
75
  tagline?: string;
68
76
  /** Header/footer nav sections for the web-component chrome: label → entries. */
@@ -72,6 +80,40 @@ interface ChapterBrand {
72
80
  }>>;
73
81
  logos?: string;
74
82
  }
83
+ /** One follower site a leader can push CRM records to. The secret VALUE never
84
+ * lives in config: `secretName` names the leader tenant's vaulted copy of the
85
+ * follower's `network_share_secret`. */
86
+ interface ChapterNetworkTarget {
87
+ /** Stable lowercase slug used by the UI, audit tags, and default secret name. */
88
+ id: string;
89
+ /** Human-facing site name. Defaults to `id`. */
90
+ name?: string;
91
+ /** Absolute follower origin, e.g. `https://silver.example.com`. */
92
+ url: string;
93
+ /** Leader-vault key holding this follower's share secret. Defaults to
94
+ * `network_share_<id-with-underscores>`. */
95
+ secretName?: string;
96
+ /** Per-record-type field allowlist. If present, omitted types cannot be sent
97
+ * to this target. Without it, package-safe person/company defaults apply. */
98
+ fields?: Record<string, readonly string[]>;
99
+ }
100
+ /** Leader/follower network configuration. Followers need no code config to
101
+ * receive records; they only vault `network_share_secret`. */
102
+ interface ChapterNetwork {
103
+ targets?: readonly ChapterNetworkTarget[];
104
+ }
105
+ /** A validated network target carried on the resolved chapter engine. */
106
+ interface ResolvedNetworkTarget {
107
+ id: string;
108
+ name: string;
109
+ url: string;
110
+ secretName: string;
111
+ fields?: Record<string, readonly string[]>;
112
+ }
113
+ /** Fully-resolved leader network configuration. */
114
+ interface ResolvedNetwork {
115
+ targets: readonly ResolvedNetworkTarget[];
116
+ }
75
117
  /** Membership pricing for the group row (chapter mode). */
76
118
  interface ChapterPrices {
77
119
  standardCents: number;
@@ -227,6 +269,9 @@ interface ChapterConfig {
227
269
  /** A `defineCrm()` config or a resolved `Crm`. Omit for the per-mode default. */
228
270
  crm?: CrmConfig | Crm;
229
271
  brand?: ChapterBrand;
272
+ /** Leader → follower delivery targets. Secret values stay in the leader
273
+ * tenant vault; see {@link ChapterNetworkTarget}. */
274
+ network?: ChapterNetwork;
230
275
  thesis?: unknown;
231
276
  /** Required in `chapter` mode. */
232
277
  prices?: ChapterPrices;
@@ -313,6 +358,11 @@ interface Chapter {
313
358
  name: string;
314
359
  url?: string;
315
360
  mode: ChapterMode;
361
+ /** Resolved site identity. `wordmark` always falls back to `name`, so the
362
+ * admin/member UI never needs a second brand declaration. */
363
+ brand: ChapterBrand;
364
+ /** Validated follower targets for leader-driven record pushes. */
365
+ network: ResolvedNetwork;
316
366
  /** Resolved CRM engine (from `defineCrm`). */
317
367
  crm: Crm;
318
368
  /** Resolved auth policy (source, claim, ladder, super-admin tier). */
@@ -396,9 +446,9 @@ declare function chapterDb(mode: ChapterMode, auth: ResolvedAuth): {
396
446
  rules: DbRules;
397
447
  };
398
448
 
399
- /** The per-mode default CRM config: `chapter` = a person lead pipeline;
400
- * `hub` = people + businesses with a works_at relation. */
401
- declare function defaultCrm(mode: ChapterMode): CrmConfig;
449
+ /** The default shared CRM graph: people (with the application/member pipeline)
450
+ * plus businesses and the `works_at` relation, in both modes. */
451
+ declare function defaultCrm(_mode: ChapterMode): CrmConfig;
402
452
 
403
453
  /** The `groups` row (attrs) for `chapter` mode. Missing config falls back to
404
454
  * empty copy / defaults, so a minimal config still provisions cleanly. */
@@ -778,6 +828,27 @@ interface SharedPerson {
778
828
  linkedin?: string;
779
829
  hubRecordId: string;
780
830
  }
831
+ /** Convenience wire shape for sharing the default `company` CRM type. */
832
+ interface SharedBusiness {
833
+ type: "company";
834
+ name: string;
835
+ domain?: string;
836
+ industry?: string;
837
+ location?: string;
838
+ linkedin?: string;
839
+ notes?: string;
840
+ hubRecordId: string;
841
+ }
842
+ /** Versioned generic wire shape. `input` is validated against the follower's
843
+ * own CRM type before any write, so a leader cannot smuggle undeclared fields. */
844
+ interface SharedRecord {
845
+ version: 1;
846
+ type: string;
847
+ hubRecordId: string;
848
+ input: Record<string, unknown>;
849
+ }
850
+ /** Safe defaults when a target does not declare an explicit field allowlist. */
851
+ declare const DEFAULT_SHARE_FIELDS: Readonly<Record<string, readonly string[]>>;
781
852
  /** Map a shared prospect to a crm `person` input (only the fields the default
782
853
  * person type accepts). Name falls back to first+last, then the email. */
783
854
  declare function sharedPersonInput(person: SharedPerson): Record<string, unknown>;
@@ -789,12 +860,20 @@ interface ProjectionDeps {
789
860
  now: () => number;
790
861
  newId: () => string;
791
862
  }
863
+ /** CRM provenance tag used as the durable leader-id → local-record mapping. */
864
+ declare function networkSourceTag(type: string, hubRecordId: string): string;
865
+ /** Normalize the backwards-compatible person/business shapes into the versioned
866
+ * generic record envelope the receiver writes. */
867
+ declare function normalizeSharedRecord(record: SharedPerson | SharedBusiness | SharedRecord): SharedRecord;
868
+ /** Build the allowlisted payload sent from one leader CRM record to a target.
869
+ * A target with an explicit `fields` map only accepts the types it lists. */
870
+ declare function sharedRecordFromCrm(crm: Crm, record: CrmRecord, target: ResolvedNetworkTarget): SharedRecord;
792
871
  /**
793
- * Upsert a hub-shared prospect into this chapter's `crm_record` (push
794
- * projection), idempotent by the hub record id and unified by email. Callers wrap
795
- * this in `.catch` so a projection failure never fails the hub's share request.
872
+ * Upsert a leader-shared CRM record into this follower. Accepts the original
873
+ * person wire shape plus the versioned generic shape. Re-shares resolve through
874
+ * a durable provenance tag; people/businesses also converge by natural key.
796
875
  */
797
- declare function projectSharedRecord(deps: ProjectionDeps, person: SharedPerson): Promise<{
876
+ declare function projectSharedRecord(deps: ProjectionDeps, shared: SharedPerson | SharedBusiness | SharedRecord): Promise<{
798
877
  recordId: string;
799
878
  }>;
800
879
  /** An arriving applicant, as far as the CRM projection cares. `extra` carries the
@@ -1095,10 +1174,14 @@ declare function memberSession(user: SessionUser, opts: {
1095
1174
  }): MemberSession;
1096
1175
 
1097
1176
  /**
1098
- * Build the `:root { … }` CSS that maps a chapter's brand onto the design tokens
1099
- * the UI reads: each `palette` entry becomes a custom property, and `fonts`
1100
- * (display/body/numeral) map to `--ui-font-display` / `--ui-font-sans` /
1101
- * `--ui-font-numeral`. Returns "" when there is nothing to theme.
1177
+ * Build the CSS that maps a chapter's brand onto the design tokens the UI reads:
1178
+ * each `palette` entry becomes a custom property (light, and dark unless
1179
+ * `paletteDark` overrides), and `fonts` (display/body/numeral) map to
1180
+ * `--ui-font-display` / `--ui-font-sans` / `--ui-font-numeral`. The dark block is
1181
+ * emitted under both `:root[data-theme="dark"]` (the odla-ui theme toggle) and
1182
+ * `@media (prefers-color-scheme: dark)`. Returns "" when there is nothing to
1183
+ * theme. These are brand OVERRIDES on top of a base theme — they do not replace
1184
+ * the theme layer the components need (see {@link brandTokens} usage in the docs).
1102
1185
  */
1103
1186
  declare function brandTokens(brand: ChapterBrand | undefined): string;
1104
1187
 
@@ -1262,4 +1345,4 @@ type ApplicationBookingPatch = {
1262
1345
  * already there (never backward). */
1263
1346
  declare function applicationBookingUpdate(currentStatus: string, startAt: number, htmlLink?: string | null): ApplicationBookingPatch;
1264
1347
 
1265
- export { type AccountModel, type AdminNotificationTrigger, type Applicant, type ApplicationBookingPatch, type ApplicationRecord, type ApplicationSummary, type Attr, type AttrType, type Chapter, type ChapterApplication, type ChapterAuth, type ChapterBrand, type ChapterConfig, type ChapterDb, type ChapterEmails, type ChapterIntegrationDescriptor, type ChapterIntegrationOptions, type ChapterMode, type ChapterOperations, type ChapterPipeline, type ChapterPolicy, type ChapterPrices, type ChapterScheduling, type ChapterSends, type ClerkInviteInput, type ClerkResult, type ClerkUserInput, type ClerkUserRecord, type DbOp, type DbRules, type DbSchema, type DeliveryDecision, type EmailGroup, type EmailTemplate, type EmailTemplateRow, type Entity, type ExistingMeeting, type GuardResult, type IntegrationDescriptor, type IntegrationProvision, type IntegrationSecret, type IntegrationSetting, type IntegrationSync, type JoinConfigGroup, type LiveEvent, type MailSender, type MeetingForReconcile, type MeetingRecord, type MeetingReschedulePatch, type MemberApplication, type MemberSession, type NewMeetingRow, type NotifyDeps, type NotifyInput, type NotifyResult, type PaymentsGroup, type ProjectionDeps, type ReconcileDecision, type ResolvedApplication, type ResolvedAuth, type ResolvedOperations, type ResolvedPipeline, type ResolvedScheduling, type ResolvedSends, type RoleChangeContext, type Rule, SCHEDULING_DEFAULTS, type SchedulingErrors, type SecretMode, type SecretStore, type SessionUser, type SharedPerson, type StripeEvent, type StripeResult, type SubmitResult, type WebhookEvent, applicantProfile, applicationBookingUpdate, applicationSummary, backfillCrm, bookingDecision, brandTokens, bucketSeries, buildGroupSeed, canApprove, canBook, canChangeRole, canTransition, canceledPatch, chapterDb, clampArray, clerkGetUser, clerkGetUserByEmail, clerkIntegration, clerkInviteRequest, clerkListUsers, clerkSetRole, clerkUserRequest, createChapterIntegration, createClerkInvitation, createClerkUser, defaultCrm, defineChapter, emailGroupFrom, endForSlot, findApplicationRef, firstPaymentPatch, getVaultSecret, hasDisclaimerAck, introIdempotencyKey, isAdminRole, isAlreadySent, isReconcilable, isSlotAvailable, isValidEmail, joinConfig, meetingCreateRow, meetingRescheduleUpdate, memberApplication, memberSession, normalizeWebhookEvent, paymentsReady, personInputFromApp, planDelivery, projectApplicant, projectSharedRecord, reconcileMeetings, refundedPatch, render, renderSummary, renderTemplateBody, renewalPatch, resolveApplication, resolveAuth, resolvePipeline, resolveScheduling, roleFromClaim, sendTemplated, sharedPersonInput, slotWindow, stageIndex, stripeCall, stripeForm, subAnnualCents, submitApplication, subscriptionIdempotencyKey, syncApplicationToCrm, validateScheduling, verifyStripeSignature, webhookMutationId };
1348
+ export { type AccountModel, type AdminNotificationTrigger, type Applicant, type ApplicationBookingPatch, type ApplicationRecord, type ApplicationSummary, type Attr, type AttrType, type Chapter, type ChapterApplication, type ChapterAuth, type ChapterBrand, type ChapterConfig, type ChapterDb, type ChapterEmails, type ChapterIntegrationDescriptor, type ChapterIntegrationOptions, type ChapterMode, type ChapterNetwork, type ChapterNetworkTarget, type ChapterOperations, type ChapterPipeline, type ChapterPolicy, type ChapterPrices, type ChapterScheduling, type ChapterSends, type ClerkInviteInput, type ClerkResult, type ClerkUserInput, type ClerkUserRecord, DEFAULT_SHARE_FIELDS, type DbOp, type DbRules, type DbSchema, type DeliveryDecision, type EmailGroup, type EmailTemplate, type EmailTemplateRow, type Entity, type ExistingMeeting, type GuardResult, type IntegrationDescriptor, type IntegrationProvision, type IntegrationSecret, type IntegrationSetting, type IntegrationSync, type JoinConfigGroup, type LiveEvent, type MailSender, type MeetingForReconcile, type MeetingRecord, type MeetingReschedulePatch, type MemberApplication, type MemberSession, type NewMeetingRow, type NotifyDeps, type NotifyInput, type NotifyResult, type PaymentsGroup, type ProjectionDeps, type ReconcileDecision, type ResolvedApplication, type ResolvedAuth, type ResolvedNetwork, type ResolvedNetworkTarget, type ResolvedOperations, type ResolvedPipeline, type ResolvedScheduling, type ResolvedSends, type RoleChangeContext, type Rule, SCHEDULING_DEFAULTS, type SchedulingErrors, type SecretMode, type SecretStore, type SessionUser, type SharedBusiness, type SharedPerson, type SharedRecord, type StripeEvent, type StripeResult, type SubmitResult, type WebhookEvent, applicantProfile, applicationBookingUpdate, applicationSummary, backfillCrm, bookingDecision, brandTokens, bucketSeries, buildGroupSeed, canApprove, canBook, canChangeRole, canTransition, canceledPatch, chapterDb, clampArray, clerkGetUser, clerkGetUserByEmail, clerkIntegration, clerkInviteRequest, clerkListUsers, clerkSetRole, clerkUserRequest, createChapterIntegration, createClerkInvitation, createClerkUser, defaultCrm, defineChapter, emailGroupFrom, endForSlot, findApplicationRef, firstPaymentPatch, getVaultSecret, hasDisclaimerAck, introIdempotencyKey, isAdminRole, isAlreadySent, isReconcilable, isSlotAvailable, isValidEmail, joinConfig, meetingCreateRow, meetingRescheduleUpdate, memberApplication, memberSession, networkSourceTag, normalizeSharedRecord, normalizeWebhookEvent, paymentsReady, personInputFromApp, planDelivery, projectApplicant, projectSharedRecord, reconcileMeetings, refundedPatch, render, renderSummary, renderTemplateBody, renewalPatch, resolveApplication, resolveAuth, resolvePipeline, resolveScheduling, roleFromClaim, sendTemplated, sharedPersonInput, sharedRecordFromCrm, slotWindow, stageIndex, stripeCall, stripeForm, subAnnualCents, submitApplication, subscriptionIdempotencyKey, syncApplicationToCrm, validateScheduling, verifyStripeSignature, webhookMutationId };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { CrmConfig, Crm } from '@odla-ai/crm';
1
+ import { CrmConfig, Crm, CrmRecord } from '@odla-ai/crm';
2
2
 
3
3
  /** Which feature profile a site runs. `chapter` is the full public member site
4
4
  * (join, Stripe membership, booking, member area, admin, CRM); `hub` is
@@ -56,13 +56,21 @@ type DbRules = Record<string, Rule>;
56
56
  /** Brand tokens that theme the site: palette, fonts, wordmark, nav, logos. */
57
57
  interface ChapterBrand {
58
58
  /** Palette overrides written into styles.css :root (e.g. `{ moss: "#2F3E34" }`
59
- * or `--ui-*` token names). */
59
+ * or `--ui-*` token names). Applies in BOTH light and dark unless overridden
60
+ * by {@link paletteDark}. */
60
61
  palette?: Record<string, string>;
62
+ /** Dark-mode palette overrides. Same shape as {@link palette}; emitted under
63
+ * `:root[data-theme="dark"]` and `@media (prefers-color-scheme: dark)`, so a
64
+ * site brands both modes. */
65
+ paletteDark?: Record<string, string>;
61
66
  fonts?: {
62
67
  display?: string;
63
68
  body?: string;
64
69
  numeral?: string;
65
70
  };
71
+ /** Short glyph used in compact admin chrome. Defaults to the first three
72
+ * letters of the chapter name. */
73
+ badge?: string;
66
74
  wordmark?: string;
67
75
  tagline?: string;
68
76
  /** Header/footer nav sections for the web-component chrome: label → entries. */
@@ -72,6 +80,40 @@ interface ChapterBrand {
72
80
  }>>;
73
81
  logos?: string;
74
82
  }
83
+ /** One follower site a leader can push CRM records to. The secret VALUE never
84
+ * lives in config: `secretName` names the leader tenant's vaulted copy of the
85
+ * follower's `network_share_secret`. */
86
+ interface ChapterNetworkTarget {
87
+ /** Stable lowercase slug used by the UI, audit tags, and default secret name. */
88
+ id: string;
89
+ /** Human-facing site name. Defaults to `id`. */
90
+ name?: string;
91
+ /** Absolute follower origin, e.g. `https://silver.example.com`. */
92
+ url: string;
93
+ /** Leader-vault key holding this follower's share secret. Defaults to
94
+ * `network_share_<id-with-underscores>`. */
95
+ secretName?: string;
96
+ /** Per-record-type field allowlist. If present, omitted types cannot be sent
97
+ * to this target. Without it, package-safe person/company defaults apply. */
98
+ fields?: Record<string, readonly string[]>;
99
+ }
100
+ /** Leader/follower network configuration. Followers need no code config to
101
+ * receive records; they only vault `network_share_secret`. */
102
+ interface ChapterNetwork {
103
+ targets?: readonly ChapterNetworkTarget[];
104
+ }
105
+ /** A validated network target carried on the resolved chapter engine. */
106
+ interface ResolvedNetworkTarget {
107
+ id: string;
108
+ name: string;
109
+ url: string;
110
+ secretName: string;
111
+ fields?: Record<string, readonly string[]>;
112
+ }
113
+ /** Fully-resolved leader network configuration. */
114
+ interface ResolvedNetwork {
115
+ targets: readonly ResolvedNetworkTarget[];
116
+ }
75
117
  /** Membership pricing for the group row (chapter mode). */
76
118
  interface ChapterPrices {
77
119
  standardCents: number;
@@ -227,6 +269,9 @@ interface ChapterConfig {
227
269
  /** A `defineCrm()` config or a resolved `Crm`. Omit for the per-mode default. */
228
270
  crm?: CrmConfig | Crm;
229
271
  brand?: ChapterBrand;
272
+ /** Leader → follower delivery targets. Secret values stay in the leader
273
+ * tenant vault; see {@link ChapterNetworkTarget}. */
274
+ network?: ChapterNetwork;
230
275
  thesis?: unknown;
231
276
  /** Required in `chapter` mode. */
232
277
  prices?: ChapterPrices;
@@ -313,6 +358,11 @@ interface Chapter {
313
358
  name: string;
314
359
  url?: string;
315
360
  mode: ChapterMode;
361
+ /** Resolved site identity. `wordmark` always falls back to `name`, so the
362
+ * admin/member UI never needs a second brand declaration. */
363
+ brand: ChapterBrand;
364
+ /** Validated follower targets for leader-driven record pushes. */
365
+ network: ResolvedNetwork;
316
366
  /** Resolved CRM engine (from `defineCrm`). */
317
367
  crm: Crm;
318
368
  /** Resolved auth policy (source, claim, ladder, super-admin tier). */
@@ -396,9 +446,9 @@ declare function chapterDb(mode: ChapterMode, auth: ResolvedAuth): {
396
446
  rules: DbRules;
397
447
  };
398
448
 
399
- /** The per-mode default CRM config: `chapter` = a person lead pipeline;
400
- * `hub` = people + businesses with a works_at relation. */
401
- declare function defaultCrm(mode: ChapterMode): CrmConfig;
449
+ /** The default shared CRM graph: people (with the application/member pipeline)
450
+ * plus businesses and the `works_at` relation, in both modes. */
451
+ declare function defaultCrm(_mode: ChapterMode): CrmConfig;
402
452
 
403
453
  /** The `groups` row (attrs) for `chapter` mode. Missing config falls back to
404
454
  * empty copy / defaults, so a minimal config still provisions cleanly. */
@@ -778,6 +828,27 @@ interface SharedPerson {
778
828
  linkedin?: string;
779
829
  hubRecordId: string;
780
830
  }
831
+ /** Convenience wire shape for sharing the default `company` CRM type. */
832
+ interface SharedBusiness {
833
+ type: "company";
834
+ name: string;
835
+ domain?: string;
836
+ industry?: string;
837
+ location?: string;
838
+ linkedin?: string;
839
+ notes?: string;
840
+ hubRecordId: string;
841
+ }
842
+ /** Versioned generic wire shape. `input` is validated against the follower's
843
+ * own CRM type before any write, so a leader cannot smuggle undeclared fields. */
844
+ interface SharedRecord {
845
+ version: 1;
846
+ type: string;
847
+ hubRecordId: string;
848
+ input: Record<string, unknown>;
849
+ }
850
+ /** Safe defaults when a target does not declare an explicit field allowlist. */
851
+ declare const DEFAULT_SHARE_FIELDS: Readonly<Record<string, readonly string[]>>;
781
852
  /** Map a shared prospect to a crm `person` input (only the fields the default
782
853
  * person type accepts). Name falls back to first+last, then the email. */
783
854
  declare function sharedPersonInput(person: SharedPerson): Record<string, unknown>;
@@ -789,12 +860,20 @@ interface ProjectionDeps {
789
860
  now: () => number;
790
861
  newId: () => string;
791
862
  }
863
+ /** CRM provenance tag used as the durable leader-id → local-record mapping. */
864
+ declare function networkSourceTag(type: string, hubRecordId: string): string;
865
+ /** Normalize the backwards-compatible person/business shapes into the versioned
866
+ * generic record envelope the receiver writes. */
867
+ declare function normalizeSharedRecord(record: SharedPerson | SharedBusiness | SharedRecord): SharedRecord;
868
+ /** Build the allowlisted payload sent from one leader CRM record to a target.
869
+ * A target with an explicit `fields` map only accepts the types it lists. */
870
+ declare function sharedRecordFromCrm(crm: Crm, record: CrmRecord, target: ResolvedNetworkTarget): SharedRecord;
792
871
  /**
793
- * Upsert a hub-shared prospect into this chapter's `crm_record` (push
794
- * projection), idempotent by the hub record id and unified by email. Callers wrap
795
- * this in `.catch` so a projection failure never fails the hub's share request.
872
+ * Upsert a leader-shared CRM record into this follower. Accepts the original
873
+ * person wire shape plus the versioned generic shape. Re-shares resolve through
874
+ * a durable provenance tag; people/businesses also converge by natural key.
796
875
  */
797
- declare function projectSharedRecord(deps: ProjectionDeps, person: SharedPerson): Promise<{
876
+ declare function projectSharedRecord(deps: ProjectionDeps, shared: SharedPerson | SharedBusiness | SharedRecord): Promise<{
798
877
  recordId: string;
799
878
  }>;
800
879
  /** An arriving applicant, as far as the CRM projection cares. `extra` carries the
@@ -1095,10 +1174,14 @@ declare function memberSession(user: SessionUser, opts: {
1095
1174
  }): MemberSession;
1096
1175
 
1097
1176
  /**
1098
- * Build the `:root { … }` CSS that maps a chapter's brand onto the design tokens
1099
- * the UI reads: each `palette` entry becomes a custom property, and `fonts`
1100
- * (display/body/numeral) map to `--ui-font-display` / `--ui-font-sans` /
1101
- * `--ui-font-numeral`. Returns "" when there is nothing to theme.
1177
+ * Build the CSS that maps a chapter's brand onto the design tokens the UI reads:
1178
+ * each `palette` entry becomes a custom property (light, and dark unless
1179
+ * `paletteDark` overrides), and `fonts` (display/body/numeral) map to
1180
+ * `--ui-font-display` / `--ui-font-sans` / `--ui-font-numeral`. The dark block is
1181
+ * emitted under both `:root[data-theme="dark"]` (the odla-ui theme toggle) and
1182
+ * `@media (prefers-color-scheme: dark)`. Returns "" when there is nothing to
1183
+ * theme. These are brand OVERRIDES on top of a base theme — they do not replace
1184
+ * the theme layer the components need (see {@link brandTokens} usage in the docs).
1102
1185
  */
1103
1186
  declare function brandTokens(brand: ChapterBrand | undefined): string;
1104
1187
 
@@ -1262,4 +1345,4 @@ type ApplicationBookingPatch = {
1262
1345
  * already there (never backward). */
1263
1346
  declare function applicationBookingUpdate(currentStatus: string, startAt: number, htmlLink?: string | null): ApplicationBookingPatch;
1264
1347
 
1265
- export { type AccountModel, type AdminNotificationTrigger, type Applicant, type ApplicationBookingPatch, type ApplicationRecord, type ApplicationSummary, type Attr, type AttrType, type Chapter, type ChapterApplication, type ChapterAuth, type ChapterBrand, type ChapterConfig, type ChapterDb, type ChapterEmails, type ChapterIntegrationDescriptor, type ChapterIntegrationOptions, type ChapterMode, type ChapterOperations, type ChapterPipeline, type ChapterPolicy, type ChapterPrices, type ChapterScheduling, type ChapterSends, type ClerkInviteInput, type ClerkResult, type ClerkUserInput, type ClerkUserRecord, type DbOp, type DbRules, type DbSchema, type DeliveryDecision, type EmailGroup, type EmailTemplate, type EmailTemplateRow, type Entity, type ExistingMeeting, type GuardResult, type IntegrationDescriptor, type IntegrationProvision, type IntegrationSecret, type IntegrationSetting, type IntegrationSync, type JoinConfigGroup, type LiveEvent, type MailSender, type MeetingForReconcile, type MeetingRecord, type MeetingReschedulePatch, type MemberApplication, type MemberSession, type NewMeetingRow, type NotifyDeps, type NotifyInput, type NotifyResult, type PaymentsGroup, type ProjectionDeps, type ReconcileDecision, type ResolvedApplication, type ResolvedAuth, type ResolvedOperations, type ResolvedPipeline, type ResolvedScheduling, type ResolvedSends, type RoleChangeContext, type Rule, SCHEDULING_DEFAULTS, type SchedulingErrors, type SecretMode, type SecretStore, type SessionUser, type SharedPerson, type StripeEvent, type StripeResult, type SubmitResult, type WebhookEvent, applicantProfile, applicationBookingUpdate, applicationSummary, backfillCrm, bookingDecision, brandTokens, bucketSeries, buildGroupSeed, canApprove, canBook, canChangeRole, canTransition, canceledPatch, chapterDb, clampArray, clerkGetUser, clerkGetUserByEmail, clerkIntegration, clerkInviteRequest, clerkListUsers, clerkSetRole, clerkUserRequest, createChapterIntegration, createClerkInvitation, createClerkUser, defaultCrm, defineChapter, emailGroupFrom, endForSlot, findApplicationRef, firstPaymentPatch, getVaultSecret, hasDisclaimerAck, introIdempotencyKey, isAdminRole, isAlreadySent, isReconcilable, isSlotAvailable, isValidEmail, joinConfig, meetingCreateRow, meetingRescheduleUpdate, memberApplication, memberSession, normalizeWebhookEvent, paymentsReady, personInputFromApp, planDelivery, projectApplicant, projectSharedRecord, reconcileMeetings, refundedPatch, render, renderSummary, renderTemplateBody, renewalPatch, resolveApplication, resolveAuth, resolvePipeline, resolveScheduling, roleFromClaim, sendTemplated, sharedPersonInput, slotWindow, stageIndex, stripeCall, stripeForm, subAnnualCents, submitApplication, subscriptionIdempotencyKey, syncApplicationToCrm, validateScheduling, verifyStripeSignature, webhookMutationId };
1348
+ export { type AccountModel, type AdminNotificationTrigger, type Applicant, type ApplicationBookingPatch, type ApplicationRecord, type ApplicationSummary, type Attr, type AttrType, type Chapter, type ChapterApplication, type ChapterAuth, type ChapterBrand, type ChapterConfig, type ChapterDb, type ChapterEmails, type ChapterIntegrationDescriptor, type ChapterIntegrationOptions, type ChapterMode, type ChapterNetwork, type ChapterNetworkTarget, type ChapterOperations, type ChapterPipeline, type ChapterPolicy, type ChapterPrices, type ChapterScheduling, type ChapterSends, type ClerkInviteInput, type ClerkResult, type ClerkUserInput, type ClerkUserRecord, DEFAULT_SHARE_FIELDS, type DbOp, type DbRules, type DbSchema, type DeliveryDecision, type EmailGroup, type EmailTemplate, type EmailTemplateRow, type Entity, type ExistingMeeting, type GuardResult, type IntegrationDescriptor, type IntegrationProvision, type IntegrationSecret, type IntegrationSetting, type IntegrationSync, type JoinConfigGroup, type LiveEvent, type MailSender, type MeetingForReconcile, type MeetingRecord, type MeetingReschedulePatch, type MemberApplication, type MemberSession, type NewMeetingRow, type NotifyDeps, type NotifyInput, type NotifyResult, type PaymentsGroup, type ProjectionDeps, type ReconcileDecision, type ResolvedApplication, type ResolvedAuth, type ResolvedNetwork, type ResolvedNetworkTarget, type ResolvedOperations, type ResolvedPipeline, type ResolvedScheduling, type ResolvedSends, type RoleChangeContext, type Rule, SCHEDULING_DEFAULTS, type SchedulingErrors, type SecretMode, type SecretStore, type SessionUser, type SharedBusiness, type SharedPerson, type SharedRecord, type StripeEvent, type StripeResult, type SubmitResult, type WebhookEvent, applicantProfile, applicationBookingUpdate, applicationSummary, backfillCrm, bookingDecision, brandTokens, bucketSeries, buildGroupSeed, canApprove, canBook, canChangeRole, canTransition, canceledPatch, chapterDb, clampArray, clerkGetUser, clerkGetUserByEmail, clerkIntegration, clerkInviteRequest, clerkListUsers, clerkSetRole, clerkUserRequest, createChapterIntegration, createClerkInvitation, createClerkUser, defaultCrm, defineChapter, emailGroupFrom, endForSlot, findApplicationRef, firstPaymentPatch, getVaultSecret, hasDisclaimerAck, introIdempotencyKey, isAdminRole, isAlreadySent, isReconcilable, isSlotAvailable, isValidEmail, joinConfig, meetingCreateRow, meetingRescheduleUpdate, memberApplication, memberSession, networkSourceTag, normalizeSharedRecord, normalizeWebhookEvent, paymentsReady, personInputFromApp, planDelivery, projectApplicant, projectSharedRecord, reconcileMeetings, refundedPatch, render, renderSummary, renderTemplateBody, renewalPatch, resolveApplication, resolveAuth, resolvePipeline, resolveScheduling, roleFromClaim, sendTemplated, sharedPersonInput, sharedRecordFromCrm, slotWindow, stageIndex, stripeCall, stripeForm, subAnnualCents, submitApplication, subscriptionIdempotencyKey, syncApplicationToCrm, validateScheduling, verifyStripeSignature, webhookMutationId };