@ttt-productions/ttt-core 0.79.62 → 0.79.63

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.
Files changed (66) hide show
  1. package/dist/constants/admin-labels.d.ts +3 -1
  2. package/dist/constants/admin-labels.d.ts.map +1 -1
  3. package/dist/constants/admin-labels.js +6 -0
  4. package/dist/constants/admin-labels.js.map +1 -1
  5. package/dist/constants/audition-deadlines.d.ts +2 -0
  6. package/dist/constants/audition-deadlines.d.ts.map +1 -1
  7. package/dist/constants/audition-deadlines.js +5 -0
  8. package/dist/constants/audition-deadlines.js.map +1 -1
  9. package/dist/doc-schemas/chat-sync.d.ts +0 -1
  10. package/dist/doc-schemas/chat-sync.d.ts.map +1 -1
  11. package/dist/doc-schemas/chat-sync.js +4 -3
  12. package/dist/doc-schemas/chat-sync.js.map +1 -1
  13. package/dist/doc-schemas/commissions.d.ts +10 -2
  14. package/dist/doc-schemas/commissions.d.ts.map +1 -1
  15. package/dist/doc-schemas/commissions.js +3 -1
  16. package/dist/doc-schemas/commissions.js.map +1 -1
  17. package/dist/doc-schemas/messaging.d.ts +9 -0
  18. package/dist/doc-schemas/messaging.d.ts.map +1 -1
  19. package/dist/doc-schemas/messaging.js +10 -1
  20. package/dist/doc-schemas/messaging.js.map +1 -1
  21. package/dist/doc-schemas/registry.d.ts +7 -2
  22. package/dist/doc-schemas/registry.d.ts.map +1 -1
  23. package/dist/doc-schemas/user.d.ts +1 -0
  24. package/dist/doc-schemas/user.d.ts.map +1 -1
  25. package/dist/doc-schemas/user.js +5 -0
  26. package/dist/doc-schemas/user.js.map +1 -1
  27. package/dist/ids/chat-ids.d.ts +0 -1
  28. package/dist/ids/chat-ids.d.ts.map +1 -1
  29. package/dist/ids/chat-ids.js +0 -3
  30. package/dist/ids/chat-ids.js.map +1 -1
  31. package/dist/ids/guild-chat-conversation.d.ts +9 -1
  32. package/dist/ids/guild-chat-conversation.d.ts.map +1 -1
  33. package/dist/ids/guild-chat-conversation.js +10 -0
  34. package/dist/ids/guild-chat-conversation.js.map +1 -1
  35. package/dist/permissions/work-project-permissions-data.d.ts +8 -2
  36. package/dist/permissions/work-project-permissions-data.d.ts.map +1 -1
  37. package/dist/permissions/work-project-permissions-data.js +11 -2
  38. package/dist/permissions/work-project-permissions-data.js.map +1 -1
  39. package/dist/schemas/admin-dispatch-actions.d.ts +13 -0
  40. package/dist/schemas/admin-dispatch-actions.d.ts.map +1 -1
  41. package/dist/schemas/admin-dispatch-actions.js +14 -1
  42. package/dist/schemas/admin-dispatch-actions.js.map +1 -1
  43. package/dist/schemas/chat.d.ts +41 -0
  44. package/dist/schemas/chat.d.ts.map +1 -1
  45. package/dist/schemas/chat.js +25 -1
  46. package/dist/schemas/chat.js.map +1 -1
  47. package/dist/schemas/notification.d.ts +11 -0
  48. package/dist/schemas/notification.d.ts.map +1 -1
  49. package/dist/schemas/notification.js +10 -0
  50. package/dist/schemas/notification.js.map +1 -1
  51. package/dist/schemas/safety.d.ts +4209 -0
  52. package/dist/schemas/safety.d.ts.map +1 -1
  53. package/dist/schemas/safety.js +115 -7
  54. package/dist/schemas/safety.js.map +1 -1
  55. package/dist/schemas/utility.d.ts.map +1 -1
  56. package/dist/schemas/utility.js +10 -2
  57. package/dist/schemas/utility.js.map +1 -1
  58. package/dist/schemas/work-project-management.d.ts +135 -0
  59. package/dist/schemas/work-project-management.d.ts.map +1 -1
  60. package/dist/schemas/work-project-management.js +38 -0
  61. package/dist/schemas/work-project-management.js.map +1 -1
  62. package/dist/utils/guild-chat-access.d.ts +22 -0
  63. package/dist/utils/guild-chat-access.d.ts.map +1 -1
  64. package/dist/utils/guild-chat-access.js +22 -0
  65. package/dist/utils/guild-chat-access.js.map +1 -1
  66. package/package.json +2 -2
@@ -8,7 +8,7 @@ import type { ChildSafetyWorkStatus } from '../doc-schemas/safety/case.js';
8
8
  import type { BroadcastAudienceSelector } from '../schemas/notification.js';
9
9
  import type { DeadLetterCollection } from '../schemas/admin.js';
10
10
  import type { GuildInviteConversationStatus, ShortLinkTargetType } from '../schemas/atoms.js';
11
- import type { AdminDispatch } from '../doc-schemas/messaging.js';
11
+ import type { AdminDispatch, AdminDispatchSenderRole } from '../doc-schemas/messaging.js';
12
12
  import type { CommissionProposalStatus } from '../schemas/commissions.js';
13
13
  import type { InviteSourceType } from '../schemas/work-project-management.js';
14
14
  import type { Audition } from '../doc-schemas/commissions.js';
@@ -117,6 +117,8 @@ export declare const INVITE_SOURCE_TYPE_LABELS: Record<InviteSourceType, string>
117
117
  export declare const SHORT_LINK_TARGET_TYPE_LABELS: Record<ShortLinkTargetType, string>;
118
118
  /** Support-thread statuses (a member's Messages, a Work's Correspondence, the admin browse list). */
119
119
  export declare const ADMIN_DISPATCH_STATUS_LABELS: Record<AdminDispatch['status'], string>;
120
+ /** Who a support-thread message is from, as the admin thread preview labels it. */
121
+ export declare const ADMIN_DISPATCH_SENDER_ROLE_LABELS: Record<AdminDispatchSenderRole, string>;
120
122
  /** Child-safety case work statuses (the safety case console's case rows and closed-case lookup). */
121
123
  export declare const CHILD_SAFETY_CASE_WORK_STATUS_LABELS: Record<ChildSafetyWorkStatus, string>;
122
124
  /** NCII case statuses (the safety case console's case rows and closed-case lookup). */
@@ -1 +1 @@
1
- {"version":3,"file":"admin-labels.d.ts","sourceRoot":"","sources":["../../src/constants/admin-labels.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAGpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACjG,OAAO,KAAK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AM,CAIpE,CAAC;AAEF,2FAA2F;AAC3F,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAKtE,CAAC;AAEF,6FAA6F;AAC7F,eAAO,MAAM,6BAA6B,EAAE,MAAM,CAAC,mBAAmB,EAAE,MAAM,CAK7E,CAAC;AAEF,qGAAqG;AACrG,eAAO,MAAM,4BAA4B,EAAE,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,MAAM,CAMhF,CAAC;AAEF,mFAAmF;AACnF,eAAO,MAAM,iCAAiC,EAAE,MAAM,CAAC,uBAAuB,EAAE,MAAM,CAIrF,CAAC;AAEF,oGAAoG;AACpG,eAAO,MAAM,oCAAoC,EAAE,MAAM,CAAC,qBAAqB,EAAE,MAAM,CAQtF,CAAC;AAEF,uFAAuF;AACvF,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAQtE,CAAC"}
@@ -207,6 +207,12 @@ export const ADMIN_DISPATCH_STATUS_LABELS = {
207
207
  closed_resolved: 'Resolved',
208
208
  closed_unresolved: 'Closed',
209
209
  };
210
+ /** Who a support-thread message is from, as the admin thread preview labels it. */
211
+ export const ADMIN_DISPATCH_SENDER_ROLE_LABELS = {
212
+ user: 'User',
213
+ admin: 'Admin',
214
+ system: 'System',
215
+ };
210
216
  /** Child-safety case work statuses (the safety case console's case rows and closed-case lookup). */
211
217
  export const CHILD_SAFETY_CASE_WORK_STATUS_LABELS = {
212
218
  new: 'new',
@@ -1 +1 @@
1
- {"version":3,"file":"admin-labels.js","sourceRoot":"","sources":["../../src/constants/admin-labels.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,8EAA8E;AAC9E,iFAAiF;AACjF,2EAA2E;AAC3E,6EAA6E;AAC7E,6DAA6D;AAC7D,EAAE;AACF,mFAAmF;AACnF,mFAAmF;AACnF,kDAAkD;AAClD,+EAA+E;AAqB/E,sEAAsE;AACtE,MAAM,CAAC,MAAM,0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AC;AAEF,uFAAuF;AACvF,MAAM,CAAC,MAAM,uBAAuB,GAAuC;IACzE,IAAI,EAAE,MAAM;IACZ,iBAAiB,EAAE,mBAAmB;IACtC,UAAU,EAAE,YAAY;IACxB,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,QAAQ;CACjB,CAAC","sourcesContent":["// ============================================================================\n// ADMIN-SURFACE DISPLAY LABELS — the ONE home for business display copy keyed\n// by canonical ttt-core enums (ARCH-102, extended 2026-07-13). Consolidated from\n// the former component-local maps in ttt-prod (admin-user-management-view,\n// admin-announcements-view, guided-resolution-flow). Any client (web, phone,\n// TV, admin app) renders the same labels by importing these.\n//\n// A few entries here are copy for ADMIN-MANAGED content that a PUBLIC surface also\n// renders (the rules-page group titles at the bottom of this file). The organizing\n// principle is one declaration, not one consumer.\n// ============================================================================\n\nimport type { UserAccountStatus } from '../doc-schemas/user.js';\nimport type { FeedbackType } from './business-admin.js';\nimport type { ClearableTextFieldName } from './business-content.js';\n// Value import: the per-surface override type below indexes this map to restrict each surface's\n// override keys to the fields that surface actually exposes.\nimport { HALL_CONTENT_TEXT_FIELDS } from './business-content.js';\nimport type { HallContentTextSurface } from '../doc-schemas/content.js';\nimport type { ReportDisposition, NciiInternalStatus } from '../doc-schemas/safety/foundation.js';\nimport type { ChildSafetyWorkStatus } from '../doc-schemas/safety/case.js';\nimport type { BroadcastAudienceSelector } from '../schemas/notification.js';\nimport type { DeadLetterCollection } from '../schemas/admin.js';\nimport type { GuildInviteConversationStatus, ShortLinkTargetType } from '../schemas/atoms.js';\nimport type { AdminDispatch } from '../doc-schemas/messaging.js';\nimport type { CommissionProposalStatus } from '../schemas/commissions.js';\nimport type { InviteSourceType } from '../schemas/work-project-management.js';\nimport type { Audition } from '../doc-schemas/commissions.js';\nimport type { WorkProjectType } from '../types/content.js';\nimport type { HallSubItemStatus } from '../utils/hall-content.js';\n\n/** Moderation status labels (user-management view, status badges). */\nexport const USER_ACCOUNT_STATUS_LABELS: Record<UserAccountStatus, string> = {\n active: 'Active',\n suspended: 'Suspended',\n banned: 'Banned',\n};\n\n/** Broadcast audience selector labels (announcement composer). */\nexport const BROADCAST_AUDIENCE_KIND_LABELS: Record<BroadcastAudienceSelector['kind'], string> = {\n allActiveUsers: 'All active users',\n allArtisans: 'All artisan creators',\n explicitUids: 'Specific users (paste uids)',\n workMembers: \"A Work's guild members\",\n realmMembers: \"A Realm's members\",\n};\n\n/** Human labels for the canonical feedback types — the admin feedback-suggestions views and\n * the user-facing feedback-submission surface render these instead of restating copy. Keyed\n * by FeedbackType, so a new FEEDBACK_TYPES member fails the build until its label exists.\n * UI copy uses the SHORT settled terms (Trade → \"Trades\", Craft → \"Craft Tags\", Genre →\n * \"<Kind> Genres\"), never the compound code identifiers (ARCH-107). */\nexport const FEEDBACK_TYPE_LABELS: Record<FeedbackType, string> = {\n tradeProfessionSuggestions: 'Trades',\n craftSkillTagSuggestions: 'Craft Tags',\n talesWorkGenreSuggestions: 'Tales Genres',\n tunesWorkGenreSuggestions: 'Tunes Genres',\n televisionWorkGenreSuggestions: 'Television Genres',\n};\n\n/**\n * Human labels for the raw clearable/changeable TEXT-FIELD names the moderation text-clear\n * remedy and the published \"Update details\" change-request flow work in. The backend stores and\n * validates the raw doc field names (`workingTitle`, `description`, `content`); these are the\n * only display strings for them — rendered by the member-facing \"text removed by moderation\"\n * banners, every admin clear-text field picker, the change-request dialog, and the admin\n * change-request work view. Keyed by the derived ClearableTextFieldName union, so a new\n * clearable field fails the build here until it has a label (ARCH-102).\n *\n * The `working*` pair belongs to the Work shell and the Realm doc; the labels stay the plain\n * short terms (ARCH-107 — the code identifier carries `working`, the UI never shows it).\n */\nexport const CLEARABLE_TEXT_FIELD_LABELS: Record<ClearableTextFieldName, string> = {\n workingTitle: 'Title',\n workingDescription: 'Description',\n title: 'Title',\n description: 'Description',\n content: 'Content',\n};\n\n/**\n * Per-surface label overrides for the field labels above: `[surface][field] → label`. Only a\n * surface that genuinely names a field differently appears here; everything else resolves to the\n * base map. Each surface's override keys are restricted to the fields THAT surface exposes\n * (indexed off `HALL_CONTENT_TEXT_FIELDS`), so an override for a field the surface does not have\n * is a compile error — as is an override for a surface outside `HallContentTextSurface`.\n */\nexport type ClearableTextFieldLabelOverrides = {\n [S in HallContentTextSurface]?: {\n [F in (typeof HALL_CONTENT_TEXT_FIELDS)[S][number]]?: string;\n };\n};\n\n/**\n * A Realm's identity field is called **Name** on every Realm surface (DJ ruling 2026-07-29,\n * settling a four-surface Name/Title conflict: the creation flow said \"Realm Name\", the inline\n * edit form \"Working Title\", the moderation-cleared banner \"Title\", and the request-update\n * dialog \"Name\"). The `workingTitle` doc field is shared with the Work shell, where it IS a\n * Title — so the difference is per-surface, not per-field, and lives here rather than flattening\n * one of the two settled terms.\n */\nexport const CLEARABLE_TEXT_FIELD_LABEL_OVERRIDES = {\n workRealm: { workingTitle: 'Name' },\n} as const satisfies ClearableTextFieldLabelOverrides;\n\n/**\n * The display label for one raw clearable text-field name: the surface's override when it has\n * one, otherwise the base label, otherwise the raw name. This is the ONE accessor every surface\n * calls — pass the surface whenever the caller knows it (a Realm surface must, or it renders\n * \"Title\" for a Name); omit it only for a genuinely surface-agnostic caller.\n *\n * Both parameters tolerate a plain `string` because callers read field names off stored documents\n * (`moderationClearedFields`) and callable payloads, and the surface may be the `workProject`\n * shell — which is a clearable surface but not a `HallContentTextSurface`, so it simply has no\n * overrides and falls through to the base map.\n */\nexport function clearableTextFieldLabel(field: string, surface?: string): string {\n const overrides = surface\n ? (CLEARABLE_TEXT_FIELD_LABEL_OVERRIDES as Record<string, Record<string, string> | undefined>)[\n surface\n ]\n : undefined;\n return (\n overrides?.[field] ?? (CLEARABLE_TEXT_FIELD_LABELS as Record<string, string>)[field] ?? field\n );\n}\n\n/** What the admin screens show for a thread whose `awaitingAdminReply` is set. */\nexport const ADMIN_DISPATCH_AWAITING_REPLY_LABEL = 'Awaiting reply';\n\n/** Human labels for the dead-letter replay ledgers (Ops Repairs dead-letter table). */\nexport const DEAD_LETTER_COLLECTION_LABELS: Record<DeadLetterCollection, string> = {\n chatSyncEvents: 'Chat sync event',\n chatAdminActionCommands: 'Chat moderation command',\n notificationDeliveries: 'Notification delivery',\n chatMessageOutbox: 'Chat message publish',\n squareAnnouncementJobs: 'Square announcement',\n chatSyncFanoutJobs: 'Chat access fanout',\n mediaAssets: 'Media authority sync',\n quarantineSagaJobs: 'Quarantine saga',\n nciiRemovalJobs: 'NCII removal',\n safetyEvidenceJobs: 'Safety evidence job',\n accountActionCommands: 'Account safety action',\n activeReportGroups: 'Report edge sync',\n hallSubItemEdgeSync: 'Hall sub-item edge sync',\n chatParkedDeliveries: 'Chat room delivery',\n};\n\n/** Operator-settable report dispositions with their console copy. 'undetermined' is the\n * initial state, never a settable target, so it carries no option entry. */\nexport const REPORT_DISPOSITION_OPTIONS: readonly {\n value: Exclude<ReportDisposition, 'undetermined'>;\n label: string;\n description: string;\n}[] = [\n {\n value: 'reportRequired',\n label: 'Report required (NCMEC)',\n description:\n 'Apparent CSAM — a report is legally required. Establishes actual knowledge + arms the clock.',\n },\n {\n value: 'notRequired',\n label: 'No report required',\n description: 'No reporting obligation ever arose. Disallowed once there is a validated match.',\n },\n {\n value: 'correctedNoApparentViolation',\n label: 'False positive — correct it',\n description: 'There was a triggering signal but on review it is a false positive.',\n },\n];\n\n/** One user-facing reason option (shown to the affected user for any user-affecting action). */\nexport interface UserFacingReasonOption {\n code: string;\n label: string;\n description: string;\n}\n\n/** User-facing reason picklist for the guided case-resolution flow — the affected user sees the\n * label for any user-affecting action. Canonical home (ARCH-102): the codes ARE this list's own\n * enumeration, so every client (web, phone, TV, admin app) renders the same options + labels by\n * importing from here. Final user-/legal-facing wording is subject to lawyer review; these are\n * functional defaults. */\nexport const USER_FACING_REASON_OPTIONS: readonly UserFacingReasonOption[] = [\n { code: 'harassment', label: 'Harassment or bullying', description: 'Targeted abuse, threats, or sustained harassment of a person.' },\n { code: 'hate', label: 'Hate speech', description: 'Attacks on people based on a protected characteristic.' },\n { code: 'adult-content', label: 'Explicit / adult content', description: 'Sexual or graphic content not allowed on the platform.' },\n { code: 'violence', label: 'Violence or threats', description: 'Threats of violence, or content glorifying or inciting it.' },\n { code: 'spam', label: 'Spam or scam', description: 'Unsolicited bulk content, deceptive links, or fraud.' },\n { code: 'impersonation', label: 'Impersonation', description: 'Pretending to be another person, brand, or entity.' },\n { code: 'ip', label: 'Intellectual property', description: 'Use of someone else’s work without the right to do so.' },\n { code: 'nonconsensual', label: 'Nonconsensual intimate imagery', description: 'Intimate or sexual imagery shared without the subject’s consent.' },\n { code: 'safety', label: 'Safety violation', description: 'A serious safety violation handled under our safety policies.' },\n { code: 'other', label: 'Other (explain)', description: 'A policy violation not covered above — describe it in the detail box.' },\n] as const;\n\n/** The user-facing label for a reason code (undefined when the code is unknown/absent). */\nexport function userFacingReasonLabel(code: string | undefined): string | undefined {\n return USER_FACING_REASON_OPTIONS.find((o) => o.code === code)?.label;\n}\n\n// --- Rules-surface group titles ---\n// The two rule-GROUP headings for the platform rules content (`Rule.group`\n// 'workProjectType' / 'hallWingType' — see schemas/admin.ts). BOTH the admin rules editor\n// and the public rules page render these, so they are declared once here instead of being\n// restated as literals on each surface (ENG-002). Copy uses the short settled terms Work /\n// Hall / Wing (ARCH-107).\n\nexport const WORK_PROJECT_TYPE_RULE_GROUP_TITLE = 'Work Type Rules';\nexport const HALL_WING_TYPE_RULE_GROUP_TITLE = 'Hall Wing Rules';\n\n// --- Stored-enum display labels ---\n// What a screen shows for a stored enum value, keyed by the canonical union so a new member fails\n// the build until it has its text. A screen renders the label, never the raw value.\n\n/** Guild invite statuses (a Work's invited-users list and an invite conversation's status line). */\nexport const GUILD_INVITE_STATUS_LABELS: Record<GuildInviteConversationStatus, string> = {\n pending: 'Pending',\n accepted: 'Accepted',\n declined: 'Declined',\n cancelled: 'Cancelled',\n finalized: 'Finalized',\n};\n\n/** Commission proposal statuses (a Work's proposals table). */\nexport const COMMISSION_PROPOSAL_STATUS_LABELS: Record<CommissionProposalStatus, string> = {\n open: 'Open',\n invited: 'Invited',\n accepted: 'Accepted',\n rejected: 'Rejected',\n};\n\n/** Chapter, track, and episode review statuses (the Tale, Tune, and Television section tables). */\nexport const HALL_SUB_ITEM_STATUS_LABELS: Record<HallSubItemStatus, string> = {\n unpublished: 'unpublished',\n pending_approval: 'Pending approval',\n published: 'published',\n};\n\n/** Audition statuses (the audition page). */\nexport const AUDITION_STATUS_LABELS: Record<Audition['status'], string> = {\n open: 'Open',\n closed: 'Closed',\n pendingReview: 'PendingReview',\n};\n\n/** Work types (Work lists, the Work overview, the Works popover). */\nexport const WORK_PROJECT_TYPE_LABELS: Record<WorkProjectType, string> = {\n Tales: 'Tales',\n Tunes: 'Tunes',\n Television: 'Television',\n};\n\n/** Invite source types, as the invite dialog names the context an invite was sent from. */\nexport const INVITE_SOURCE_TYPE_LABELS: Record<InviteSourceType, string> = {\n standalone: 'standalone',\n craftSkill: 'craftSkill',\n commission: 'commission',\n audition: 'audition',\n};\n\n/** Short-link target types (the admin Short Links list), in the target-type enum's order. */\nexport const SHORT_LINK_TARGET_TYPE_LABELS: Record<ShortLinkTargetType, string> = {\n audition: 'Audition',\n 'audition-entry': 'Audition entry',\n commission: 'Commission',\n 'hall-library-item': 'Hall entry',\n};\n\n/** Support-thread statuses (a member's Messages, a Work's Correspondence, the admin browse list). */\nexport const ADMIN_DISPATCH_STATUS_LABELS: Record<AdminDispatch['status'], string> = {\n open: 'Open',\n user_reply: 'User replied',\n admin_reply: 'Admin replied',\n closed_resolved: 'Resolved',\n closed_unresolved: 'Closed',\n};\n\n/** Child-safety case work statuses (the safety case console's case rows and closed-case lookup). */\nexport const CHILD_SAFETY_CASE_WORK_STATUS_LABELS: Record<ChildSafetyWorkStatus, string> = {\n new: 'new',\n triaged: 'triaged',\n reporting: 'reporting',\n actioning: 'actioning',\n processing: 'processing',\n failed: 'failed',\n operationallyResolved: 'operationallyResolved',\n};\n\n/** NCII case statuses (the safety case console's case rows and closed-case lookup). */\nexport const NCII_CASE_STATUS_LABELS: Record<NciiInternalStatus, string> = {\n open: 'open',\n removalInProgress: 'removalInProgress',\n processing: 'processing',\n failed: 'failed',\n removed: 'removed',\n rejected: 'rejected',\n closed: 'closed',\n};\n"]}
1
+ {"version":3,"file":"admin-labels.js","sourceRoot":"","sources":["../../src/constants/admin-labels.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,8EAA8E;AAC9E,iFAAiF;AACjF,2EAA2E;AAC3E,6EAA6E;AAC7E,6DAA6D;AAC7D,EAAE;AACF,mFAAmF;AACnF,mFAAmF;AACnF,kDAAkD;AAClD,+EAA+E;AAqB/E,sEAAsE;AACtE,MAAM,CAAC,MAAM,0BAA0B,GAAsC;IAC3E,MAAM,EAAE,QAAQ;IAChB,SAAS,EAAE,WAAW;IACtB,MAAM,EAAE,QAAQ;CACjB,CAAC;AAEF,kEAAkE;AAClE,MAAM,CAAC,MAAM,8BAA8B,GAAsD;IAC/F,cAAc,EAAE,kBAAkB;IAClC,WAAW,EAAE,sBAAsB;IACnC,YAAY,EAAE,6BAA6B;IAC3C,WAAW,EAAE,wBAAwB;IACrC,YAAY,EAAE,mBAAmB;CAClC,CAAC;AAEF;;;;uEAIuE;AACvE,MAAM,CAAC,MAAM,oBAAoB,GAAiC;IAChE,0BAA0B,EAAE,QAAQ;IACpC,wBAAwB,EAAE,YAAY;IACtC,yBAAyB,EAAE,cAAc;IACzC,yBAAyB,EAAE,cAAc;IACzC,8BAA8B,EAAE,mBAAmB;CACpD,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAA2C;IACjF,YAAY,EAAE,OAAO;IACrB,kBAAkB,EAAE,aAAa;IACjC,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,aAAa;IAC1B,OAAO,EAAE,SAAS;CACnB,CAAC;AAeF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,oCAAoC,GA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Y;IACxB,mBAAmB,EAAE,YAAY;CAClC,CAAC;AAEF,qGAAqG;AACrG,MAAM,CAAC,MAAM,4BAA4B,GAA4C;IACnF,IAAI,EAAE,MAAM;IACZ,UAAU,EAAE,cAAc;IAC1B,WAAW,EAAE,eAAe;IAC5B,eAAe,EAAE,UAAU;IAC3B,iBAAiB,EAAE,QAAQ;CAC5B,CAAC;AAEF,mFAAmF;AACnF,MAAM,CAAC,MAAM,iCAAiC,GAA4C;IACxF,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;CACjB,CAAC;AAEF,oGAAoG;AACpG,MAAM,CAAC,MAAM,oCAAoC,GAA0C;IACzF,GAAG,EAAE,KAAK;IACV,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;IACtB,SAAS,EAAE,WAAW;IACtB,UAAU,EAAE,YAAY;IACxB,MAAM,EAAE,QAAQ;IAChB,qBAAqB,EAAE,uBAAuB;CAC/C,CAAC;AAEF,uFAAuF;AACvF,MAAM,CAAC,MAAM,uBAAuB,GAAuC;IACzE,IAAI,EAAE,MAAM;IACZ,iBAAiB,EAAE,mBAAmB;IACtC,UAAU,EAAE,YAAY;IACxB,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,QAAQ;CACjB,CAAC","sourcesContent":["// ============================================================================\n// ADMIN-SURFACE DISPLAY LABELS — the ONE home for business display copy keyed\n// by canonical ttt-core enums (ARCH-102, extended 2026-07-13). Consolidated from\n// the former component-local maps in ttt-prod (admin-user-management-view,\n// admin-announcements-view, guided-resolution-flow). Any client (web, phone,\n// TV, admin app) renders the same labels by importing these.\n//\n// A few entries here are copy for ADMIN-MANAGED content that a PUBLIC surface also\n// renders (the rules-page group titles at the bottom of this file). The organizing\n// principle is one declaration, not one consumer.\n// ============================================================================\n\nimport type { UserAccountStatus } from '../doc-schemas/user.js';\nimport type { FeedbackType } from './business-admin.js';\nimport type { ClearableTextFieldName } from './business-content.js';\n// Value import: the per-surface override type below indexes this map to restrict each surface's\n// override keys to the fields that surface actually exposes.\nimport { HALL_CONTENT_TEXT_FIELDS } from './business-content.js';\nimport type { HallContentTextSurface } from '../doc-schemas/content.js';\nimport type { ReportDisposition, NciiInternalStatus } from '../doc-schemas/safety/foundation.js';\nimport type { ChildSafetyWorkStatus } from '../doc-schemas/safety/case.js';\nimport type { BroadcastAudienceSelector } from '../schemas/notification.js';\nimport type { DeadLetterCollection } from '../schemas/admin.js';\nimport type { GuildInviteConversationStatus, ShortLinkTargetType } from '../schemas/atoms.js';\nimport type { AdminDispatch, AdminDispatchSenderRole } from '../doc-schemas/messaging.js';\nimport type { CommissionProposalStatus } from '../schemas/commissions.js';\nimport type { InviteSourceType } from '../schemas/work-project-management.js';\nimport type { Audition } from '../doc-schemas/commissions.js';\nimport type { WorkProjectType } from '../types/content.js';\nimport type { HallSubItemStatus } from '../utils/hall-content.js';\n\n/** Moderation status labels (user-management view, status badges). */\nexport const USER_ACCOUNT_STATUS_LABELS: Record<UserAccountStatus, string> = {\n active: 'Active',\n suspended: 'Suspended',\n banned: 'Banned',\n};\n\n/** Broadcast audience selector labels (announcement composer). */\nexport const BROADCAST_AUDIENCE_KIND_LABELS: Record<BroadcastAudienceSelector['kind'], string> = {\n allActiveUsers: 'All active users',\n allArtisans: 'All artisan creators',\n explicitUids: 'Specific users (paste uids)',\n workMembers: \"A Work's guild members\",\n realmMembers: \"A Realm's members\",\n};\n\n/** Human labels for the canonical feedback types — the admin feedback-suggestions views and\n * the user-facing feedback-submission surface render these instead of restating copy. Keyed\n * by FeedbackType, so a new FEEDBACK_TYPES member fails the build until its label exists.\n * UI copy uses the SHORT settled terms (Trade → \"Trades\", Craft → \"Craft Tags\", Genre →\n * \"<Kind> Genres\"), never the compound code identifiers (ARCH-107). */\nexport const FEEDBACK_TYPE_LABELS: Record<FeedbackType, string> = {\n tradeProfessionSuggestions: 'Trades',\n craftSkillTagSuggestions: 'Craft Tags',\n talesWorkGenreSuggestions: 'Tales Genres',\n tunesWorkGenreSuggestions: 'Tunes Genres',\n televisionWorkGenreSuggestions: 'Television Genres',\n};\n\n/**\n * Human labels for the raw clearable/changeable TEXT-FIELD names the moderation text-clear\n * remedy and the published \"Update details\" change-request flow work in. The backend stores and\n * validates the raw doc field names (`workingTitle`, `description`, `content`); these are the\n * only display strings for them — rendered by the member-facing \"text removed by moderation\"\n * banners, every admin clear-text field picker, the change-request dialog, and the admin\n * change-request work view. Keyed by the derived ClearableTextFieldName union, so a new\n * clearable field fails the build here until it has a label (ARCH-102).\n *\n * The `working*` pair belongs to the Work shell and the Realm doc; the labels stay the plain\n * short terms (ARCH-107 — the code identifier carries `working`, the UI never shows it).\n */\nexport const CLEARABLE_TEXT_FIELD_LABELS: Record<ClearableTextFieldName, string> = {\n workingTitle: 'Title',\n workingDescription: 'Description',\n title: 'Title',\n description: 'Description',\n content: 'Content',\n};\n\n/**\n * Per-surface label overrides for the field labels above: `[surface][field] → label`. Only a\n * surface that genuinely names a field differently appears here; everything else resolves to the\n * base map. Each surface's override keys are restricted to the fields THAT surface exposes\n * (indexed off `HALL_CONTENT_TEXT_FIELDS`), so an override for a field the surface does not have\n * is a compile error — as is an override for a surface outside `HallContentTextSurface`.\n */\nexport type ClearableTextFieldLabelOverrides = {\n [S in HallContentTextSurface]?: {\n [F in (typeof HALL_CONTENT_TEXT_FIELDS)[S][number]]?: string;\n };\n};\n\n/**\n * A Realm's identity field is called **Name** on every Realm surface (DJ ruling 2026-07-29,\n * settling a four-surface Name/Title conflict: the creation flow said \"Realm Name\", the inline\n * edit form \"Working Title\", the moderation-cleared banner \"Title\", and the request-update\n * dialog \"Name\"). The `workingTitle` doc field is shared with the Work shell, where it IS a\n * Title — so the difference is per-surface, not per-field, and lives here rather than flattening\n * one of the two settled terms.\n */\nexport const CLEARABLE_TEXT_FIELD_LABEL_OVERRIDES = {\n workRealm: { workingTitle: 'Name' },\n} as const satisfies ClearableTextFieldLabelOverrides;\n\n/**\n * The display label for one raw clearable text-field name: the surface's override when it has\n * one, otherwise the base label, otherwise the raw name. This is the ONE accessor every surface\n * calls — pass the surface whenever the caller knows it (a Realm surface must, or it renders\n * \"Title\" for a Name); omit it only for a genuinely surface-agnostic caller.\n *\n * Both parameters tolerate a plain `string` because callers read field names off stored documents\n * (`moderationClearedFields`) and callable payloads, and the surface may be the `workProject`\n * shell — which is a clearable surface but not a `HallContentTextSurface`, so it simply has no\n * overrides and falls through to the base map.\n */\nexport function clearableTextFieldLabel(field: string, surface?: string): string {\n const overrides = surface\n ? (CLEARABLE_TEXT_FIELD_LABEL_OVERRIDES as Record<string, Record<string, string> | undefined>)[\n surface\n ]\n : undefined;\n return (\n overrides?.[field] ?? (CLEARABLE_TEXT_FIELD_LABELS as Record<string, string>)[field] ?? field\n );\n}\n\n/** What the admin screens show for a thread whose `awaitingAdminReply` is set. */\nexport const ADMIN_DISPATCH_AWAITING_REPLY_LABEL = 'Awaiting reply';\n\n/** Human labels for the dead-letter replay ledgers (Ops Repairs dead-letter table). */\nexport const DEAD_LETTER_COLLECTION_LABELS: Record<DeadLetterCollection, string> = {\n chatSyncEvents: 'Chat sync event',\n chatAdminActionCommands: 'Chat moderation command',\n notificationDeliveries: 'Notification delivery',\n chatMessageOutbox: 'Chat message publish',\n squareAnnouncementJobs: 'Square announcement',\n chatSyncFanoutJobs: 'Chat access fanout',\n mediaAssets: 'Media authority sync',\n quarantineSagaJobs: 'Quarantine saga',\n nciiRemovalJobs: 'NCII removal',\n safetyEvidenceJobs: 'Safety evidence job',\n accountActionCommands: 'Account safety action',\n activeReportGroups: 'Report edge sync',\n hallSubItemEdgeSync: 'Hall sub-item edge sync',\n chatParkedDeliveries: 'Chat room delivery',\n};\n\n/** Operator-settable report dispositions with their console copy. 'undetermined' is the\n * initial state, never a settable target, so it carries no option entry. */\nexport const REPORT_DISPOSITION_OPTIONS: readonly {\n value: Exclude<ReportDisposition, 'undetermined'>;\n label: string;\n description: string;\n}[] = [\n {\n value: 'reportRequired',\n label: 'Report required (NCMEC)',\n description:\n 'Apparent CSAM — a report is legally required. Establishes actual knowledge + arms the clock.',\n },\n {\n value: 'notRequired',\n label: 'No report required',\n description: 'No reporting obligation ever arose. Disallowed once there is a validated match.',\n },\n {\n value: 'correctedNoApparentViolation',\n label: 'False positive — correct it',\n description: 'There was a triggering signal but on review it is a false positive.',\n },\n];\n\n/** One user-facing reason option (shown to the affected user for any user-affecting action). */\nexport interface UserFacingReasonOption {\n code: string;\n label: string;\n description: string;\n}\n\n/** User-facing reason picklist for the guided case-resolution flow — the affected user sees the\n * label for any user-affecting action. Canonical home (ARCH-102): the codes ARE this list's own\n * enumeration, so every client (web, phone, TV, admin app) renders the same options + labels by\n * importing from here. Final user-/legal-facing wording is subject to lawyer review; these are\n * functional defaults. */\nexport const USER_FACING_REASON_OPTIONS: readonly UserFacingReasonOption[] = [\n { code: 'harassment', label: 'Harassment or bullying', description: 'Targeted abuse, threats, or sustained harassment of a person.' },\n { code: 'hate', label: 'Hate speech', description: 'Attacks on people based on a protected characteristic.' },\n { code: 'adult-content', label: 'Explicit / adult content', description: 'Sexual or graphic content not allowed on the platform.' },\n { code: 'violence', label: 'Violence or threats', description: 'Threats of violence, or content glorifying or inciting it.' },\n { code: 'spam', label: 'Spam or scam', description: 'Unsolicited bulk content, deceptive links, or fraud.' },\n { code: 'impersonation', label: 'Impersonation', description: 'Pretending to be another person, brand, or entity.' },\n { code: 'ip', label: 'Intellectual property', description: 'Use of someone else’s work without the right to do so.' },\n { code: 'nonconsensual', label: 'Nonconsensual intimate imagery', description: 'Intimate or sexual imagery shared without the subject’s consent.' },\n { code: 'safety', label: 'Safety violation', description: 'A serious safety violation handled under our safety policies.' },\n { code: 'other', label: 'Other (explain)', description: 'A policy violation not covered above — describe it in the detail box.' },\n] as const;\n\n/** The user-facing label for a reason code (undefined when the code is unknown/absent). */\nexport function userFacingReasonLabel(code: string | undefined): string | undefined {\n return USER_FACING_REASON_OPTIONS.find((o) => o.code === code)?.label;\n}\n\n// --- Rules-surface group titles ---\n// The two rule-GROUP headings for the platform rules content (`Rule.group`\n// 'workProjectType' / 'hallWingType' — see schemas/admin.ts). BOTH the admin rules editor\n// and the public rules page render these, so they are declared once here instead of being\n// restated as literals on each surface (ENG-002). Copy uses the short settled terms Work /\n// Hall / Wing (ARCH-107).\n\nexport const WORK_PROJECT_TYPE_RULE_GROUP_TITLE = 'Work Type Rules';\nexport const HALL_WING_TYPE_RULE_GROUP_TITLE = 'Hall Wing Rules';\n\n// --- Stored-enum display labels ---\n// What a screen shows for a stored enum value, keyed by the canonical union so a new member fails\n// the build until it has its text. A screen renders the label, never the raw value.\n\n/** Guild invite statuses (a Work's invited-users list and an invite conversation's status line). */\nexport const GUILD_INVITE_STATUS_LABELS: Record<GuildInviteConversationStatus, string> = {\n pending: 'Pending',\n accepted: 'Accepted',\n declined: 'Declined',\n cancelled: 'Cancelled',\n finalized: 'Finalized',\n};\n\n/** Commission proposal statuses (a Work's proposals table). */\nexport const COMMISSION_PROPOSAL_STATUS_LABELS: Record<CommissionProposalStatus, string> = {\n open: 'Open',\n invited: 'Invited',\n accepted: 'Accepted',\n rejected: 'Rejected',\n};\n\n/** Chapter, track, and episode review statuses (the Tale, Tune, and Television section tables). */\nexport const HALL_SUB_ITEM_STATUS_LABELS: Record<HallSubItemStatus, string> = {\n unpublished: 'unpublished',\n pending_approval: 'Pending approval',\n published: 'published',\n};\n\n/** Audition statuses (the audition page). */\nexport const AUDITION_STATUS_LABELS: Record<Audition['status'], string> = {\n open: 'Open',\n closed: 'Closed',\n pendingReview: 'PendingReview',\n};\n\n/** Work types (Work lists, the Work overview, the Works popover). */\nexport const WORK_PROJECT_TYPE_LABELS: Record<WorkProjectType, string> = {\n Tales: 'Tales',\n Tunes: 'Tunes',\n Television: 'Television',\n};\n\n/** Invite source types, as the invite dialog names the context an invite was sent from. */\nexport const INVITE_SOURCE_TYPE_LABELS: Record<InviteSourceType, string> = {\n standalone: 'standalone',\n craftSkill: 'craftSkill',\n commission: 'commission',\n audition: 'audition',\n};\n\n/** Short-link target types (the admin Short Links list), in the target-type enum's order. */\nexport const SHORT_LINK_TARGET_TYPE_LABELS: Record<ShortLinkTargetType, string> = {\n audition: 'Audition',\n 'audition-entry': 'Audition entry',\n commission: 'Commission',\n 'hall-library-item': 'Hall entry',\n};\n\n/** Support-thread statuses (a member's Messages, a Work's Correspondence, the admin browse list). */\nexport const ADMIN_DISPATCH_STATUS_LABELS: Record<AdminDispatch['status'], string> = {\n open: 'Open',\n user_reply: 'User replied',\n admin_reply: 'Admin replied',\n closed_resolved: 'Resolved',\n closed_unresolved: 'Closed',\n};\n\n/** Who a support-thread message is from, as the admin thread preview labels it. */\nexport const ADMIN_DISPATCH_SENDER_ROLE_LABELS: Record<AdminDispatchSenderRole, string> = {\n user: 'User',\n admin: 'Admin',\n system: 'System',\n};\n\n/** Child-safety case work statuses (the safety case console's case rows and closed-case lookup). */\nexport const CHILD_SAFETY_CASE_WORK_STATUS_LABELS: Record<ChildSafetyWorkStatus, string> = {\n new: 'new',\n triaged: 'triaged',\n reporting: 'reporting',\n actioning: 'actioning',\n processing: 'processing',\n failed: 'failed',\n operationallyResolved: 'operationallyResolved',\n};\n\n/** NCII case statuses (the safety case console's case rows and closed-case lookup). */\nexport const NCII_CASE_STATUS_LABELS: Record<NciiInternalStatus, string> = {\n open: 'open',\n removalInProgress: 'removalInProgress',\n processing: 'processing',\n failed: 'failed',\n removed: 'removed',\n rejected: 'rejected',\n closed: 'closed',\n};\n"]}
@@ -21,6 +21,8 @@ export interface AuditionDeadlines {
21
21
  }
22
22
  /** Which minimum gap a pair of deadlines breaks. */
23
23
  export type AuditionDeadlineProblem = 'entriesCloseTooSoon' | 'auditionCloseTooSoon';
24
+ /** The refusal each broken minimum gap answers with — the server's refusal and the form's alike. */
25
+ export declare const AUDITION_DEADLINE_PROBLEM_MESSAGES: Record<AuditionDeadlineProblem, string>;
24
26
  /**
25
27
  * The deadline-pair rule every wire schema carrying both deadlines refines with: the audition
26
28
  * closes at least `AUDITION_MIN_VOTING_AFTER_ENTRIES_MS` after entries close. (The gap from the
@@ -1 +1 @@
1
- {"version":3,"file":"audition-deadlines.d.ts","sourceRoot":"","sources":["../../src/constants/audition-deadlines.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAM9D,qEAAqE;AACrE,eAAO,MAAM,4BAA4B,QAAa,CAAC;AAEvD,+FAA+F;AAC/F,eAAO,MAAM,oCAAoC,QAAe,CAAC;AAEjE,0FAA0F;AAC1F,eAAO,MAAM,mCAAmC,IAAI,CAAC;AAErD,kGAAkG;AAClG,eAAO,MAAM,yCAAyC,IAAI,CAAC;AAE3D,mFAAmF;AACnF,eAAO,MAAM,mBAAmB;;;CAAsC,CAAC;AAEvE,wCAAwC;AACxC,eAAO,MAAM,sBAAsB,aAA8B,CAAC;AAElE,MAAM,WAAW,iBAAiB;IAChC,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,oDAAoD;AACpD,MAAM,MAAM,uBAAuB,GAAG,qBAAqB,GAAG,sBAAsB,CAAC;AAErF;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,iBAAiB,EAAE,GAAG,EAAE,CAAC,CAAC,aAAa,GAAG,IAAI,CAIhG;AAED,oFAAoF;AACpF,wBAAgB,8BAA8B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEvE;AAED,wFAAwF;AACxF,wBAAgB,uBAAuB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAEtE;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,iBAAiB,EAC5B,QAAQ,EAAE,MAAM,GACf,uBAAuB,GAAG,IAAI,CAIhC;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAC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2BAA2B,CAAC,KAAK,EAAE,iBAAiB,EAAE,GAAG,EAAE,CAAC,CAAC,aAAa,GAAG,IAAI,CAIhG;AAED,oFAAoF;AACpF,wBAAgB,8BAA8B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEvE;AAED,wFAAwF;AACxF,wBAAgB,uBAAuB,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAEtE;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,iBAAiB,EAC5B,QAAQ,EAAE,MAAM,GACf,uBAAuB,GAAG,IAAI,CAIhC;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,QAAQ,GAAG,gBAAgB,CAAC,EACrD,WAAW,EAAE,MAAM,GAClB,OAAO,CAET;AAED,wFAAwF;AACxF,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,QAAQ,GAAG,iBAAiB,CAAC,EACtD,GAAG,EAAE,MAAM,GACV,OAAO,CAET;AAMD,yFAAyF;AACzF,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,IAAI,GAAG,IAAI,CAM/D;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,cAAc,EAAE,IAAI,GAAG,IAAI,CAQjE"}
@@ -21,6 +21,11 @@ export const AUDITION_DEFAULT_CLOSE_AFTER_ENTRIES_DAYS = 1;
21
21
  export const AUDITION_END_OF_DAY = { hours: 23, minutes: 59 };
22
22
  /** One deadline: epoch milliseconds. */
23
23
  export const AuditionDeadlineSchema = z.number().int().positive();
24
+ /** The refusal each broken minimum gap answers with — the server's refusal and the form's alike. */
25
+ export const AUDITION_DEADLINE_PROBLEM_MESSAGES = {
26
+ entriesCloseTooSoon: `Entries must stay open for at least ${AUDITION_MIN_ENTRY_WINDOW_MS / DAY_MS} days after posting.`,
27
+ auditionCloseTooSoon: `The audition must close at least ${AUDITION_MIN_VOTING_AFTER_ENTRIES_MS / HOUR_MS} hours after entries close.`,
28
+ };
24
29
  /**
25
30
  * The deadline-pair rule every wire schema carrying both deadlines refines with: the audition
26
31
  * closes at least `AUDITION_MIN_VOTING_AFTER_ENTRIES_MS` after entries close. (The gap from the
@@ -1 +1 @@
1
- {"version":3,"file":"audition-deadlines.js","sourceRoot":"","sources":["../../src/constants/audition-deadlines.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,+FAA+F;AAC/F,sFAAsF;AACtF,uEAAuE;AACvE,8FAA8F;AAC9F,6FAA6F;AAC7F,kDAAkD;AAElD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,SAAS,GAAG,EAAE,GAAG,IAAI,CAAC;AAC5B,MAAM,OAAO,GAAG,EAAE,GAAG,SAAS,CAAC;AAC/B,MAAM,MAAM,GAAG,EAAE,GAAG,OAAO,CAAC;AAE5B,qEAAqE;AACrE,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,GAAG,MAAM,CAAC;AAEvD,+FAA+F;AAC/F,MAAM,CAAC,MAAM,oCAAoC,GAAG,EAAE,GAAG,OAAO,CAAC;AAEjE,0FAA0F;AAC1F,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC,CAAC;AAErD,kGAAkG;AAClG,MAAM,CAAC,MAAM,yCAAyC,GAAG,CAAC,CAAC;AAE3D,mFAAmF;AACnF,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAW,CAAC;AAEvE,wCAAwC;AACxC,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC;AAUlE;;;;;;GAMG;AACH,MAAM,UAAU,2BAA2B,CAAC,KAAwB,EAAE,GAAoB;IACxF,IAAI,KAAK,CAAC,eAAe,GAAG,KAAK,CAAC,cAAc,GAAG,oCAAoC,EAAE,CAAC;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C,KAAW;IACvD,OAAO,aAAa,CAClB,KAAK,CAAC,WAAW,EAAE,EACnB,KAAK,CAAC,QAAQ,EAAE,EAChB,KAAK,CAAC,OAAO,EAAE,GAAG,mCAAmC,GAAG,CAAC,CAC1D,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAC,cAAoB;IACzD,IAAI,MAAM,GAAG,yCAAyC,CAAC;IACvD,IAAI,SAAS,GAAG,aAAa,CAAC,cAAc,CAAC,WAAW,EAAE,EAAE,cAAc,CAAC,QAAQ,EAAE,EAAE,cAAc,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC,CAAC;IAC1H,OAAO,SAAS,CAAC,OAAO,EAAE,GAAG,uBAAuB,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC;QAC/E,MAAM,IAAI,CAAC,CAAC;QACZ,SAAS,GAAG,aAAa,CAAC,cAAc,CAAC,WAAW,EAAE,EAAE,cAAc,CAAC,QAAQ,EAAE,EAAE,cAAc,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC,CAAC;IACxH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["// An audition's two deadlines, both picked by its poster:\n// - entries close (`entriesCloseAt`) — an entry counts by the moment it was SUBMITTED, so one\n// uploaded before the cut-off still publishes if its processing finishes after it;\n// - the audition closes (`auditionCloseAt`) — voting runs until then.\n// Entries and voting both open when the audition is posted. The server enforces both cut-offs\n// exactly through the predicates below; the daily job only tidies `status`. The UI offers an\n// action from the same predicates (FRONTEND-110).\n\nimport { z } from 'zod';\nimport type { Audition } from '../doc-schemas/commissions.js';\n\nconst MINUTE_MS = 60 * 1000;\nconst HOUR_MS = 60 * MINUTE_MS;\nconst DAY_MS = 24 * HOUR_MS;\n\n/** Entries close at least this long after the audition is posted. */\nexport const AUDITION_MIN_ENTRY_WINDOW_MS = 7 * DAY_MS;\n\n/** The audition closes at least this long after entries close (voting continues meanwhile). */\nexport const AUDITION_MIN_VOTING_AFTER_ENTRIES_MS = 24 * HOUR_MS;\n\n/** The entries-close picker opens this many weeks after today, at the end of that day. */\nexport const AUDITION_DEFAULT_ENTRY_WINDOW_WEEKS = 3;\n\n/** The audition-close picker opens this many days after entries close, at the end of that day. */\nexport const AUDITION_DEFAULT_CLOSE_AFTER_ENTRIES_DAYS = 1;\n\n/** End of a day, as the date-and-time picker expresses it: 11:59 PM local time. */\nexport const AUDITION_END_OF_DAY = { hours: 23, minutes: 59 } as const;\n\n/** One deadline: epoch milliseconds. */\nexport const AuditionDeadlineSchema = z.number().int().positive();\n\nexport interface AuditionDeadlines {\n entriesCloseAt: number;\n auditionCloseAt: number;\n}\n\n/** Which minimum gap a pair of deadlines breaks. */\nexport type AuditionDeadlineProblem = 'entriesCloseTooSoon' | 'auditionCloseTooSoon';\n\n/**\n * The deadline-pair rule every wire schema carrying both deadlines refines with: the audition\n * closes at least `AUDITION_MIN_VOTING_AFTER_ENTRIES_MS` after entries close. (The gap from the\n * posting time depends on WHEN the audition is posted, so it is checked by\n * `auditionDeadlineProblem` at the moment of posting, never inside a schema a later step\n * re-parses.)\n */\nexport function refineAuditionDeadlineOrder(value: AuditionDeadlines, ctx: z.RefinementCtx): void {\n if (value.auditionCloseAt < value.entriesCloseAt + AUDITION_MIN_VOTING_AFTER_ENTRIES_MS) {\n ctx.addIssue({ code: 'custom', path: ['auditionCloseAt'] });\n }\n}\n\n/** The earliest allowed entries-close time for an audition posted at `postedAt`. */\nexport function earliestAuditionEntriesCloseAt(postedAt: number): number {\n return postedAt + AUDITION_MIN_ENTRY_WINDOW_MS;\n}\n\n/** The earliest allowed audition-close time for entries closing at `entriesCloseAt`. */\nexport function earliestAuditionCloseAt(entriesCloseAt: number): number {\n return entriesCloseAt + AUDITION_MIN_VOTING_AFTER_ENTRIES_MS;\n}\n\n/**\n * Which minimum gap `deadlines` break for an audition posted at `postedAt` — the submit time\n * of its upload — or `null` when both hold.\n */\nexport function auditionDeadlineProblem(\n deadlines: AuditionDeadlines,\n postedAt: number,\n): AuditionDeadlineProblem | null {\n if (deadlines.entriesCloseAt < earliestAuditionEntriesCloseAt(postedAt)) return 'entriesCloseTooSoon';\n if (deadlines.auditionCloseAt < earliestAuditionCloseAt(deadlines.entriesCloseAt)) return 'auditionCloseTooSoon';\n return null;\n}\n\n/**\n * Whether an entry submitted at `submittedAt` is in time: the audition is open and the entry\n * was submitted before entries closed. The server passes the upload's submit time (so a\n * slow-processing entry submitted in time still counts); the UI passes now.\n */\nexport function areAuditionEntriesOpen(\n audition: Pick<Audition, 'status' | 'entriesCloseAt'>,\n submittedAt: number,\n): boolean {\n return audition.status === 'open' && submittedAt < audition.entriesCloseAt;\n}\n\n/** Whether a vote cast at `now` is in time: the audition is open and has not closed. */\nexport function isAuditionVotingOpen(\n audition: Pick<Audition, 'status' | 'auditionCloseAt'>,\n now: number,\n): boolean {\n return audition.status === 'open' && now < audition.auditionCloseAt;\n}\n\nfunction endOfLocalDay(year: number, monthIndex: number, day: number): Date {\n return new Date(year, monthIndex, day, AUDITION_END_OF_DAY.hours, AUDITION_END_OF_DAY.minutes, 0, 0);\n}\n\n/** Where the entries-close picker opens: the end of the day three weeks from `today`. */\nexport function defaultAuditionEntriesCloseAt(today: Date): Date {\n return endOfLocalDay(\n today.getFullYear(),\n today.getMonth(),\n today.getDate() + AUDITION_DEFAULT_ENTRY_WINDOW_WEEKS * 7,\n );\n}\n\n/**\n * Where the audition-close picker opens: the end of the day after entries close — or of the\n * next day that keeps the 24-hour minimum, should a clock change shorten that day.\n */\nexport function defaultAuditionCloseAt(entriesCloseAt: Date): Date {\n let offset = AUDITION_DEFAULT_CLOSE_AFTER_ENTRIES_DAYS;\n let candidate = endOfLocalDay(entriesCloseAt.getFullYear(), entriesCloseAt.getMonth(), entriesCloseAt.getDate() + offset);\n while (candidate.getTime() < earliestAuditionCloseAt(entriesCloseAt.getTime())) {\n offset += 1;\n candidate = endOfLocalDay(entriesCloseAt.getFullYear(), entriesCloseAt.getMonth(), entriesCloseAt.getDate() + offset);\n }\n return candidate;\n}\n"]}
1
+ {"version":3,"file":"audition-deadlines.js","sourceRoot":"","sources":["../../src/constants/audition-deadlines.ts"],"names":[],"mappings":"AAAA,0DAA0D;AAC1D,+FAA+F;AAC/F,sFAAsF;AACtF,uEAAuE;AACvE,8FAA8F;AAC9F,6FAA6F;AAC7F,kDAAkD;AAElD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,SAAS,GAAG,EAAE,GAAG,IAAI,CAAC;AAC5B,MAAM,OAAO,GAAG,EAAE,GAAG,SAAS,CAAC;AAC/B,MAAM,MAAM,GAAG,EAAE,GAAG,OAAO,CAAC;AAE5B,qEAAqE;AACrE,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,GAAG,MAAM,CAAC;AAEvD,+FAA+F;AAC/F,MAAM,CAAC,MAAM,oCAAoC,GAAG,EAAE,GAAG,OAAO,CAAC;AAEjE,0FAA0F;AAC1F,MAAM,CAAC,MAAM,mCAAmC,GAAG,CAAC,CAAC;AAErD,kGAAkG;AAClG,MAAM,CAAC,MAAM,yCAAyC,GAAG,CAAC,CAAC;AAE3D,mFAAmF;AACnF,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAW,CAAC;AAEvE,wCAAwC;AACxC,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC;AAUlE,oGAAoG;AACpG,MAAM,CAAC,MAAM,kCAAkC,GAA4C;IACzF,mBAAmB,EAAE,uCAAuC,4BAA4B,GAAG,MAAM,sBAAsB;IACvH,oBAAoB,EAAE,oCAAoC,oCAAoC,GAAG,OAAO,6BAA6B;CACtI,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,UAAU,2BAA2B,CAAC,KAAwB,EAAE,GAAoB;IACxF,IAAI,KAAK,CAAC,eA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ACvG,CAAC;AAED,yFAAyF;AACzF,MAAM,UAAU,6BAA6B,CAAC,KAAW;IACvD,OAAO,aAAa,CAClB,KAAK,CAAC,WAAW,EAAE,EACnB,KAAK,CAAC,QAAQ,EAAE,EAChB,KAAK,CAAC,OAAO,EAAE,GAAG,mCAAmC,GAAG,CAAC,CAC1D,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,sBAAsB,CAAC,cAAoB;IACzD,IAAI,MAAM,GAAG,yCAAyC,CAAC;IACvD,IAAI,SAAS,GAAG,aAAa,CAAC,cAAc,CAAC,WAAW,EAAE,EAAE,cAAc,CAAC,QAAQ,EAAE,EAAE,cAAc,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC,CAAC;IAC1H,OAAO,SAAS,CAAC,OAAO,EAAE,GAAG,uBAAuB,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC;QAC/E,MAAM,IAAI,CAAC,CAAC;QACZ,SAAS,GAAG,aAAa,CAAC,cAAc,CAAC,WAAW,EAAE,EAAE,cAAc,CAAC,QAAQ,EAAE,EAAE,cAAc,CAAC,OAAO,EAAE,GAAG,MAAM,CAAC,CAAC;IACxH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["// An audition's two deadlines, both picked by its poster:\n// - entries close (`entriesCloseAt`) — an entry counts by the moment it was SUBMITTED, so one\n// uploaded before the cut-off still publishes if its processing finishes after it;\n// - the audition closes (`auditionCloseAt`) — voting runs until then.\n// Entries and voting both open when the audition is posted. The server enforces both cut-offs\n// exactly through the predicates below; the daily job only tidies `status`. The UI offers an\n// action from the same predicates (FRONTEND-110).\n\nimport { z } from 'zod';\nimport type { Audition } from '../doc-schemas/commissions.js';\n\nconst MINUTE_MS = 60 * 1000;\nconst HOUR_MS = 60 * MINUTE_MS;\nconst DAY_MS = 24 * HOUR_MS;\n\n/** Entries close at least this long after the audition is posted. */\nexport const AUDITION_MIN_ENTRY_WINDOW_MS = 7 * DAY_MS;\n\n/** The audition closes at least this long after entries close (voting continues meanwhile). */\nexport const AUDITION_MIN_VOTING_AFTER_ENTRIES_MS = 24 * HOUR_MS;\n\n/** The entries-close picker opens this many weeks after today, at the end of that day. */\nexport const AUDITION_DEFAULT_ENTRY_WINDOW_WEEKS = 3;\n\n/** The audition-close picker opens this many days after entries close, at the end of that day. */\nexport const AUDITION_DEFAULT_CLOSE_AFTER_ENTRIES_DAYS = 1;\n\n/** End of a day, as the date-and-time picker expresses it: 11:59 PM local time. */\nexport const AUDITION_END_OF_DAY = { hours: 23, minutes: 59 } as const;\n\n/** One deadline: epoch milliseconds. */\nexport const AuditionDeadlineSchema = z.number().int().positive();\n\nexport interface AuditionDeadlines {\n entriesCloseAt: number;\n auditionCloseAt: number;\n}\n\n/** Which minimum gap a pair of deadlines breaks. */\nexport type AuditionDeadlineProblem = 'entriesCloseTooSoon' | 'auditionCloseTooSoon';\n\n/** The refusal each broken minimum gap answers with — the server's refusal and the form's alike. */\nexport const AUDITION_DEADLINE_PROBLEM_MESSAGES: Record<AuditionDeadlineProblem, string> = {\n entriesCloseTooSoon: `Entries must stay open for at least ${AUDITION_MIN_ENTRY_WINDOW_MS / DAY_MS} days after posting.`,\n auditionCloseTooSoon: `The audition must close at least ${AUDITION_MIN_VOTING_AFTER_ENTRIES_MS / HOUR_MS} hours after entries close.`,\n};\n\n/**\n * The deadline-pair rule every wire schema carrying both deadlines refines with: the audition\n * closes at least `AUDITION_MIN_VOTING_AFTER_ENTRIES_MS` after entries close. (The gap from the\n * posting time depends on WHEN the audition is posted, so it is checked by\n * `auditionDeadlineProblem` at the moment of posting, never inside a schema a later step\n * re-parses.)\n */\nexport function refineAuditionDeadlineOrder(value: AuditionDeadlines, ctx: z.RefinementCtx): void {\n if (value.auditionCloseAt < value.entriesCloseAt + AUDITION_MIN_VOTING_AFTER_ENTRIES_MS) {\n ctx.addIssue({ code: 'custom', path: ['auditionCloseAt'] });\n }\n}\n\n/** The earliest allowed entries-close time for an audition posted at `postedAt`. */\nexport function earliestAuditionEntriesCloseAt(postedAt: number): number {\n return postedAt + AUDITION_MIN_ENTRY_WINDOW_MS;\n}\n\n/** The earliest allowed audition-close time for entries closing at `entriesCloseAt`. */\nexport function earliestAuditionCloseAt(entriesCloseAt: number): number {\n return entriesCloseAt + AUDITION_MIN_VOTING_AFTER_ENTRIES_MS;\n}\n\n/**\n * Which minimum gap `deadlines` break for an audition posted at `postedAt` — the submit time\n * of its upload — or `null` when both hold.\n */\nexport function auditionDeadlineProblem(\n deadlines: AuditionDeadlines,\n postedAt: number,\n): AuditionDeadlineProblem | null {\n if (deadlines.entriesCloseAt < earliestAuditionEntriesCloseAt(postedAt)) return 'entriesCloseTooSoon';\n if (deadlines.auditionCloseAt < earliestAuditionCloseAt(deadlines.entriesCloseAt)) return 'auditionCloseTooSoon';\n return null;\n}\n\n/**\n * Whether an entry submitted at `submittedAt` is in time: the audition is open and the entry\n * was submitted before entries closed. The server passes the upload's submit time (so a\n * slow-processing entry submitted in time still counts); the UI passes now.\n */\nexport function areAuditionEntriesOpen(\n audition: Pick<Audition, 'status' | 'entriesCloseAt'>,\n submittedAt: number,\n): boolean {\n return audition.status === 'open' && submittedAt < audition.entriesCloseAt;\n}\n\n/** Whether a vote cast at `now` is in time: the audition is open and has not closed. */\nexport function isAuditionVotingOpen(\n audition: Pick<Audition, 'status' | 'auditionCloseAt'>,\n now: number,\n): boolean {\n return audition.status === 'open' && now < audition.auditionCloseAt;\n}\n\nfunction endOfLocalDay(year: number, monthIndex: number, day: number): Date {\n return new Date(year, monthIndex, day, AUDITION_END_OF_DAY.hours, AUDITION_END_OF_DAY.minutes, 0, 0);\n}\n\n/** Where the entries-close picker opens: the end of the day three weeks from `today`. */\nexport function defaultAuditionEntriesCloseAt(today: Date): Date {\n return endOfLocalDay(\n today.getFullYear(),\n today.getMonth(),\n today.getDate() + AUDITION_DEFAULT_ENTRY_WINDOW_WEEKS * 7,\n );\n}\n\n/**\n * Where the audition-close picker opens: the end of the day after entries close — or of the\n * next day that keeps the 24-hour minimum, should a clock change shorten that day.\n */\nexport function defaultAuditionCloseAt(entriesCloseAt: Date): Date {\n let offset = AUDITION_DEFAULT_CLOSE_AFTER_ENTRIES_DAYS;\n let candidate = endOfLocalDay(entriesCloseAt.getFullYear(), entriesCloseAt.getMonth(), entriesCloseAt.getDate() + offset);\n while (candidate.getTime() < earliestAuditionCloseAt(entriesCloseAt.getTime())) {\n offset += 1;\n candidate = endOfLocalDay(entriesCloseAt.getFullYear(), entriesCloseAt.getMonth(), entriesCloseAt.getDate() + offset);\n }\n return candidate;\n}\n"]}
@@ -50,7 +50,6 @@ export declare const ChatSyncEventSchema: z.ZodObject<{
50
50
  config: "config";
51
51
  channelAuth: "channelAuth";
52
52
  accountAccess: "accountAccess";
53
- serverMessage: "serverMessage";
54
53
  }>;
55
54
  version: z.ZodNumber;
56
55
  payload: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
@@ -1 +1 @@
1
- {"version":3,"file":"chat-sync.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/chat-sync.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;iBAc1C,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAIxF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;iBAUlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,eAAO,MAAM,4BAA4B;;;;;;;;iBAKvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAGlF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiB9B,CAAC;AACH,MAAM,M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AsB5C,CAAC;AACH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAK5F,eAAO,MAAM,2CAA2C;;;;;;;;;;;;;;iBAQtD,CAAC;AACH,MAAM,MAAM,qCAAqC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2CAA2C,CAAC,CAAC;AAUhH,eAAO,MAAM,6BAA6B,iDAAkD,CAAC;AAC7F,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;kBASnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
@@ -7,7 +7,7 @@
7
7
  // which is a real Firestore `Timestamp` (modeled as `unknown` so the drift-check
8
8
  // does not false-flag a Timestamp object against `z.number()`).
9
9
  import { z } from 'zod';
10
- import { ChatParkedDeliveryReportSchema } from '@ttt-productions/chat-schemas';
10
+ import { CHAT_OUTBOX_COMMAND_KINDS, CHAT_SYNC_APPLY_KINDS, ChatParkedDeliveryReportSchema, } from '@ttt-productions/chat-schemas';
11
11
  import { systemRoleSchema } from '../schemas/atoms.js';
12
12
  import { GUILD_CHAT_CONVERSATION_KINDS } from '../ids/guild-chat-conversation.js';
13
13
  /** Native-TTL field — a real Firestore Timestamp (NOT epoch-ms). Absent until the terminal that sets TTL. */
@@ -52,7 +52,8 @@ export const ChatScopeDegradedCauseSchema = z.object({
52
52
  export const ChatSyncEventSchema = z.object({
53
53
  eventId: z.string(),
54
54
  targetDo: z.string(),
55
- kind: z.enum(['channelAuth', 'accountAccess', 'config', 'serverMessage']),
55
+ // The room applies only the chat-schemas apply kinds, so a row holds nothing else.
56
+ kind: z.enum(CHAT_SYNC_APPLY_KINDS),
56
57
  version: z.number(),
57
58
  payload: z.record(z.string(), z.unknown()).nullable(),
58
59
  tombstone: z.boolean().optional(),
@@ -122,7 +123,7 @@ export const ChatSyncFanoutJobSchema = z.discriminatedUnion('selectorKind', [
122
123
  // ── chatMessageOutbox/{commandId} ───────────────────────────────────────────
123
124
  export const ChatMessageOutboxSchema = z.object({
124
125
  commandId: z.string(),
125
- kind: z.enum(['userMsg', 'systemMsg']),
126
+ kind: z.enum(CHAT_OUTBOX_COMMAND_KINDS),
126
127
  threadRef: z.string(),
127
128
  payload: z.record(z.string(), z.unknown()),
128
129
  payloadVersion: z.number(),
@@ -1 +1 @@
1
- {"version":3,"file":"chat-sync.js","sourceRoot":"","sources":["../../src/doc-schemas/chat-sync.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,+EAA+E;AAC/E,gFAAgF;AAChF,mFAAmF;AACnF,+EAA+E;AAC/E,iFAAiF;AACjF,iFAAiF;AACjF,gEAAgE;AAEhE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,8BAA8B,EAAE,MAAM,+BAA+B,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,6BAA6B,EAAE,MAAM,mCAAmC,CAAC;AAElF,6GAA6G;AAC7G,MAAM,aAAa,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC;AAE7C,+EAA+E;AAC/E,+EAA+E;AAC/E,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,MAAM,CAAC;IACtD,eAAe,EAAE,CAAC,CAAC,IAAI,CAAC,6BAA6B,CAAC;IACtD,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACzC,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;IACf,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,gBAAgB,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,YA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S,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,QAAQ,EAAE,aAAa;CACxB,CAAC,CAAC","sourcesContent":["// Chat realtime SYNC / projection / command Firestore schemas (chat-edge-rebuild P1).\n// The chat sync / projection / command (Firestore-side) field lists are FROZEN\n// here — this file is their single source; the durable design owner is ttt-prod\n// docs/design/chat-realtime-system.md. All of these collections are Admin-SDK-only\n// (`allow read, write: if false`). Per the TTT timestamp convention every time\n// field is epoch-ms `number`; the SINGLE exception is the native-TTL `expireAt`,\n// which is a real Firestore `Timestamp` (modeled as `unknown` so the drift-check\n// does not false-flag a Timestamp object against `z.number()`).\n\nimport { z } from 'zod';\nimport { ChatParkedDeliveryReportSchema } from '@ttt-productions/chat-schemas';\nimport { systemRoleSchema } from '../schemas/atoms.js';\nimport { GUILD_CHAT_CONVERSATION_KINDS } from '../ids/guild-chat-conversation.js';\n\n/** Native-TTL field — a real Firestore Timestamp (NOT epoch-ms). Absent until the terminal that sets TTL. */\nconst expireAtField = z.unknown().optional();\n\n// ── chatChannelAuthProjections/{authPairKey} ────────────────────────────────\n// Per-(user, channel) authorization FACT. Absent ⇒ removed/deny (fail-closed).\nexport const ChatChannelAuthProjectionSchema = z.object({\n channelRefScope: z.enum(GUILD_CHAT_CONVERSATION_KINDS),\n workProjectId: z.string().nullable(),\n guildChatChannelId: z.string().nullable(),\n guildInviteId: z.string().nullable(),\n uid: z.string(),\n channelKey: z.string(),\n channelAuthState: z.enum(['authorized', 'removed']),\n channelAuthVersion: z.number(),\n inputFingerprint: z.string(),\n updatedAt: z.number(),\n // Reconcile cursor — advanced on every reconciler visit, including a no-op one, so a stuck\n // window rotates. Absent until the reconciler first reaches the projection.\n lastReconciledAt: z.number().optional(),\n});\nexport type ChatChannelAuthProjection = z.infer<typeof ChatChannelAuthProjectionSchema>;\n\n// ── chatScopeDegraded/{scopeKey} (+ causes/{causeId}) ───────────────────────\n// Exists IFF unresolvedCauseCount > 0. Grant mints fail closed while it exists.\nexport const ChatScopeDegradedSchema = z.object({\n scopeKey: z.string(),\n scopeKind: z.enum(['channel', 'memberInWork']),\n // channel scope carries the channelRef tuple; memberInWork carries {uid, workProjectId}.\n workProjectId: z.string().nullable(),\n guildChatChannelId: z.string().nullable(),\n guildInviteId: z.string().nullable(),\n uid: z.string().nullable(),\n unresolvedCauseCount: z.number(),\n updatedAt: z.number(),\n});\nexport type ChatScopeDegraded = z.infer<typeof ChatScopeDegradedSchema>;\n\nexport const ChatScopeDegradedCauseSchema = z.object({\n causeId: z.string(),\n kind: z.enum(['syncEvent', 'fanoutJob']),\n ref: z.string(),\n deadLetteredAt: z.number(),\n});\nexport type ChatScopeDegradedCause = z.infer<typeof ChatScopeDegradedCauseSchema>;\n\n// ── chatSyncEvents/{eventId} ────────────────────────────────────────────────\nexport const ChatSyncEventSchema = z.object({\n eventId: z.string(),\n targetDo: z.string(),\n kind: z.enum(['channelAuth', 'accountAccess', 'config', 'serverMessage']),\n version: z.number(),\n payload: z.record(z.string(), z.unknown()).nullable(),\n tombstone: z.boolean().optional(),\n payloadHash: z.string(),\n status: z.enum(['pending', 'delivered', 'deadLetter']),\n attemptCount: z.number(),\n nextAttemptAt: z.number(),\n lastError: z.string().nullable(),\n createdAt: z.number(),\n deliveredResult: z.record(z.string(), z.unknown()).nullable(),\n deliveredAt: z.number().nullable(),\n deadLetteredAt: z.number().nullable(),\n expireAt: expireAtField,\n});\nexport type ChatSyncEvent = z.infer<typeof ChatSyncEventSchema>;\n\n// ── chatSyncFanoutJobs/{jobId} ──────────────────────────────────────────────\n// The selector is a closed discriminated contract. The worker has different expansion\n// semantics for a Work-channel page, a member-in-Work page, and the fixed two-person\n// invite re-drive; a loose optional bag lets malformed persisted jobs silently wedge.\nconst ChatSyncFanoutJobBaseShape = {\n jobId: z.string(),\n causeVersion: z.number(),\n cursor: z.object({ pageIndex: z.number(), lastDocId: z.string().nullable() }),\n revision: z.number(),\n status: z.enum(['pending', 'complete', 'deadLetter']),\n attemptCount: z.number(),\n nextAttemptAt: z.number(),\n lastError: z.string().nullable(),\n createdAt: z.number(),\n completedAt: z.number().nullable(),\n deadLetteredAt: z.number().nullable(),\n expireAt: expireAtField,\n};\n\nconst channelFanoutSelectorArgs = z.object({\n workProjectId: z.string().min(1),\n guildChatChannelId: z.string().min(1),\n channelKey: z.string().min(1),\n}).strict();\n\nconst inviteParticipantsSelectorArgs = z.object({\n guildInviteId: z.string().min(1),\n participantUids: z.array(z.string().min(1)).length(2).refine(\n (uids) => new Set(uids).size === uids.length,\n { message: 'Invite participant uids must be distinct.' },\n ),\n}).strict();\n\nexport const ChatSyncFanoutJobSchema = z.discriminatedUnion('selectorKind', [\n z.object({\n ...ChatSyncFanoutJobBaseShape,\n selectorKind: z.literal('channelMembers'),\n selectorArgs: channelFanoutSelectorArgs,\n }).strict(),\n z.object({\n ...ChatSyncFanoutJobBaseShape,\n selectorKind: z.literal('policyEditAffectedUsers'),\n selectorArgs: channelFanoutSelectorArgs,\n }).strict(),\n z.object({\n ...ChatSyncFanoutJobBaseShape,\n selectorKind: z.literal('workChannelsForUser'),\n selectorArgs: z.object({\n uid: z.string().min(1),\n workProjectId: z.string().min(1),\n }).strict(),\n }).strict(),\n z.object({\n ...ChatSyncFanoutJobBaseShape,\n selectorKind: z.literal('inviteParticipants'),\n selectorArgs: inviteParticipantsSelectorArgs,\n }).strict(),\n]);\nexport type ChatSyncFanoutJob = z.infer<typeof ChatSyncFanoutJobSchema>;\n\n// ── chatMessageOutbox/{commandId} ───────────────────────────────────────────\nexport const ChatMessageOutboxSchema = z.object({\n commandId: z.string(),\n kind: z.enum(['userMsg', 'systemMsg']),\n threadRef: z.string(),\n payload: z.record(z.string(), z.unknown()),\n payloadVersion: z.number(),\n status: z.enum(['pending', 'applied', 'deadLetter']),\n attemptCount: z.number(),\n nextAttemptAt: z.number(),\n lastError: z.string().nullable(),\n createdAt: z.number(),\n appliedAt: z.number().nullable(),\n deadLetteredAt: z.number().nullable(),\n expireAt: expireAtField,\n});\nexport type ChatMessageOutbox = z.infer<typeof ChatMessageOutboxSchema>;\n\n// ── chatAdminActionCommands/{requestId} ─────────────────────────────────────\n// `requestId` IS the doc id + DO dedup key. `delivering` is NOT a lease (it sets\n// nextAttemptAt = now + DELIVERY_TIMEOUT). terminalFailureGeneration default 0.\nexport const ChatAdminActionCommandSchema = z.object({\n requestId: z.string(),\n actorUid: z.string(),\n actorMode: z.enum(['adminReview', 'adminOverride']),\n systemRole: systemRoleSchema,\n channelRef: z.record(z.string(), z.unknown()),\n messageSeq: z.number(),\n action: z.enum(['hide', 'delete']),\n caseId: z.string(),\n reason: z.string(),\n expectedMessageRevision: z.number(),\n payloadHash: z.string(),\n // `safetyRepair` is the NONTERMINAL stall loop: a RESERVED command whose reconcile\n // leg (PROBE → FINALIZE) failed past ADMIN_COMMAND_MAX_ATTEMPTS. Drained like\n // `delivering`; never dead-letters.\n state: z.enum(['queued', 'delivering', 'safetyRepair', 'applied', 'failed', 'deadLetter']),\n attemptCount: z.number(),\n nextAttemptAt: z.number(),\n lastError: z.string().nullable(),\n result: z.record(z.string(), z.unknown()).nullable(),\n doRevisionId: z.string().nullable(),\n terminalFailureGeneration: z.number(),\n createdAt: z.number(),\n appliedAt: z.number().nullable(),\n failedAt: z.number().nullable(),\n deadLetteredAt: z.number().nullable(),\n reconciled: z.boolean(),\n reconciledAt: z.number().nullable(),\n safetyRepair: z.boolean(),\n // Monotonic counter of distinct entries into the safety-repair loop — keys the\n // per-entry idempotent failure audit.\n safetyRepairGeneration: z.number(),\n // Failed reconcile passes on an already-reserved command. Separate from\n // `attemptCount` (delivery attempts, which dead-letter); at the cap it escalates\n // once into `safetyRepair` instead of dead-lettering.\n reconcileAttemptCount: z.number(),\n expireAt: expireAtField,\n});\nexport type ChatAdminActionCommand = z.infer<typeof ChatAdminActionCommandSchema>;\n\n// ── chatHistoryAnonymizationJobs/{jobId} ────────────────────────────────────\n// Account-deletion history anonymization (Contract F; P8). Resumable + crash-safe:\n// the recorded source-manifest identity (key/hash/generation) + the three cursors\n// (scan/rewrite/delete) make every boundary restartable. jobId =\n// hash('chat-anonymize', channelDoId, epoch, anonymizedUid). `expireAt` (native TTL)\n// is set ONLY when the job reaches `done`.\n//\n// C-B1: the replacement generation is DO-OWNED — the Channel DO (single-threaded per\n// channel) allocates a DISTINCT monotonic generation per erasure off the epoch row and\n// rewrites against the CURRENT live manifest, so two erasures on one epoch chain instead\n// of colliding on a shared `anon-1` keyspace. These four fields are therefore RECORDED AT\n// SCAN (null until the DO reports/allocates them), not pinned at enqueue; if a concurrent\n// anonymization supersedes the source between scan and swap, the job resets to `scanning`\n// to re-derive against the new current manifest (keeping its own allocated generation).\nexport const ChatHistoryAnonymizationJobSchema = z.object({\n jobId: z.string(),\n channelDoId: z.string(),\n epoch: z.number(),\n anonymizedUid: z.string(),\n sourceManifestKey: z.string().nullable(),\n sourceManifestHash: z.string().nullable(),\n sourceGeneration: z.number().nullable(),\n replacementGeneration: z.number().nullable(),\n newManifestKey: z.string().nullable(),\n scanCursor: z.number(),\n rewriteCursor: z.number(),\n deleteCursor: z.number(),\n swappedAt: z.number().nullable(),\n state: z.enum(['scanning', 'rewriting', 'swapping', 'deleting', 'done', 'failed']),\n legalHoldPaused: z.boolean(),\n attemptCount: z.number(),\n nextAttemptAt: z.number(),\n lastError: z.string().nullable(),\n createdAt: z.number(),\n updatedAt: z.number(),\n expireAt: expireAtField,\n});\nexport type ChatHistoryAnonymizationJob = z.infer<typeof ChatHistoryAnonymizationJobSchema>;\n\n// ── chatHistoryAnonymizationJobs/{jobId}/affectedChunks/{chunkOrdinal} ───────\n// The non-contiguous affected-chunk set (round-16 finding 7) — a crash after the\n// manifest swap resumes deletion from these rows + `deleteCursor` without re-listing R2.\nexport const ChatHistoryAnonymizationAffectedChunkSchema = z.object({\n chunkOrdinal: z.number(),\n sourceChunkKey: z.string(),\n sourceSha256: z.string(),\n replacementChunkKey: z.string().nullable(),\n replacementSha256: z.string().nullable(),\n rewriteState: z.enum(['pending', 'done']),\n deleteState: z.enum(['pending', 'done']),\n});\nexport type ChatHistoryAnonymizationAffectedChunk = z.infer<typeof ChatHistoryAnonymizationAffectedChunkSchema>;\n\n// ── chatParkedDeliveries/{deliveryId} ───────────────────────────────────────\n// One delivery a chat room parked in its own outbox, as the room reported it through its signed\n// call (the report's fields, from the chat contract), plus the server-side replay ledger. The row\n// is created `deadLetter` (create-if-absent on `chatParkedDeliveryId`), so it lists with every\n// other dead-lettered row; an operator replay resets it to `pending` (the generic ledger reset —\n// `attemptCount`, `nextAttemptAt`, `lastError`, `deadLetteredAt`, `expireAt`); the server's replay\n// drain asks the room to requeue it and marks it `delivered` (and sets `expireAt`) on a `requeued`\n// or `not-parked` answer, or parks it `deadLetter` again once its own retries run out.\nexport const CHAT_PARKED_DELIVERY_STATUSES = ['deadLetter', 'pending', 'delivered'] as const;\nexport const ChatParkedDeliverySchema = ChatParkedDeliveryReportSchema.extend({\n status: z.enum(CHAT_PARKED_DELIVERY_STATUSES),\n attemptCount: z.number().int().nonnegative(),\n nextAttemptAt: z.number(),\n lastError: z.string().nullable(),\n createdAt: z.number(),\n deadLetteredAt: z.number().nullable(),\n deliveredAt: z.number().nullable(),\n expireAt: expireAtField,\n});\nexport type ChatParkedDelivery = z.infer<typeof ChatParkedDeliverySchema>;\n"]}
1
+ {"version":3,"file":"chat-sync.js","sourceRoot":"","sources":["../../src/doc-schemas/chat-sync.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,+EAA+E;AAC/E,gFAAgF;AAChF,mFAAmF;AACnF,+EAA+E;AAC/E,iFAAiF;AACjF,iFAAiF;AACjF,gEAAgE;AAEhE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,yBAAyB,EACzB,qBAAqB,EACrB,8BAA8B,GAC/B,MAAM,+BAA+B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AC;IACzC,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;CACzC,CAAC,CAAC;AAGH,+EAA+E;AAC/E,gGAAgG;AAChG,kGAAkG;AAClG,+FAA+F;AAC/F,iGAAiG;AACjG,mGAAmG;AACnG,mGAAmG;AACnG,uFAAuF;AACvF,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,YAAY,EAAE,SAAS,EAAE,WAAW,CAAU,CAAC;AAC7F,MAAM,CAAC,MAAM,wBAAwB,GAAG,8BAA8B,CAAC,MAAM,CAAC;IAC5E,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,6BAA6B,CAAC;IAC7C,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;IAC5C,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE;IACzB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,QAAQ,EAAE,aAAa;CACxB,CAAC,CAAC","sourcesContent":["// Chat realtime SYNC / projection / command Firestore schemas (chat-edge-rebuild P1).\n// The chat sync / projection / command (Firestore-side) field lists are FROZEN\n// here — this file is their single source; the durable design owner is ttt-prod\n// docs/design/chat-realtime-system.md. All of these collections are Admin-SDK-only\n// (`allow read, write: if false`). Per the TTT timestamp convention every time\n// field is epoch-ms `number`; the SINGLE exception is the native-TTL `expireAt`,\n// which is a real Firestore `Timestamp` (modeled as `unknown` so the drift-check\n// does not false-flag a Timestamp object against `z.number()`).\n\nimport { z } from 'zod';\nimport {\n CHAT_OUTBOX_COMMAND_KINDS,\n CHAT_SYNC_APPLY_KINDS,\n ChatParkedDeliveryReportSchema,\n} from '@ttt-productions/chat-schemas';\nimport { systemRoleSchema } from '../schemas/atoms.js';\nimport { GUILD_CHAT_CONVERSATION_KINDS } from '../ids/guild-chat-conversation.js';\n\n/** Native-TTL field — a real Firestore Timestamp (NOT epoch-ms). Absent until the terminal that sets TTL. */\nconst expireAtField = z.unknown().optional();\n\n// ── chatChannelAuthProjections/{authPairKey} ────────────────────────────────\n// Per-(user, channel) authorization FACT. Absent ⇒ removed/deny (fail-closed).\nexport const ChatChannelAuthProjectionSchema = z.object({\n channelRefScope: z.enum(GUILD_CHAT_CONVERSATION_KINDS),\n workProjectId: z.string().nullable(),\n guildChatChannelId: z.string().nullable(),\n guildInviteId: z.string().nullable(),\n uid: z.string(),\n channelKey: z.string(),\n channelAuthState: z.enum(['authorized', 'removed']),\n channelAuthVersion: z.number(),\n inputFingerprint: z.string(),\n updatedAt: z.number(),\n // Reconcile cursor — advanced on every reconciler visit, including a no-op one, so a stuck\n // window rotates. Absent until the reconciler first reaches the projection.\n lastReconciledAt: z.number().optional(),\n});\nexport type ChatChannelAuthProjection = z.infer<typeof ChatChannelAuthProjectionSchema>;\n\n// ── chatScopeDegraded/{scopeKey} (+ causes/{causeId}) ───────────────────────\n// Exists IFF unresolvedCauseCount > 0. Grant mints fail closed while it exists.\nexport const ChatScopeDegradedSchema = z.object({\n scopeKey: z.string(),\n scopeKind: z.enum(['channel', 'memberInWork']),\n // channel scope carries the channelRef tuple; memberInWork carries {uid, workProjectId}.\n workProjectId: z.string().nullable(),\n guildChatChannelId: z.string().nullable(),\n guildInviteId: z.string().nullable(),\n uid: z.string().nullable(),\n unresolvedCauseCount: z.number(),\n updatedAt: z.number(),\n});\nexport type ChatScopeDegraded = z.infer<typeof ChatScopeDegradedSchema>;\n\nexport const ChatScopeDegradedCauseSchema = z.object({\n causeId: z.string(),\n kind: z.enum(['syncEvent', 'fanoutJob']),\n ref: z.string(),\n deadLetteredAt: z.number(),\n});\nexport type ChatScopeDegradedCause = z.infer<typeof ChatScopeDegradedCauseSchema>;\n\n// ── chatSyncEvents/{eventId} ────────────────────────────────────────────────\nexport const ChatSyncEventSchema = z.object({\n eventId: z.string(),\n targetDo: z.string(),\n // The room applies only the chat-schemas apply kinds, so a row holds nothing else.\n kind: z.enum(CHAT_SYNC_APPLY_KINDS),\n version: z.number(),\n payload: z.record(z.string(), z.unknown()).nullable(),\n tombstone: z.boolean().optional(),\n payloadHash: z.string(),\n status: z.enum(['pending', 'delivered', 'deadLetter']),\n attemptCount: z.number(),\n nextAttemptAt: z.number(),\n lastError: z.string().nullable(),\n createdAt: z.number(),\n deliveredResult: z.record(z.string(), z.unknown()).nullable(),\n deliveredAt: z.number().nullable(),\n deadLetteredAt: z.number().nullable(),\n expireAt: expireAtField,\n});\nexport type ChatSyncEvent = z.infer<typeof ChatSyncEventSchema>;\n\n// ── chatSyncFanoutJobs/{jobId} ──────────────────────────────────────────────\n// The selector is a closed discriminated contract. The worker has different expansion\n// semantics for a Work-channel page, a member-in-Work page, and the fixed two-person\n// invite re-drive; a loose optional bag lets malformed persisted jobs silently wedge.\nconst ChatSyncFanoutJobBaseShape = {\n jobId: z.string(),\n causeVersion: z.number(),\n cursor: z.object({ pageIndex: z.number(), lastDocId: z.string().nullable() }),\n revision: z.number(),\n status: z.enum(['pending', 'complete', 'deadLetter']),\n attemptCount: z.number(),\n nextAttemptAt: z.number(),\n lastError: z.string().nullable(),\n createdAt: z.number(),\n completedAt: z.number().nullable(),\n deadLetteredAt: z.number().nullable(),\n expireAt: expireAtField,\n};\n\nconst channelFanoutSelectorArgs = z.object({\n workProjectId: z.string().min(1),\n guildChatChannelId: z.string().min(1),\n channelKey: z.string().min(1),\n}).strict();\n\nconst inviteParticipantsSelectorArgs = z.object({\n guildInviteId: z.string().min(1),\n participantUids: z.array(z.string().min(1)).length(2).refine(\n (uids) => new Set(uids).size === uids.length,\n { message: 'Invite participant uids must be distinct.' },\n ),\n}).strict();\n\nexport const ChatSyncFanoutJobSchema = z.discriminatedUnion('selectorKind', [\n z.object({\n ...ChatSyncFanoutJobBaseShape,\n selectorKind: z.literal('channelMembers'),\n selectorArgs: channelFanoutSelectorArgs,\n }).strict(),\n z.object({\n ...ChatSyncFanoutJobBaseShape,\n selectorKind: z.literal('policyEditAffectedUsers'),\n selectorArgs: channelFanoutSelectorArgs,\n }).strict(),\n z.object({\n ...ChatSyncFanoutJobBaseShape,\n selectorKind: z.literal('workChannelsForUser'),\n selectorArgs: z.object({\n uid: z.string().min(1),\n workProjectId: z.string().min(1),\n }).strict(),\n }).strict(),\n z.object({\n ...ChatSyncFanoutJobBaseShape,\n selectorKind: z.literal('inviteParticipants'),\n selectorArgs: inviteParticipantsSelectorArgs,\n }).strict(),\n]);\nexport type ChatSyncFanoutJob = z.infer<typeof ChatSyncFanoutJobSchema>;\n\n// ── chatMessageOutbox/{commandId} ───────────────────────────────────────────\nexport const ChatMessageOutboxSchema = z.object({\n commandId: z.string(),\n kind: z.enum(CHAT_OUTBOX_COMMAND_KINDS),\n threadRef: z.string(),\n payload: z.record(z.string(), z.unknown()),\n payloadVersion: z.number(),\n status: z.enum(['pending', 'applied', 'deadLetter']),\n attemptCount: z.number(),\n nextAttemptAt: z.number(),\n lastError: z.string().nullable(),\n createdAt: z.number(),\n appliedAt: z.number().nullable(),\n deadLetteredAt: z.number().nullable(),\n expireAt: expireAtField,\n});\nexport type ChatMessageOutbox = z.infer<typeof ChatMessageOutboxSchema>;\n\n// ── chatAdminActionCommands/{requestId} ─────────────────────────────────────\n// `requestId` IS the doc id + DO dedup key. `delivering` is NOT a lease (it sets\n// nextAttemptAt = now + DELIVERY_TIMEOUT). terminalFailureGeneration default 0.\nexport const ChatAdminActionCommandSchema = z.object({\n requestId: z.string(),\n actorUid: z.string(),\n actorMode: z.enum(['adminReview', 'adminOverride']),\n systemRole: systemRoleSchema,\n channelRef: z.record(z.string(), z.unknown()),\n messageSeq: z.number(),\n action: z.enum(['hide', 'delete']),\n caseId: z.string(),\n reason: z.string(),\n expectedMessageRevision: z.number(),\n payloadHash: z.string(),\n // `safetyRepair` is the NONTERMINAL stall loop: a RESERVED command whose reconcile\n // leg (PROBE → FINALIZE) failed past ADMIN_COMMAND_MAX_ATTEMPTS. Drained like\n // `delivering`; never dead-letters.\n state: z.enum(['queued', 'delivering', 'safetyRepair', 'applied', 'failed', 'deadLetter']),\n attemptCount: z.number(),\n nextAttemptAt: z.number(),\n lastError: z.string().nullable(),\n result: z.record(z.string(), z.unknown()).nullable(),\n doRevisionId: z.string().nullable(),\n terminalFailureGeneration: z.number(),\n createdAt: z.number(),\n appliedAt: z.number().nullable(),\n failedAt: z.number().nullable(),\n deadLetteredAt: z.number().nullable(),\n reconciled: z.boolean(),\n reconciledAt: z.number().nullable(),\n safetyRepair: z.boolean(),\n // Monotonic counter of distinct entries into the safety-repair loop — keys the\n // per-entry idempotent failure audit.\n safetyRepairGeneration: z.number(),\n // Failed reconcile passes on an already-reserved command. Separate from\n // `attemptCount` (delivery attempts, which dead-letter); at the cap it escalates\n // once into `safetyRepair` instead of dead-lettering.\n reconcileAttemptCount: z.number(),\n expireAt: expireAtField,\n});\nexport type ChatAdminActionCommand = z.infer<typeof ChatAdminActionCommandSchema>;\n\n// ── chatHistoryAnonymizationJobs/{jobId} ────────────────────────────────────\n// Account-deletion history anonymization (Contract F; P8). Resumable + crash-safe:\n// the recorded source-manifest identity (key/hash/generation) + the three cursors\n// (scan/rewrite/delete) make every boundary restartable. jobId =\n// hash('chat-anonymize', channelDoId, epoch, anonymizedUid). `expireAt` (native TTL)\n// is set ONLY when the job reaches `done`.\n//\n// C-B1: the replacement generation is DO-OWNED — the Channel DO (single-threaded per\n// channel) allocates a DISTINCT monotonic generation per erasure off the epoch row and\n// rewrites against the CURRENT live manifest, so two erasures on one epoch chain instead\n// of colliding on a shared `anon-1` keyspace. These four fields are therefore RECORDED AT\n// SCAN (null until the DO reports/allocates them), not pinned at enqueue; if a concurrent\n// anonymization supersedes the source between scan and swap, the job resets to `scanning`\n// to re-derive against the new current manifest (keeping its own allocated generation).\nexport const ChatHistoryAnonymizationJobSchema = z.object({\n jobId: z.string(),\n channelDoId: z.string(),\n epoch: z.number(),\n anonymizedUid: z.string(),\n sourceManifestKey: z.string().nullable(),\n sourceManifestHash: z.string().nullable(),\n sourceGeneration: z.number().nullable(),\n replacementGeneration: z.number().nullable(),\n newManifestKey: z.string().nullable(),\n scanCursor: z.number(),\n rewriteCursor: z.number(),\n deleteCursor: z.number(),\n swappedAt: z.number().nullable(),\n state: z.enum(['scanning', 'rewriting', 'swapping', 'deleting', 'done', 'failed']),\n legalHoldPaused: z.boolean(),\n attemptCount: z.number(),\n nextAttemptAt: z.number(),\n lastError: z.string().nullable(),\n createdAt: z.number(),\n updatedAt: z.number(),\n expireAt: expireAtField,\n});\nexport type ChatHistoryAnonymizationJob = z.infer<typeof ChatHistoryAnonymizationJobSchema>;\n\n// ── chatHistoryAnonymizationJobs/{jobId}/affectedChunks/{chunkOrdinal} ───────\n// The non-contiguous affected-chunk set (round-16 finding 7) — a crash after the\n// manifest swap resumes deletion from these rows + `deleteCursor` without re-listing R2.\nexport const ChatHistoryAnonymizationAffectedChunkSchema = z.object({\n chunkOrdinal: z.number(),\n sourceChunkKey: z.string(),\n sourceSha256: z.string(),\n replacementChunkKey: z.string().nullable(),\n replacementSha256: z.string().nullable(),\n rewriteState: z.enum(['pending', 'done']),\n deleteState: z.enum(['pending', 'done']),\n});\nexport type ChatHistoryAnonymizationAffectedChunk = z.infer<typeof ChatHistoryAnonymizationAffectedChunkSchema>;\n\n// ── chatParkedDeliveries/{deliveryId} ───────────────────────────────────────\n// One delivery a chat room parked in its own outbox, as the room reported it through its signed\n// call (the report's fields, from the chat contract), plus the server-side replay ledger. The row\n// is created `deadLetter` (create-if-absent on `chatParkedDeliveryId`), so it lists with every\n// other dead-lettered row; an operator replay resets it to `pending` (the generic ledger reset —\n// `attemptCount`, `nextAttemptAt`, `lastError`, `deadLetteredAt`, `expireAt`); the server's replay\n// drain asks the room to requeue it and marks it `delivered` (and sets `expireAt`) on a `requeued`\n// or `not-parked` answer, or parks it `deadLetter` again once its own retries run out.\nexport const CHAT_PARKED_DELIVERY_STATUSES = ['deadLetter', 'pending', 'delivered'] as const;\nexport const ChatParkedDeliverySchema = ChatParkedDeliveryReportSchema.extend({\n status: z.enum(CHAT_PARKED_DELIVERY_STATUSES),\n attemptCount: z.number().int().nonnegative(),\n nextAttemptAt: z.number(),\n lastError: z.string().nullable(),\n createdAt: z.number(),\n deadLetteredAt: z.number().nullable(),\n deliveredAt: z.number().nullable(),\n expireAt: expireAtField,\n});\nexport type ChatParkedDelivery = z.infer<typeof ChatParkedDeliverySchema>;\n"]}
@@ -57,7 +57,11 @@ export declare const CommissionProposalSchema: z.ZodObject<{
57
57
  workProjectId: z.ZodString;
58
58
  proposalText: z.ZodString;
59
59
  proposalFileAssetId: z.ZodOptional<z.ZodString>;
60
- proposalFileType: z.ZodOptional<z.ZodString>;
60
+ proposalFileType: z.ZodOptional<z.ZodEnum<{
61
+ image: "image";
62
+ video: "video";
63
+ audio: "audio";
64
+ }>>;
61
65
  createdBy: z.ZodObject<{
62
66
  uid: z.ZodString;
63
67
  }, z.core.$strip>;
@@ -89,7 +93,11 @@ export declare const CreateCommissionProposalTextResultSchema: z.ZodObject<{
89
93
  workProjectId: z.ZodString;
90
94
  proposalText: z.ZodString;
91
95
  proposalFileAssetId: z.ZodOptional<z.ZodString>;
92
- proposalFileType: z.ZodOptional<z.ZodString>;
96
+ proposalFileType: z.ZodOptional<z.ZodEnum<{
97
+ image: "image";
98
+ video: "video";
99
+ audio: "audio";
100
+ }>>;
93
101
  createdBy: z.ZodObject<{
94
102
  uid: z.ZodString;
95
103
  }, z.core.$strip>;
@@ -1 +1 @@
1
- {"version":3,"file":"commissions.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/commissions.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,0BAA0B;;;;;;;;;;iBAUrC,CA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BAAsB,CAAC,CAAC"}
@@ -53,7 +53,9 @@ export const CommissionProposalSchema = z.object({
53
53
  workProjectId: z.string(),
54
54
  proposalText: z.string(),
55
55
  proposalFileAssetId: z.string().optional(),
56
- proposalFileType: z.string().optional(),
56
+ // The attached file's stored content kind, inspected by the upload pipeline — the same union
57
+ // the listing attachment's `type` derives from (ARCH-102).
58
+ proposalFileType: ContentMediaKindSchema.optional(),
57
59
  createdBy: userRefSchema,
58
60
  createdOn: z.number(),
59
61
  status: CommissionProposalStatusSchema,
@@ -1 +1 @@
1
- {"version":3,"file":"commissions.js","sourceRoot":"","sources":["../../src/doc-schemas/commissions.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,qFAAqF;AACrF,iDAAiD;AAEjD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAE3D,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAEpD,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,+EAA+E;IAC/E,yFAAyF;IACzF,wFAAwF;IACxF,8CAA8C;IAC9C,IAAI,EAAE,sBAAsB;IAC5B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;CACjB,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;IACjB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,kFAAkF;IAClF,+FAA+F;IAC/F,eAAe,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACvC,iFAAiF;IACjF,kDAAkD;IAClD,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE;IACnB,QAAQ,EAAE,wBAAwB,CAAC,QAAQ,EAAE;CAC9C,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,uBAAuB,EAAE,CAAC,CAAC,MAAM,EAAE;IACnC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,2BAA2B,EAAE,aAAa;CAC3C,CAAC,CAAC","sourcesContent":["// Commission + Audition Firestore document SCHEMAS — commissionListings/{id} and its\n// commissionProposals, auditionBoard/{id} and its auditionEntries, plus the per-user\n// auditionVotes doc. Types inferred via z.infer.\n\nimport { z } from 'zod';\nimport { CommissionProposalStatusSchema } from '../schemas/commissions.js';\nimport { stakeSharesOfferedSchema } from '../schemas/atoms.js';\nimport { AuditionDeadlineSchema } from '../constants/audition-deadlines.js';\nimport { ContentMediaKindSchema } from './media-assets.js';\nimport { ModerationHiddenBySchema } from './moderation.js';\n\nconst userRefSchema = z.object({ uid: z.string() });\n\nexport const CommissionAttachmentSchema = z.object({\n pendingMediaId: z.string().optional(),\n name: z.string(),\n mediaAssetId: z.string(),\n // The stored content kind (image/video/audio). Set once by the upload pipeline\n // (getSimplifiedMediaType) and written by the commissionListingMedia publication adapter\n // as z.enum(['image','video','audio']); derived here from the ONE canonical stored-kind\n // union (ARCH-102), never a widened `string`.\n type: ContentMediaKindSchema,\n size: z.number(),\n});\nexport type CommissionAttachment = z.infer<typeof CommissionAttachmentSchema>;\n\nexport const FullCommissionListingSchema = z.object({\n commissionListingId: z.string(),\n title: z.string(),\n description: z.string(),\n commissionAttachment: CommissionAttachmentSchema.optional(),\n requiredTradeProfessions: z.array(z.string()),\n stakeSharesOffered: stakeSharesOfferedSchema,\n createdAt: z.number(),\n createdBy: userRefSchema,\n // Work reference only — title/description are NOT snapshotted (Display Identity Invariant:\n // resolve at render from publicWorkProjects by id, fallback label if the work is gone).\n // `type` (Tales/Tunes/Television) is an immutable classification, not display text, and IS\n // consumed by a commission-board type filter/index, so it stays — mirroring the\n // GuildInviteConversation `workProject: { workProjectId, type }` precedent.\n workProjectAssociatedWith: z.object({\n workProjectId: z.string(),\n type: z.string(),\n }),\n status: z.enum(['open', 'closed']),\n closedAt: z.number().optional(), // set by the close write, together with status 'closed'\n savedProposalArtisans: z.array(z.string()),\n shortId: z.string().optional(),\n shortUrl: z.string().optional(),\n // Admin moderation hide (reversible). When true the listing is suppressed from\n // the commission board; restored by clearing it.\n hidden: z.boolean(),\n hiddenBy: ModerationHiddenBySchema.optional(),\n});\nexport type FullCommissionListing = z.infer<typeof FullCommissionListingSchema>;\n\nexport const CommissionProposalSchema = z.object({\n commissionProposalId: z.string(),\n commissionListingId: z.string(),\n workProjectId: z.string(),\n proposalText: z.string(),\n proposalFileAssetId: z.string().optional(),\n proposalFileType: z.string().optional(),\n createdBy: userRefSchema,\n createdOn: z.number(),\n status: CommissionProposalStatusSchema,\n guildInviteId: z.string().optional(),\n invitedOn: z.number().optional(),\n acceptedOn: z.number().optional(),\n rejectedAt: z.number().optional(),\n // [EUAS-006] Admin moderation hide (reversible) — matches the listing/audition/entry pattern. When\n // true the proposal's TEXT is suppressed from the board (tombstoned for ordinary viewers); restored\n // by clearing it. Optional so existing/seeded proposals don't need backfilling pre-launch.\n hidden: z.boolean().optional(),\n hiddenBy: ModerationHiddenBySchema.optional(),\n});\nexport type CommissionProposal = z.infer<typeof CommissionProposalSchema>;\n\n// Authoritative result of the createCommissionProposalText callable — the created item,\n// exactly as the transaction committed it; the client seeds its proposal caches from this\n// instead of refetching. Declared HERE (not schemas/commissions.ts) because it composes\n// CommissionProposalSchema and this module already imports schemas/commissions.js\n// (CommissionProposalStatusSchema) — the reverse runtime import would be a module cycle.\n// Re-exported on the ./schemas subpath via schemas/index.ts. Non-strict (server → client\n// result posture).\nexport const CreateCommissionProposalTextResultSchema = z.object({\n success: z.literal(true),\n commissionListingId: z.string().min(1),\n commissionProposalId: z.string().min(1),\n /** The proposal doc exactly as committed. */\n proposal: CommissionProposalSchema,\n});\nexport type CreateCommissionProposalTextResult = z.infer<typeof CreateCommissionProposalTextResultSchema>;\n\nexport const AuditionTypeSchema = z.enum(['platformAudition', 'sponsoredAudition', 'workAudition']);\nexport type AuditionType = z.infer<typeof AuditionTypeSchema>;\n\nexport const AuditionSchema = z.object({\n auditionId: z.string(),\n type: AuditionTypeSchema,\n title: z.string(),\n description: z.string(),\n videoAssetId: z.string(),\n // Auditions are VIDEO ONLY (DJ ruling). Paired with the required videoAssetId (both\n // always present — the MEDIA-101 shape, not a required-asset/optional-kind mismatch),\n // derived from the ONE canonical stored-kind union narrowed to video — never an inline\n // re-declared union (ARCH-102).\n mediaType: ContentMediaKindSchema.extract(['video']),\n // The poster's two deadlines (epoch ms) — see constants/audition-deadlines.ts: entries are\n // in time when SUBMITTED before `entriesCloseAt`; votes are in time before `auditionCloseAt`.\n entriesCloseAt: AuditionDeadlineSchema,\n auditionCloseAt: AuditionDeadlineSchema,\n createdOn: z.number(),\n createdBy: userRefSchema,\n workProjectId: z.string().optional(),\n // Curated vs open. 'open' (default when absent — existing auditions): anyone may post reply\n // entries AND vote. 'curated': the creating work posts the option entries itself (min 2, max 8,\n // each `isCreatorOption: true`) and users may ONLY vote — community reply entries are rejected.\n mode: z.enum(['open', 'curated']).optional(),\n // Curated atomic-reveal state (only meaningful when mode === 'curated'). The prompt + all N option\n // videos upload as ONE fixed batch; the audition stays non-votable + off the public board until the\n // WHOLE batch is live and every video passed moderation:\n // 'assembling' — batch still processing/moderating; not votable, not on the board (status stays\n // 'pendingReview'), only the creator sees a \"preparing…\" state.\n // 'ready' — all N+1 landed and approved; the reveal flips status → 'open', or straight to\n // 'closed' when the audition's close has already passed. A curated audition\n // closed after its reveal keeps 'ready' (only its status changes).\n // 'failed' — any video in the batch was rejected by moderation, or the batch was still\n // assembling a day after creation; the whole audition fails. status stays\n // non-open; only the creator sees it (on the project page) to Edit & resubmit or\n // Discard.\n // 'closed' — the audition was closed (by its creator or an admin) while still\n // 'assembling', BEFORE any reveal; terminal, so an option video that finishes\n // afterwards lands silently and never reveals it.\n curatedAssemblyStatus: z.enum(['assembling', 'ready', 'failed', 'closed']).optional(),\n // The fixed number of creator option videos submitted at create-time (2..8). Used to know when the\n // whole batch has landed (all expected entries approved → reveal).\n expectedOptionCount: z.number().int().optional(),\n // Set when curatedAssemblyStatus === 'failed': which video was rejected, for the creator-only\n // failed-audition surface on the project page.\n curatedFailureReason: z.string().optional(),\n sponsoredAuditionAmountUSD: z.number().optional(),\n stakeSharesOffered: stakeSharesOfferedSchema.optional(),\n status: z.enum(['open', 'closed', 'pendingReview']),\n closedAt: z.number().optional(), // set by the close write, together with status 'closed'\n auditionEntryCount: z.number().optional(),\n shortId: z.string().optional(),\n shortUrl: z.string().optional(),\n // Admin moderation hide (reversible). When true the audition is suppressed from\n // the audition board; restored by clearing it.\n hidden: z.boolean(),\n hiddenBy: ModerationHiddenBySchema.optional(),\n});\nexport type Audition = z.infer<typeof AuditionSchema>;\n\nexport const AuditionEntrySchema = z.object({\n auditionEntryId: z.string(),\n auditionId: z.string(),\n workProjectId: z.string().optional(),\n videoAssetId: z.string(),\n // Audition entries are VIDEO ONLY (DJ ruling) — same video-only pairing as the audition\n // prompt above; derived from the canonical stored-kind union narrowed to video.\n mediaType: ContentMediaKindSchema.extract(['video']),\n createdBy: userRefSchema,\n createdAt: z.number(),\n votes: z.number(),\n shortId: z.string().optional(),\n shortUrl: z.string().optional(),\n // Curated-mode option: true when this entry is a work-authored voting option on a\n // `mode: 'curated'` audition (posted by the creating work at creation), not a community reply.\n isCreatorOption: z.boolean().optional(),\n // Admin moderation hide (reversible). When true the entry is suppressed from the\n // audition's entry list; restored by clearing it.\n hidden: z.boolean(),\n hiddenBy: ModerationHiddenBySchema.optional(),\n});\nexport type AuditionEntry = z.infer<typeof AuditionEntrySchema>;\n\nexport const UserAuditionVoteSchema = z.object({\n votedForAuditionEntryId: z.string(),\n votedOn: z.number(),\n auditionEntryArtisanCreator: userRefSchema,\n});\nexport type UserAuditionVote = z.infer<typeof UserAuditionVoteSchema>;\n"]}
1
+ {"version":3,"file":"commissions.js","sourceRoot":"","sources":["../../src/doc-schemas/commissions.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,qFAAqF;AACrF,iDAAiD;AAEjD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAE3D,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAEpD,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,+EAA+E;IAC/E,yFAAyF;IACzF,wFAAwF;IACxF,8CAA8C;IAC9C,IAAI,EAAE,sBAAsB;IAC5B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;CACjB,CAAC,CAAC;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AAE;IACjB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,kFAAkF;IAClF,+FAA+F;IAC/F,eAAe,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACvC,iFAAiF;IACjF,kDAAkD;IAClD,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE;IACnB,QAAQ,EAAE,wBAAwB,CAAC,QAAQ,EAAE;CAC9C,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,uBAAuB,EAAE,CAAC,CAAC,MAAM,EAAE;IACnC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,2BAA2B,EAAE,aAAa;CAC3C,CAAC,CAAC","sourcesContent":["// Commission + Audition Firestore document SCHEMAS — commissionListings/{id} and its\n// commissionProposals, auditionBoard/{id} and its auditionEntries, plus the per-user\n// auditionVotes doc. Types inferred via z.infer.\n\nimport { z } from 'zod';\nimport { CommissionProposalStatusSchema } from '../schemas/commissions.js';\nimport { stakeSharesOfferedSchema } from '../schemas/atoms.js';\nimport { AuditionDeadlineSchema } from '../constants/audition-deadlines.js';\nimport { ContentMediaKindSchema } from './media-assets.js';\nimport { ModerationHiddenBySchema } from './moderation.js';\n\nconst userRefSchema = z.object({ uid: z.string() });\n\nexport const CommissionAttachmentSchema = z.object({\n pendingMediaId: z.string().optional(),\n name: z.string(),\n mediaAssetId: z.string(),\n // The stored content kind (image/video/audio). Set once by the upload pipeline\n // (getSimplifiedMediaType) and written by the commissionListingMedia publication adapter\n // as z.enum(['image','video','audio']); derived here from the ONE canonical stored-kind\n // union (ARCH-102), never a widened `string`.\n type: ContentMediaKindSchema,\n size: z.number(),\n});\nexport type CommissionAttachment = z.infer<typeof CommissionAttachmentSchema>;\n\nexport const FullCommissionListingSchema = z.object({\n commissionListingId: z.string(),\n title: z.string(),\n description: z.string(),\n commissionAttachment: CommissionAttachmentSchema.optional(),\n requiredTradeProfessions: z.array(z.string()),\n stakeSharesOffered: stakeSharesOfferedSchema,\n createdAt: z.number(),\n createdBy: userRefSchema,\n // Work reference only — title/description are NOT snapshotted (Display Identity Invariant:\n // resolve at render from publicWorkProjects by id, fallback label if the work is gone).\n // `type` (Tales/Tunes/Television) is an immutable classification, not display text, and IS\n // consumed by a commission-board type filter/index, so it stays — mirroring the\n // GuildInviteConversation `workProject: { workProjectId, type }` precedent.\n workProjectAssociatedWith: z.object({\n workProjectId: z.string(),\n type: z.string(),\n }),\n status: z.enum(['open', 'closed']),\n closedAt: z.number().optional(), // set by the close write, together with status 'closed'\n savedProposalArtisans: z.array(z.string()),\n shortId: z.string().optional(),\n shortUrl: z.string().optional(),\n // Admin moderation hide (reversible). When true the listing is suppressed from\n // the commission board; restored by clearing it.\n hidden: z.boolean(),\n hiddenBy: ModerationHiddenBySchema.optional(),\n});\nexport type FullCommissionListing = z.infer<typeof FullCommissionListingSchema>;\n\nexport const CommissionProposalSchema = z.object({\n commissionProposalId: z.string(),\n commissionListingId: z.string(),\n workProjectId: z.string(),\n proposalText: z.string(),\n proposalFileAssetId: z.string().optional(),\n // The attached file's stored content kind, inspected by the upload pipeline — the same union\n // the listing attachment's `type` derives from (ARCH-102).\n proposalFileType: ContentMediaKindSchema.optional(),\n createdBy: userRefSchema,\n createdOn: z.number(),\n status: CommissionProposalStatusSchema,\n guildInviteId: z.string().optional(),\n invitedOn: z.number().optional(),\n acceptedOn: z.number().optional(),\n rejectedAt: z.number().optional(),\n // [EUAS-006] Admin moderation hide (reversible) — matches the listing/audition/entry pattern. When\n // true the proposal's TEXT is suppressed from the board (tombstoned for ordinary viewers); restored\n // by clearing it. Optional so existing/seeded proposals don't need backfilling pre-launch.\n hidden: z.boolean().optional(),\n hiddenBy: ModerationHiddenBySchema.optional(),\n});\nexport type CommissionProposal = z.infer<typeof CommissionProposalSchema>;\n\n// Authoritative result of the createCommissionProposalText callable — the created item,\n// exactly as the transaction committed it; the client seeds its proposal caches from this\n// instead of refetching. Declared HERE (not schemas/commissions.ts) because it composes\n// CommissionProposalSchema and this module already imports schemas/commissions.js\n// (CommissionProposalStatusSchema) — the reverse runtime import would be a module cycle.\n// Re-exported on the ./schemas subpath via schemas/index.ts. Non-strict (server → client\n// result posture).\nexport const CreateCommissionProposalTextResultSchema = z.object({\n success: z.literal(true),\n commissionListingId: z.string().min(1),\n commissionProposalId: z.string().min(1),\n /** The proposal doc exactly as committed. */\n proposal: CommissionProposalSchema,\n});\nexport type CreateCommissionProposalTextResult = z.infer<typeof CreateCommissionProposalTextResultSchema>;\n\nexport const AuditionTypeSchema = z.enum(['platformAudition', 'sponsoredAudition', 'workAudition']);\nexport type AuditionType = z.infer<typeof AuditionTypeSchema>;\n\nexport const AuditionSchema = z.object({\n auditionId: z.string(),\n type: AuditionTypeSchema,\n title: z.string(),\n description: z.string(),\n videoAssetId: z.string(),\n // Auditions are VIDEO ONLY (DJ ruling). Paired with the required videoAssetId (both\n // always present — the MEDIA-101 shape, not a required-asset/optional-kind mismatch),\n // derived from the ONE canonical stored-kind union narrowed to video — never an inline\n // re-declared union (ARCH-102).\n mediaType: ContentMediaKindSchema.extract(['video']),\n // The poster's two deadlines (epoch ms) — see constants/audition-deadlines.ts: entries are\n // in time when SUBMITTED before `entriesCloseAt`; votes are in time before `auditionCloseAt`.\n entriesCloseAt: AuditionDeadlineSchema,\n auditionCloseAt: AuditionDeadlineSchema,\n createdOn: z.number(),\n createdBy: userRefSchema,\n workProjectId: z.string().optional(),\n // Curated vs open. 'open' (default when absent — existing auditions): anyone may post reply\n // entries AND vote. 'curated': the creating work posts the option entries itself (min 2, max 8,\n // each `isCreatorOption: true`) and users may ONLY vote — community reply entries are rejected.\n mode: z.enum(['open', 'curated']).optional(),\n // Curated atomic-reveal state (only meaningful when mode === 'curated'). The prompt + all N option\n // videos upload as ONE fixed batch; the audition stays non-votable + off the public board until the\n // WHOLE batch is live and every video passed moderation:\n // 'assembling' — batch still processing/moderating; not votable, not on the board (status stays\n // 'pendingReview'), only the creator sees a \"preparing…\" state.\n // 'ready' — all N+1 landed and approved; the reveal flips status → 'open', or straight to\n // 'closed' when the audition's close has already passed. A curated audition\n // closed after its reveal keeps 'ready' (only its status changes).\n // 'failed' — any video in the batch was rejected by moderation, or the batch was still\n // assembling a day after creation; the whole audition fails. status stays\n // non-open; only the creator sees it (on the project page) to Edit & resubmit or\n // Discard.\n // 'closed' — the audition was closed (by its creator or an admin) while still\n // 'assembling', BEFORE any reveal; terminal, so an option video that finishes\n // afterwards lands silently and never reveals it.\n curatedAssemblyStatus: z.enum(['assembling', 'ready', 'failed', 'closed']).optional(),\n // The fixed number of creator option videos submitted at create-time (2..8). Used to know when the\n // whole batch has landed (all expected entries approved → reveal).\n expectedOptionCount: z.number().int().optional(),\n // Set when curatedAssemblyStatus === 'failed': which video was rejected, for the creator-only\n // failed-audition surface on the project page.\n curatedFailureReason: z.string().optional(),\n sponsoredAuditionAmountUSD: z.number().optional(),\n stakeSharesOffered: stakeSharesOfferedSchema.optional(),\n status: z.enum(['open', 'closed', 'pendingReview']),\n closedAt: z.number().optional(), // set by the close write, together with status 'closed'\n auditionEntryCount: z.number().optional(),\n shortId: z.string().optional(),\n shortUrl: z.string().optional(),\n // Admin moderation hide (reversible). When true the audition is suppressed from\n // the audition board; restored by clearing it.\n hidden: z.boolean(),\n hiddenBy: ModerationHiddenBySchema.optional(),\n});\nexport type Audition = z.infer<typeof AuditionSchema>;\n\nexport const AuditionEntrySchema = z.object({\n auditionEntryId: z.string(),\n auditionId: z.string(),\n workProjectId: z.string().optional(),\n videoAssetId: z.string(),\n // Audition entries are VIDEO ONLY (DJ ruling) — same video-only pairing as the audition\n // prompt above; derived from the canonical stored-kind union narrowed to video.\n mediaType: ContentMediaKindSchema.extract(['video']),\n createdBy: userRefSchema,\n createdAt: z.number(),\n votes: z.number(),\n shortId: z.string().optional(),\n shortUrl: z.string().optional(),\n // Curated-mode option: true when this entry is a work-authored voting option on a\n // `mode: 'curated'` audition (posted by the creating work at creation), not a community reply.\n isCreatorOption: z.boolean().optional(),\n // Admin moderation hide (reversible). When true the entry is suppressed from the\n // audition's entry list; restored by clearing it.\n hidden: z.boolean(),\n hiddenBy: ModerationHiddenBySchema.optional(),\n});\nexport type AuditionEntry = z.infer<typeof AuditionEntrySchema>;\n\nexport const UserAuditionVoteSchema = z.object({\n votedForAuditionEntryId: z.string(),\n votedOn: z.number(),\n auditionEntryArtisanCreator: userRefSchema,\n});\nexport type UserAuditionVote = z.infer<typeof UserAuditionVoteSchema>;\n"]}
@@ -108,6 +108,7 @@ export declare const GuildInviteConversationSchema: z.ZodObject<{
108
108
  lastUpdatedAt: z.ZodNumber;
109
109
  finalizedAt: z.ZodOptional<z.ZodNumber>;
110
110
  senderConfirmed: z.ZodBoolean;
111
+ senderConfirmedBy: z.ZodOptional<z.ZodString>;
111
112
  recipientConfirmed: z.ZodBoolean;
112
113
  }, z.core.$strip>;
113
114
  export type GuildInviteConversation = z.infer<typeof GuildInviteConversationSchema>;
@@ -172,6 +173,7 @@ export declare const ListGuildInvitesResultSchema: z.ZodObject<{
172
173
  lastUpdatedAt: z.ZodNumber;
173
174
  finalizedAt: z.ZodOptional<z.ZodNumber>;
174
175
  senderConfirmed: z.ZodBoolean;
176
+ senderConfirmedBy: z.ZodOptional<z.ZodString>;
175
177
  recipientConfirmed: z.ZodBoolean;
176
178
  }, z.core.$strip>>;
177
179
  nextCursor: z.ZodNullable<z.ZodString>;
@@ -194,6 +196,13 @@ export declare const AdminDispatchPartyKindSchema: z.ZodEnum<{
194
196
  workProject: "workProject";
195
197
  }>;
196
198
  export type AdminDispatchPartyKind = z.infer<typeof AdminDispatchPartyKindSchema>;
199
+ export declare const ADMIN_DISPATCH_SENDER_ROLES: readonly ["user", "admin", "system"];
200
+ export declare const AdminDispatchSenderRoleSchema: z.ZodEnum<{
201
+ user: "user";
202
+ system: "system";
203
+ admin: "admin";
204
+ }>;
205
+ export type AdminDispatchSenderRole = z.infer<typeof AdminDispatchSenderRoleSchema>;
197
206
  export declare const AdminDispatchSchema: z.ZodObject<{
198
207
  conversationFileCount: z.ZodOptional<z.ZodNumber>;
199
208
  conversationFileBytesUsed: z.ZodOptional<z.ZodNumber>;
@@ -1 +1 @@
1
- {"version":3,"file":"messaging.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/messaging.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAmCxB;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;iBAWjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;iBAwBjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAQtE,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiCxC,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAMpF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAG9B,CAAC;AACZ,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAMlF,eAAO,MAAM,6BAA6B;;;;;;;;;;2BASxC,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF,eAAO,MAAM,4BAA4B;;;EAAkC,CAAC;AAC5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