@ttt-productions/ttt-core 0.79.74 → 0.79.76

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.
@@ -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, AdminDispatchSenderRole } from '../doc-schemas/messaging.js';
11
+ import type { AdminDispatch } 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,8 +117,10 @@ 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
+ /** The marker beside the sender of a support-thread message sent with admin authority. */
121
+ export declare const ADMIN_SENDER_MARKER_LABEL = "Admin";
122
+ /** The sender label on a support thread's system line (a close notice) in the admin preview. */
123
+ export declare const ADMIN_DISPATCH_SYSTEM_SENDER_LABEL = "System";
122
124
  /** Child-safety case work statuses (the safety case console's case rows and closed-case lookup). */
123
125
  export declare const CHILD_SAFETY_CASE_WORK_STATUS_LABELS: Record<ChildSafetyWorkStatus, string>;
124
126
  /** NCII case statuses (the safety case console's case rows and closed-case lookup). */
@@ -1 +1 @@
1
- {"version":3,"file":"admin-labels.d.ts","source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  };
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
+ /** The marker beside the sender of a support-thread message sent with admin authority. */
211
+ export const ADMIN_SENDER_MARKER_LABEL = 'Admin';
212
+ /** The sender label on a support thread's system line (a close notice) in the admin preview. */
213
+ export const ADMIN_DISPATCH_SYSTEM_SENDER_LABEL = 'System';
216
214
  /** Child-safety case work statuses (the safety case console's case rows and closed-case lookup). */
217
215
  export const CHILD_SAFETY_CASE_WORK_STATUS_LABELS = {
218
216
  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,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,M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AY;IACxB,UAAU,EAAE,YAAY;IACxB,UAAU,EAAE,YAAY;IACxB,QAAQ,EAAE,UAAU;CACrB,CAAC;AAEF,6FAA6F;AAC7F,MAAM,CAAC,MAAM,6BAA6B,GAAwC;IAChF,QAAQ,EAAE,UAAU;IACpB,gBAAgB,EAAE,gBAAgB;IAClC,UAAU,EAAE,YAAY;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"]}
1
+ {"version":3,"file":"admin-labels.js","sourceRoot":"","sources":["../../src/constants/admin-lab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;AAC1F,MAAM,CAAC,MAAM,yBAAyB,GAAG,OAAO,CAAC;AAEjD,gGAAgG;AAChG,MAAM,CAAC,MAAM,kCAAkC,GAAG,QAAQ,CAAC;AAE3D,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 } 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/** The marker beside the sender of a support-thread message sent with admin authority. */\nexport const ADMIN_SENDER_MARKER_LABEL = 'Admin';\n\n/** The sender label on a support thread's system line (a close notice) in the admin preview. */\nexport const ADMIN_DISPATCH_SYSTEM_SENDER_LABEL = 'System';\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"]}
@@ -196,13 +196,15 @@ export declare const AdminDispatchPartyKindSchema: z.ZodEnum<{
196
196
  workProject: "workProject";
197
197
  }>;
198
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";
199
+ export declare const ChatMessageSentAsSchema: z.ZodEnum<{
203
200
  admin: "admin";
204
201
  }>;
205
- export type AdminDispatchSenderRole = z.infer<typeof AdminDispatchSenderRoleSchema>;
202
+ export type ChatMessageSentAs = z.infer<typeof ChatMessageSentAsSchema>;
203
+ /**
204
+ * Whether a stored (or mapped) support-thread message was sent with verified admin authority. Reads
205
+ * only the recorded value: a missing or malformed one is an ordinary message, never a guess.
206
+ */
207
+ export declare function isChatMessageSentAsAdmin(sentAs: unknown): boolean;
206
208
  export declare const AdminDispatchSchema: z.ZodObject<{
207
209
  conversationFileCount: z.ZodOptional<z.ZodNumber>;
208
210
  conversationFileBytesUsed: z.ZodOptional<z.ZodNumber>;
@@ -255,6 +257,9 @@ export declare const ChatMessageV1Schema: z.ZodObject<{
255
257
  type: z.ZodOptional<z.ZodString>;
256
258
  guildInviteId: z.ZodOptional<z.ZodString>;
257
259
  isSystemMessage: z.ZodOptional<z.ZodBoolean>;
260
+ sentAs: z.ZodOptional<z.ZodEnum<{
261
+ admin: "admin";
262
+ }>>;
258
263
  meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
259
264
  }, z.core.$strip>;
260
265
  export type ChatMessageV1Doc = z.infer<typeof ChatMessageV1Schema>;
@@ -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;AAoCxB;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqCxC,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAMpF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,OAAO,mBAAmB,CAAC,CAAC"}
@@ -149,11 +149,18 @@ export const AdminDispatchContextRefSchema = z.discriminatedUnion('kind', [
149
149
  z.object({ kind: z.literal('hallContentChangeRequest'), changeRequestId: changeRequestIdSchema }),
150
150
  ]);
151
151
  export const AdminDispatchPartyKindSchema = z.enum(['user', 'workProject']);
152
- // Who a message on a support thread is from: the system, the admin team, or the member side (the
153
- // thread owner, or a member of the Work on a Work thread). No writer stores it; it is derived from
154
- // the sender and the thread's party when a message is shown.
155
- export const ADMIN_DISPATCH_SENDER_ROLES = ['user', 'admin', 'system'];
156
- export const AdminDispatchSenderRoleSchema = z.enum(ADMIN_DISPATCH_SENDER_ROLES);
152
+ // The capacity a support-thread message was sent in, written by the backend in the message's
153
+ // creation transaction from the verified actor — never from current claims, the roster, Work
154
+ // membership, or a client field. `admin` marks a message sent with verified admin authority; an
155
+ // ordinary message (a member, or an admin acting as a participant) stores no value at all.
156
+ export const ChatMessageSentAsSchema = z.enum(['admin']);
157
+ /**
158
+ * Whether a stored (or mapped) support-thread message was sent with verified admin authority. Reads
159
+ * only the recorded value: a missing or malformed one is an ordinary message, never a guess.
160
+ */
161
+ export function isChatMessageSentAsAdmin(sentAs) {
162
+ return ChatMessageSentAsSchema.safeParse(sentAs).success;
163
+ }
157
164
  export const AdminDispatchSchema = z.object({
158
165
  adminDispatchId: z.string(),
159
166
  // Party-generic dispatch: the platform corresponds with a PARTY — a user or a
@@ -189,8 +196,8 @@ export const AdminDispatchSchema = z.object({
189
196
  // Per-message body for admin-support `conversationMessages` — the ONE chat surface still
190
197
  // transported through Firestore (guild channel + invite messages are realtime-only, served
191
198
  // by the chat Worker Durable Object). Written by runSendGuildChatMessage (senderId/text/
192
- // createdAt); the admin-dispatch INITIAL message
193
- // (runStartAdminSupportThread) additionally stores `messageId`. This is the STORED shape — a relaxed
199
+ // createdAt, plus `sentAs` on an admin send); a thread's INITIAL message additionally stores
200
+ // `messageId`. This is the STORED shape — a relaxed
194
201
  // @ttt-productions/chat-core ChatMessageV1: `messageId` is the doc id (only sometimes persisted) and
195
202
  // `threadId` is not stored.
196
203
  // A chat message carries NO file reference — files live in the conversation's
@@ -208,15 +215,13 @@ export const ChatMessageV1Schema = z.object({
208
215
  // admin-dispatch messages that don't carry it.
209
216
  guildInviteId: z.string().optional(),
210
217
  isSystemMessage: z.boolean().optional(),
218
+ sentAs: ChatMessageSentAsSchema.optional(),
211
219
  meta: z.record(z.string(), z.unknown()).optional(),
212
- // NO moderation tombstone flag: the `hidden` field existed solely for the removed
213
- // admin-work-message report type's single-doc flip, and admin correspondence is not
214
- // reportable or moderatable at all (DJ ruling 2026-07-29). Nothing can write it, so
215
- // the field is gone rather than left as unreachable schema surface.
216
- // NO reply pointer, for the same reason: no chat surface has an authoring affordance
217
- // for replying to a specific message (chat-react's MessageActions renders only
218
- // Report/Delete; the composer's onSend takes text alone), so nothing could ever
219
- // populate a `replyTo` (DJ ruling 2026-07-29). This object is deliberately NOT
220
+ // NO moderation tombstone flag: admin correspondence is not reportable or moderatable at
221
+ // all, so nothing can write one.
222
+ // NO reply pointer: no chat surface has an authoring affordance for replying to a specific
223
+ // message (chat-react's MessageActions renders only Report/Delete; the composer's onSend
224
+ // takes text alone), so nothing could ever populate a `replyTo`. This object is deliberately NOT
220
225
  // `.strict()`, so a legacy stored doc that still carries the key parses fine — the
221
226
  // value is stripped, never persisted forward, and no migration is required.
222
227
  });
@@ -1 +1 @@
1
- {"version":3,"file":"messaging.js","sourceRoot":"","sources":["../../src/doc-schemas/messaging.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,sFAAsF;AACtF,qFAAqF;AACrF,8BAA8B;AAE9B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EACL,mCAAmC,EACnC,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,qBAAqB,EACrB,YAAY,GACb,MAAM,qB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MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,eAAe,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACvC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE;IAClD,kFAAkF;IAClF,oFAAoF;IACpF,oFAAoF;IACpF,oEAAoE;IACpE,qFAAqF;IACrF,+EAA+E;IAC/E,gFAAgF;IAChF,+EAA+E;IAC/E,mFAAmF;IACnF,4EAA4E;CAC7E,CAAC,CAAC","sourcesContent":["// Messaging parent-thread Firestore document SCHEMAS — guildChatChannels, the\n// guildInviteConversations shell, and pendingAdminDispatches. Per-message body shapes\n// live in @ttt-productions/chat-core (ChatMessageV1); ttt-core owns the thread docs.\n// Types inferred via z.infer.\n\nimport { z } from 'zod';\nimport { InviteSourceSchema } from '../schemas/work-project-management.js';\nimport {\n guildInviteConversationStatusSchema,\n thresholdItemIdSchema,\n hallItemIdSchema,\n hallSubItemIdSchema,\n changeRequestIdSchema,\n userIdSchema,\n} from '../schemas/atoms.js';\nimport { ContentMediaKindSchema } from './media-assets.js';\n\nconst userRefSchema = z.object({ uid: z.string() });\n\n// ===========================================================================\n// CONVERSATION FILES — the flat, Firestore-owned file list on a conversation.\n// Replaces inline chat attachments: a file is associated WITH a conversation but\n// never embedded in, sequenced with, or mutated through a chat message.\n// See ttt-prod docs/design/upload-and-media-pipeline.md.\n// ===========================================================================\n\n/** Backend-owned Conversation Files counters carried by EVERY conversation parent\n * (guildInviteConversations/{id} and pendingAdminDispatches/{id}). All four are\n * optional — an absent field reads as 0, so no pre-existing conversation needs a\n * backfill. Clients can never write them (rules + callable-only writes). */\nconst conversationFileCounterFields = {\n /** Published ACTIVE files in this conversation. */\n conversationFileCount: z.number().optional(),\n /** Published STORED-OUTPUT bytes in this conversation. */\n conversationFileBytesUsed: z.number().optional(),\n /** Active quota RESERVATIONS (uploads in flight). */\n conversationFileUploadCount: z.number().optional(),\n /** Bytes reserved by active uploads. */\n conversationFileBytesReserved: z.number().optional(),\n} as const;\n\n/**\n * `{conversationParent}/conversationFiles/{conversationFileId}` — the conversation's\n * lightweight ownership/list projection, analogous to `WorkFileSchema`.\n *\n * DELIBERATELY ABSENT (owned elsewhere, never duplicated here):\n * - no `status` / `ready` / `publicationState` / processing progress — `pendingMedia`\n * and `mediaAssets` own the lifecycle; the mere EXISTENCE of this doc means the\n * asset is published;\n * - no Firebase / R2 / gateway / signed / download URL — display URLs are built at\n * render time through the protected media gateway;\n * - no Firebase staging `storagePath`;\n * - no username / display name / avatar / Work name snapshot (ARCH-103) — resolve\n * `uploadedByUid` at render time.\n *\n * `conversationFileId` is deterministic: it IS the `pendingMediaId`. The publication\n * adapter creates this doc with `transaction.create` (never `set`), so an id\n * collision cannot overwrite and double-count an existing file.\n */\nexport const ConversationFileSchema = z.object({\n conversationFileId: z.string(),\n mediaAssetId: z.string(),\n name: z.string(),\n // The canonical stored content media kind — never a re-declared union (ARCH-102).\n mediaKind: ContentMediaKindSchema,\n contentType: z.string(),\n /** Sum of the PUBLISHED variant bytes (stored output, not raw upload bytes). */\n sizeBytes: z.number(),\n uploadedByUid: z.string(),\n createdAt: z.number(),\n});\nexport type ConversationFile = z.infer<typeof ConversationFileSchema>;\n\nexport const GuildChatChannelSchema = z.object({\n guildChatChannelId: z.string(),\n workProjectId: z.string(),\n channelName: z.string(),\n description: z.string().optional(),\n // Who may use the channel is decided from this list alone, by `canAccessGuildChatChannel`.\n requiredGuildStandings: z.array(z.string()),\n createdAt: z.number(),\n // NOTE: createdBy here is a flat uid string (unlike the `{ uid }` object form on\n // most other docs). Preserved as-is; flagged in the schema-registry recon.\n createdBy: z.string(),\n lastMessageAt: z.string().optional(),\n lastMessage: z.string().optional(),\n messageCount: z.number(),\n isArchived: z.boolean(),\n // Delete/tombstone marker (ttt-prod docs/design/chat-realtime-system.md \"Channel lifecycle semantics\").\n // Independent of `isArchived`: archive = visible-under-a-toggle, delete = gone from every user's\n // UI with grants revoked and sends rejected DO-side; storage is RETAINED (never a physical purge).\n // Optional, absent ⇒ false, so existing/seeded channels need no backfill. Backend-only-writable.\n isDeleted: z.boolean().optional(),\n // Monotonic config version for the chat-realtime sync layer (Contract B). Bumped by\n // each channel create / edit / archive / delete in the authoritative txn; the\n // `config` chatSyncEvents + channel-scoped fanout key on it. Absent ⇒ 0.\n configVersion: z.number().optional(),\n});\nexport type GuildChatChannel = z.infer<typeof GuildChatChannelSchema>;\n\n// The guildInviteConversations/{guildInviteId} doc as actually written by inviteUserToGuild\n// (and mutated by the accept/decline/finalize/cancel callables). This is the single source of\n// truth — the former duplicate `GuildInviteSchema` in ./work-project.ts was a stale, narrower\n// shape that the callable bypassed with an `as unknown as` cast. The inviter is `createdBy`\n// (== `sender`); there is no separate `workSteward`/`workProjectTitle` field (the title lives in\n// `workProject.workingTitle`).\nexport const GuildInviteConversationSchema = z.object({\n guildInviteId: z.string(),\n workProjectId: z.string(),\n relatedUserIds: z.array(z.string()),\n // Title/description are NOT snapshotted (Display Identity Invariant — resolve at render\n // from publicWorkProjects by id). `type` (Tales/Tunes/Television) is an immutable\n // classification, not display text, and IS consumed by an invites-list type filter\n // (guild-invites-section.tsx), so it stays. Triggers read only `workProjectId`.\n workProject: z.object({\n workProjectId: z.string(),\n type: z.string(),\n }),\n createdBy: userRefSchema,\n sender: userRefSchema,\n recipient: userRefSchema,\n stakeSharesOffered: z.number().int().min(1),\n source: InviteSourceSchema,\n // State machine: pending → accepted (transient, trigger-consumed) → finalized (terminal\n // success), or pending → declined / cancelled (terminal failure). No 'error' state is ever\n // written (dead state removed 2026-07-03). See ttt-prod\n // docs/design/work-guild-membership-and-stake.md for the invite lifecycle.\n status: guildInviteConversationStatusSchema,\n createdAt: z.number(),\n updatedAt: z.number(),\n lastUpdatedAt: z.number(),\n finalizedAt: z.number().optional(),\n senderConfirmed: z.boolean(),\n // The account that gave the Work's agreement (the sender or any of the Work's invite handlers):\n // set with `senderConfirmed: true`, removed whenever `senderConfirmed` goes false, and carried\n // by the accept audit event.\n senderConfirmedBy: userIdSchema.optional(),\n recipientConfirmed: z.boolean(),\n // Conversation Files quota counters for THIS invite conversation (per-conversation\n // caps: MAX_CONVERSATION_FILES / MAX_CONVERSATION_FILE_STORAGE_BYTES). Reserved at\n // startUpload, transferred to used at publication, released on every terminal path,\n // decremented on delete. Backend-only-writable; absent ⇒ 0.\n ...conversationFileCounterFields,\n});\nexport type GuildInviteConversation = z.infer<typeof GuildInviteConversationSchema>;\n\n// The `listGuildInvites` answer: one page of a Work's invite history and the opaque cursor of\n// the next page, `null` on the last. Homed beside the invite doc because this module imports\n// ./schemas (`InviteSourceSchema`), so the reverse import would be a module cycle; ./schemas\n// re-exports it with the callable's input.\nexport const ListGuildInvitesResultSchema = z.object({\n invites: z.array(GuildInviteConversationSchema),\n nextCursor: z.string().min(1).nullable(),\n}).strict();\nexport type ListGuildInvitesResult = z.infer<typeof ListGuildInvitesResultSchema>;\n\n// Typed context ref carried by a dispatch thread born from a review send-back, a\n// moderation placeholder, or a published change request — lets the admin queue card\n// say what the thread is about without parsing the subject line. Extensible union;\n// server-validated against the thread's party (never trusted raw from the client).\nexport const AdminDispatchContextRefSchema = z.discriminatedUnion('kind', [\n z.object({ kind: z.literal('thresholdItem'), thresholdItemId: thresholdItemIdSchema }),\n z.object({\n kind: z.literal('hallContent'),\n hallItemId: hallItemIdSchema,\n // null ⇒ the hall parent DETAIL; set ⇒ a chapter/track/episode sub-item.\n subItemId: hallSubItemIdSchema.nullable(),\n }),\n z.object({ kind: z.literal('hallContentChangeRequest'), changeRequestId: changeRequestIdSchema }),\n]);\nexport type AdminDispatchContextRef = z.infer<typeof AdminDispatchContextRefSchema>;\n\nexport const AdminDispatchPartyKindSchema = z.enum(['user', 'workProject']);\nexport type AdminDispatchPartyKind = z.infer<typeof AdminDispatchPartyKindSchema>;\n\n// Who a message on a support thread is from: the system, the admin team, or the member side (the\n// thread owner, or a member of the Work on a Work thread). No writer stores it; it is derived from\n// the sender and the thread's party when a message is shown.\nexport const ADMIN_DISPATCH_SENDER_ROLES = ['user', 'admin', 'system'] as const;\nexport const AdminDispatchSenderRoleSchema = z.enum(ADMIN_DISPATCH_SENDER_ROLES);\nexport type AdminDispatchSenderRole = z.infer<typeof AdminDispatchSenderRoleSchema>;\n\nexport const AdminDispatchSchema = z.object({\n adminDispatchId: z.string(),\n // Party-generic dispatch: the platform corresponds with a PARTY — a user or a\n // workProject. REQUIRED and written explicitly at creation: the personal-threads\n // client query filters `partyKind == 'user'` and the Firestore read rules branch\n // on it party-aware, so an absent field is unqueryable and unauthorizable. For\n // 'user' threads `userId` is the thread owner (the sole member-side authority).\n // For 'workProject' threads `workProjectId` is set, read/reply authority is\n // ACTIVE GUILDMATE standing evaluated server-side (never a stored member list),\n // and `userId` holds the INITIATING member's uid for attribution only — it is\n // never a work-thread authority.\n partyKind: AdminDispatchPartyKindSchema,\n workProjectId: z.string().optional(),\n contextRef: AdminDispatchContextRefSchema.optional(),\n userId: z.string(),\n initiatorUserId: z.string(),\n initiatedBy: z.enum(['user', 'admin']),\n subject: z.string(),\n status: z.enum(['open', 'user_reply', 'admin_reply', 'closed_resolved', 'closed_unresolved']),\n createdAt: z.number(),\n lastUpdatedAt: z.number(),\n // Epoch ms of the thread's latest message — the anchor of each reader's per-person unread\n // marker (`dispatchReadMarkers`). Unlike `lastUpdatedAt`, a status change or close never moves it.\n lastMessageAt: z.number(),\n // True while the member side spoke last and no admin has replied — the admin queue's shared\n // \"Awaiting reply\" state. Not a read flag: nothing an admin opens clears it.\n awaitingAdminReply: z.boolean(),\n closedBy: z.string().optional(),\n // Conversation Files quota counters for THIS admin-support thread — same\n // per-conversation caps and same backend-only ownership as the invite conversation.\n ...conversationFileCounterFields,\n});\nexport type AdminDispatch = z.infer<typeof AdminDispatchSchema>;\n\n// Per-message body for admin-support `conversationMessages` — the ONE chat surface still\n// transported through Firestore (guild channel + invite messages are realtime-only, served\n// by the chat Worker Durable Object). Written by runSendGuildChatMessage (senderId/text/\n// createdAt); the admin-dispatch INITIAL message\n// (runStartAdminSupportThread) additionally stores `messageId`. This is the STORED shape — a relaxed\n// @ttt-productions/chat-core ChatMessageV1: `messageId` is the doc id (only sometimes persisted) and\n// `threadId` is not stored.\n// A chat message carries NO file reference — files live in the conversation's\n// `conversationFiles` subcollection (ConversationFileSchema above).\nexport const ChatMessageV1Schema = z.object({\n senderId: z.string(),\n text: z.string(),\n createdAt: z.number(),\n messageId: z.string().optional(),\n threadId: z.string().optional(),\n type: z.string().optional(),\n // Rides on the realtime invite-thread envelope (chat Worker invite Durable Object);\n // guild-invite messages are realtime-only — there is no Firestore inviteMessages\n // subcollection. Optional so the same body schema still fits the guildChat /\n // admin-dispatch messages that don't carry it.\n guildInviteId: z.string().optional(),\n isSystemMessage: z.boolean().optional(),\n meta: z.record(z.string(), z.unknown()).optional(),\n // NO moderation tombstone flag: the `hidden` field existed solely for the removed\n // admin-work-message report type's single-doc flip, and admin correspondence is not\n // reportable or moderatable at all (DJ ruling 2026-07-29). Nothing can write it, so\n // the field is gone rather than left as unreachable schema surface.\n // NO reply pointer, for the same reason: no chat surface has an authoring affordance\n // for replying to a specific message (chat-react's MessageActions renders only\n // Report/Delete; the composer's onSend takes text alone), so nothing could ever\n // populate a `replyTo` (DJ ruling 2026-07-29). This object is deliberately NOT\n // `.strict()`, so a legacy stored doc that still carries the key parses fine — the\n // value is stripped, never persisted forward, and no migration is required.\n});\nexport type ChatMessageV1Doc = z.infer<typeof ChatMessageV1Schema>;\n"]}
1
+ {"version":3,"file":"messaging.js","sourceRoot":"","sources":["../../src/doc-schemas/messaging.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,sFAAsF;AACtF,qFAAqF;AACrF,8BAA8B;AAE9B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EACL,mCA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EAAE;IAC/B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,oFAAoF;IACpF,iFAAiF;IACjF,6EAA6E;IAC7E,+CAA+C;IAC/C,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,eAAe,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACvC,MAAM,EAAE,uBAAuB,CAAC,QAAQ,EAAE;IAC1C,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE;IAClD,yFAAyF;IACzF,iCAAiC;IACjC,2FAA2F;IAC3F,yFAAyF;IACzF,iGAAiG;IACjG,mFAAmF;IACnF,4EAA4E;CAC7E,CAAC,CAAC","sourcesContent":["// Messaging parent-thread Firestore document SCHEMAS — guildChatChannels, the\n// guildInviteConversations shell, and pendingAdminDispatches. Per-message body shapes\n// live in @ttt-productions/chat-core (ChatMessageV1); ttt-core owns the thread docs.\n// Types inferred via z.infer.\n\nimport { z } from 'zod';\nimport { InviteSourceSchema } from '../schemas/work-project-management.js';\nimport {\n guildInviteConversationStatusSchema,\n thresholdItemIdSchema,\n hallItemIdSchema,\n hallSubItemIdSchema,\n changeRequestIdSchema,\n userIdSchema,\n} from '../schemas/atoms.js';\nimport { ContentMediaKindSchema } from './media-assets.js';\n\nconst userRefSchema = z.object({ uid: z.string() });\n\n// ===========================================================================\n// CONVERSATION FILES — the flat, Firestore-owned file list on a conversation.\n// Replaces inline chat attachments: a file is associated WITH a conversation but\n// never embedded in, sequenced with, or mutated through a chat message.\n// See ttt-prod docs/design/upload-and-media-pipeline.md.\n// ===========================================================================\n\n/** Backend-owned Conversation Files counters carried by EVERY conversation parent\n * (guildInviteConversations/{id} and pendingAdminDispatches/{id}). All four are\n * optional — an absent field reads as 0, so no pre-existing conversation needs a\n * backfill. Clients can never write them (rules + callable-only writes). */\nconst conversationFileCounterFields = {\n /** Published ACTIVE files in this conversation. */\n conversationFileCount: z.number().optional(),\n /** Published STORED-OUTPUT bytes in this conversation. */\n conversationFileBytesUsed: z.number().optional(),\n /** Active quota RESERVATIONS (uploads in flight). */\n conversationFileUploadCount: z.number().optional(),\n /** Bytes reserved by active uploads. */\n conversationFileBytesReserved: z.number().optional(),\n} as const;\n\n/**\n * `{conversationParent}/conversationFiles/{conversationFileId}` — the conversation's\n * lightweight ownership/list projection, analogous to `WorkFileSchema`.\n *\n * DELIBERATELY ABSENT (owned elsewhere, never duplicated here):\n * - no `status` / `ready` / `publicationState` / processing progress — `pendingMedia`\n * and `mediaAssets` own the lifecycle; the mere EXISTENCE of this doc means the\n * asset is published;\n * - no Firebase / R2 / gateway / signed / download URL — display URLs are built at\n * render time through the protected media gateway;\n * - no Firebase staging `storagePath`;\n * - no username / display name / avatar / Work name snapshot (ARCH-103) — resolve\n * `uploadedByUid` at render time.\n *\n * `conversationFileId` is deterministic: it IS the `pendingMediaId`. The publication\n * adapter creates this doc with `transaction.create` (never `set`), so an id\n * collision cannot overwrite and double-count an existing file.\n */\nexport const ConversationFileSchema = z.object({\n conversationFileId: z.string(),\n mediaAssetId: z.string(),\n name: z.string(),\n // The canonical stored content media kind — never a re-declared union (ARCH-102).\n mediaKind: ContentMediaKindSchema,\n contentType: z.string(),\n /** Sum of the PUBLISHED variant bytes (stored output, not raw upload bytes). */\n sizeBytes: z.number(),\n uploadedByUid: z.string(),\n createdAt: z.number(),\n});\nexport type ConversationFile = z.infer<typeof ConversationFileSchema>;\n\nexport const GuildChatChannelSchema = z.object({\n guildChatChannelId: z.string(),\n workProjectId: z.string(),\n channelName: z.string(),\n description: z.string().optional(),\n // Who may use the channel is decided from this list alone, by `canAccessGuildChatChannel`.\n requiredGuildStandings: z.array(z.string()),\n createdAt: z.number(),\n // NOTE: createdBy here is a flat uid string (unlike the `{ uid }` object form on\n // most other docs). Preserved as-is; flagged in the schema-registry recon.\n createdBy: z.string(),\n lastMessageAt: z.string().optional(),\n lastMessage: z.string().optional(),\n messageCount: z.number(),\n isArchived: z.boolean(),\n // Delete/tombstone marker (ttt-prod docs/design/chat-realtime-system.md \"Channel lifecycle semantics\").\n // Independent of `isArchived`: archive = visible-under-a-toggle, delete = gone from every user's\n // UI with grants revoked and sends rejected DO-side; storage is RETAINED (never a physical purge).\n // Optional, absent ⇒ false, so existing/seeded channels need no backfill. Backend-only-writable.\n isDeleted: z.boolean().optional(),\n // Monotonic config version for the chat-realtime sync layer (Contract B). Bumped by\n // each channel create / edit / archive / delete in the authoritative txn; the\n // `config` chatSyncEvents + channel-scoped fanout key on it. Absent ⇒ 0.\n configVersion: z.number().optional(),\n});\nexport type GuildChatChannel = z.infer<typeof GuildChatChannelSchema>;\n\n// The guildInviteConversations/{guildInviteId} doc as actually written by inviteUserToGuild\n// (and mutated by the accept/decline/finalize/cancel callables). This is the single source of\n// truth — the former duplicate `GuildInviteSchema` in ./work-project.ts was a stale, narrower\n// shape that the callable bypassed with an `as unknown as` cast. The inviter is `createdBy`\n// (== `sender`); there is no separate `workSteward`/`workProjectTitle` field (the title lives in\n// `workProject.workingTitle`).\nexport const GuildInviteConversationSchema = z.object({\n guildInviteId: z.string(),\n workProjectId: z.string(),\n relatedUserIds: z.array(z.string()),\n // Title/description are NOT snapshotted (Display Identity Invariant — resolve at render\n // from publicWorkProjects by id). `type` (Tales/Tunes/Television) is an immutable\n // classification, not display text, and IS consumed by an invites-list type filter\n // (guild-invites-section.tsx), so it stays. Triggers read only `workProjectId`.\n workProject: z.object({\n workProjectId: z.string(),\n type: z.string(),\n }),\n createdBy: userRefSchema,\n sender: userRefSchema,\n recipient: userRefSchema,\n stakeSharesOffered: z.number().int().min(1),\n source: InviteSourceSchema,\n // State machine: pending → accepted (transient, trigger-consumed) → finalized (terminal\n // success), or pending → declined / cancelled (terminal failure). No 'error' state is ever\n // written (dead state removed 2026-07-03). See ttt-prod\n // docs/design/work-guild-membership-and-stake.md for the invite lifecycle.\n status: guildInviteConversationStatusSchema,\n createdAt: z.number(),\n updatedAt: z.number(),\n lastUpdatedAt: z.number(),\n finalizedAt: z.number().optional(),\n senderConfirmed: z.boolean(),\n // The account that gave the Work's agreement (the sender or any of the Work's invite handlers):\n // set with `senderConfirmed: true`, removed whenever `senderConfirmed` goes false, and carried\n // by the accept audit event.\n senderConfirmedBy: userIdSchema.optional(),\n recipientConfirmed: z.boolean(),\n // Conversation Files quota counters for THIS invite conversation (per-conversation\n // caps: MAX_CONVERSATION_FILES / MAX_CONVERSATION_FILE_STORAGE_BYTES). Reserved at\n // startUpload, transferred to used at publication, released on every terminal path,\n // decremented on delete. Backend-only-writable; absent ⇒ 0.\n ...conversationFileCounterFields,\n});\nexport type GuildInviteConversation = z.infer<typeof GuildInviteConversationSchema>;\n\n// The `listGuildInvites` answer: one page of a Work's invite history and the opaque cursor of\n// the next page, `null` on the last. Homed beside the invite doc because this module imports\n// ./schemas (`InviteSourceSchema`), so the reverse import would be a module cycle; ./schemas\n// re-exports it with the callable's input.\nexport const ListGuildInvitesResultSchema = z.object({\n invites: z.array(GuildInviteConversationSchema),\n nextCursor: z.string().min(1).nullable(),\n}).strict();\nexport type ListGuildInvitesResult = z.infer<typeof ListGuildInvitesResultSchema>;\n\n// Typed context ref carried by a dispatch thread born from a review send-back, a\n// moderation placeholder, or a published change request — lets the admin queue card\n// say what the thread is about without parsing the subject line. Extensible union;\n// server-validated against the thread's party (never trusted raw from the client).\nexport const AdminDispatchContextRefSchema = z.discriminatedUnion('kind', [\n z.object({ kind: z.literal('thresholdItem'), thresholdItemId: thresholdItemIdSchema }),\n z.object({\n kind: z.literal('hallContent'),\n hallItemId: hallItemIdSchema,\n // null ⇒ the hall parent DETAIL; set ⇒ a chapter/track/episode sub-item.\n subItemId: hallSubItemIdSchema.nullable(),\n }),\n z.object({ kind: z.literal('hallContentChangeRequest'), changeRequestId: changeRequestIdSchema }),\n]);\nexport type AdminDispatchContextRef = z.infer<typeof AdminDispatchContextRefSchema>;\n\nexport const AdminDispatchPartyKindSchema = z.enum(['user', 'workProject']);\nexport type AdminDispatchPartyKind = z.infer<typeof AdminDispatchPartyKindSchema>;\n\n// The capacity a support-thread message was sent in, written by the backend in the message's\n// creation transaction from the verified actor — never from current claims, the roster, Work\n// membership, or a client field. `admin` marks a message sent with verified admin authority; an\n// ordinary message (a member, or an admin acting as a participant) stores no value at all.\nexport const ChatMessageSentAsSchema = z.enum(['admin']);\nexport type ChatMessageSentAs = z.infer<typeof ChatMessageSentAsSchema>;\n\n/**\n * Whether a stored (or mapped) support-thread message was sent with verified admin authority. Reads\n * only the recorded value: a missing or malformed one is an ordinary message, never a guess.\n */\nexport function isChatMessageSentAsAdmin(sentAs: unknown): boolean {\n return ChatMessageSentAsSchema.safeParse(sentAs).success;\n}\n\nexport const AdminDispatchSchema = z.object({\n adminDispatchId: z.string(),\n // Party-generic dispatch: the platform corresponds with a PARTY — a user or a\n // workProject. REQUIRED and written explicitly at creation: the personal-threads\n // client query filters `partyKind == 'user'` and the Firestore read rules branch\n // on it party-aware, so an absent field is unqueryable and unauthorizable. For\n // 'user' threads `userId` is the thread owner (the sole member-side authority).\n // For 'workProject' threads `workProjectId` is set, read/reply authority is\n // ACTIVE GUILDMATE standing evaluated server-side (never a stored member list),\n // and `userId` holds the INITIATING member's uid for attribution only — it is\n // never a work-thread authority.\n partyKind: AdminDispatchPartyKindSchema,\n workProjectId: z.string().optional(),\n contextRef: AdminDispatchContextRefSchema.optional(),\n userId: z.string(),\n initiatorUserId: z.string(),\n initiatedBy: z.enum(['user', 'admin']),\n subject: z.string(),\n status: z.enum(['open', 'user_reply', 'admin_reply', 'closed_resolved', 'closed_unresolved']),\n createdAt: z.number(),\n lastUpdatedAt: z.number(),\n // Epoch ms of the thread's latest message — the anchor of each reader's per-person unread\n // marker (`dispatchReadMarkers`). Unlike `lastUpdatedAt`, a status change or close never moves it.\n lastMessageAt: z.number(),\n // True while the member side spoke last and no admin has replied — the admin queue's shared\n // \"Awaiting reply\" state. Not a read flag: nothing an admin opens clears it.\n awaitingAdminReply: z.boolean(),\n closedBy: z.string().optional(),\n // Conversation Files quota counters for THIS admin-support thread — same\n // per-conversation caps and same backend-only ownership as the invite conversation.\n ...conversationFileCounterFields,\n});\nexport type AdminDispatch = z.infer<typeof AdminDispatchSchema>;\n\n// Per-message body for admin-support `conversationMessages` — the ONE chat surface still\n// transported through Firestore (guild channel + invite messages are realtime-only, served\n// by the chat Worker Durable Object). Written by runSendGuildChatMessage (senderId/text/\n// createdAt, plus `sentAs` on an admin send); a thread's INITIAL message additionally stores\n// `messageId`. This is the STORED shape — a relaxed\n// @ttt-productions/chat-core ChatMessageV1: `messageId` is the doc id (only sometimes persisted) and\n// `threadId` is not stored.\n// A chat message carries NO file reference — files live in the conversation's\n// `conversationFiles` subcollection (ConversationFileSchema above).\nexport const ChatMessageV1Schema = z.object({\n senderId: z.string(),\n text: z.string(),\n createdAt: z.number(),\n messageId: z.string().optional(),\n threadId: z.string().optional(),\n type: z.string().optional(),\n // Rides on the realtime invite-thread envelope (chat Worker invite Durable Object);\n // guild-invite messages are realtime-only — there is no Firestore inviteMessages\n // subcollection. Optional so the same body schema still fits the guildChat /\n // admin-dispatch messages that don't carry it.\n guildInviteId: z.string().optional(),\n isSystemMessage: z.boolean().optional(),\n sentAs: ChatMessageSentAsSchema.optional(),\n meta: z.record(z.string(), z.unknown()).optional(),\n // NO moderation tombstone flag: admin correspondence is not reportable or moderatable at\n // all, so nothing can write one.\n // NO reply pointer: no chat surface has an authoring affordance for replying to a specific\n // message (chat-react's MessageActions renders only Report/Delete; the composer's onSend\n // takes text alone), so nothing could ever populate a `replyTo`. This object is deliberately NOT\n // `.strict()`, so a legacy stored doc that still carries the key parses fine — the\n // value is stripped, never persisted forward, and no migration is required.\n});\nexport type ChatMessageV1Doc = z.infer<typeof ChatMessageV1Schema>;\n"]}
@@ -2037,6 +2037,9 @@ export declare const COLLECTION_SCHEMAS: {
2037
2037
  type: z.ZodOptional<z.ZodString>;
2038
2038
  guildInviteId: z.ZodOptional<z.ZodString>;
2039
2039
  isSystemMessage: z.ZodOptional<z.ZodBoolean>;
2040
+ sentAs: z.ZodOptional<z.ZodEnum<{
2041
+ admin: "admin";
2042
+ }>>;
2040
2043
  meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2041
2044
  }, z.core.$strip>;
2042
2045
  readonly 'pendingAdminDispatches/{adminDispatchId}/conversationFiles/{conversationFileId}': z.ZodObject<{
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/registry.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAqN7B,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuQkB,CAAC;AAElD,MAAM,MAAM,wBAAwB,GAAG,MAAM,OAAO,kBAAkB,CAAC;AAEvE;;;;;;;;;GASG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;CAmBiC,CAAC;AAEvE;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,mBAAmB,EAAE,SAAS,MAAM,EAOvC,CAAC"}
@@ -81,17 +81,13 @@ export declare const GUILD_STANDING_VALUES: GuildStandingValue[];
81
81
  export declare const WORK_FILE_ADMIN_GUILD_STANDING_IDS: readonly ["StewardOwner", "WorkProjectManager", "WorkAssetAdmin"];
82
82
  /**
83
83
  * A Work's invite handlers: they send the Work's invites, list them, cancel them, and take the
84
- * Work's side in every invite conversation — they see it, reply in it, and accept for the Work.
84
+ * Work's side in every invite conversation — they see it, reply in it, share files in it, and
85
+ * agree for the Work. A Stake Share Manager is one: it handles invites like an Invite Manager and
86
+ * also changes their offers.
85
87
  */
86
- export declare const GUILD_INVITE_HANDLER_GUILD_STANDING_IDS: readonly ["StewardOwner", "WorkProjectManager", "InviteManager"];
88
+ export declare const GUILD_INVITE_HANDLER_GUILD_STANDING_IDS: readonly ["StewardOwner", "WorkProjectManager", "InviteManager", "StakeShareManager"];
87
89
  /** The standings that change stake amounts — active Guildmates' stakes and pending invite offers. */
88
90
  export declare const STAKE_SHARE_POWER_GUILD_STANDING_IDS: readonly ["StewardOwner", "WorkProjectManager", "StakeShareManager"];
89
- /**
90
- * The standings that open the Work's invites: the invite handlers, and the stake-power standings,
91
- * which open an invite to change its offer. Opening an invite is not taking part in it — the
92
- * conversation, its files, the Work's agreement, and cancelling stay the handlers'.
93
- */
94
- export declare const GUILD_INVITE_VIEWER_GUILD_STANDING_IDS: readonly GuildStandingId[];
95
91
  export declare const WORK_PROJECT_ACTIONS: {
96
92
  readonly 'workProject.read': {
97
93
  readonly label: "Read workProject";
@@ -121,17 +117,17 @@ export declare const WORK_PROJECT_ACTIONS: {
121
117
  readonly 'guildInvite.send': {
122
118
  readonly label: "Send invites";
123
119
  readonly description: "Start a workProject invite conversation and reserve pending stakes.";
124
- readonly grantedTo: readonly ["StewardOwner", "WorkProjectManager", "InviteManager"];
120
+ readonly grantedTo: readonly ["StewardOwner", "WorkProjectManager", "InviteManager", "StakeShareManager"];
125
121
  };
126
122
  readonly 'guildInvite.list': {
127
123
  readonly label: "List invites";
128
- readonly description: string;
129
- readonly grantedTo: readonly ("StewardOwner" | "WorkProjectManager" | "PublicWorkProjectEditor" | "GuildStandingManager" | "StakeShareManager" | "InviteManager" | "WorkAssetAdmin" | "CommissionManager" | "AuditionManager" | "HallLibraryEditor" | "HallLibrarySubmitter" | "GuildChatChannelManager")[];
124
+ readonly description: "Open the Work's invites and see their state and offers.";
125
+ readonly grantedTo: readonly ["StewardOwner", "WorkProjectManager", "InviteManager", "StakeShareManager"];
130
126
  };
131
127
  readonly 'guildInvite.revokeAny': {
132
128
  readonly label: "Revoke pending invites";
133
129
  readonly description: "Cancel or revoke pending workProject invites.";
134
- readonly grantedTo: readonly ["StewardOwner", "WorkProjectManager", "InviteManager"];
130
+ readonly grantedTo: readonly ["StewardOwner", "WorkProjectManager", "InviteManager", "StakeShareManager"];
135
131
  };
136
132
  readonly 'guildInvite.stakeShares.update': {
137
133
  readonly label: "Update invite stakes";
@@ -1 +1 @@
1
- {"version":3,"file":"work-project-permissions-data.d.ts","sourceRoot":"","sources":["../../src/permissions/work-project-permissions-data.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiDlB,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,eAAe,CAAC;AAC3D,eAAO,MAAM,kBAAkB,EAAmC,eAAe,EAAE,CAAC;AAEpF;;;;;GAKG;AACH,eAAO,MAAM,+BAA+B,gBAAoD,CAAC;AACjG,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;CAaa,CAAC;AACrD,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,0BAA0B,CAAC,CAAC,eAAe,CAAC,CAAC;AACtF,eAAO,MAAM,qBAAqB,EAAgD,kBAAkB,EAAE,CAAC;AAEvG;;;;GAIG;AACH,eAAO,MAAM,kCAAkC,mEAIA,CAAC;AAEhD;;;GAGG;AACH,eAAO,MAAM,uCAAuC,kEAIL,CAAC;AAEhD,qGAAqG;AACrG,eAAO,MAAM,oCAAoC,sEAIF,CAAC;AAEhD;;;;GAIG;AACH,eAAO,MAAM,sCAAsC,EAAE,SAAS,eAAe,EAE5E,CAAC;AAEF,eAAO,MAAM,oBAAoB;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkN/B,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,MAAM,OAAO,oBAAoB,CAAC;AACpE,eAAO,MAAM,uBAAuB,EAAwC,mBAAmB,EAAE,CAAC"}
@@ -83,12 +83,15 @@ export const WORK_FILE_ADMIN_GUILD_STANDING_IDS = [
83
83
  ];
84
84
  /**
85
85
  * A Work's invite handlers: they send the Work's invites, list them, cancel them, and take the
86
- * Work's side in every invite conversation — they see it, reply in it, and accept for the Work.
86
+ * Work's side in every invite conversation — they see it, reply in it, share files in it, and
87
+ * agree for the Work. A Stake Share Manager is one: it handles invites like an Invite Manager and
88
+ * also changes their offers.
87
89
  */
88
90
  export const GUILD_INVITE_HANDLER_GUILD_STANDING_IDS = [
89
91
  'StewardOwner',
90
92
  'WorkProjectManager',
91
93
  'InviteManager',
94
+ 'StakeShareManager',
92
95
  ];
93
96
  /** The standings that change stake amounts — active Guildmates' stakes and pending invite offers. */
94
97
  export const STAKE_SHARE_POWER_GUILD_STANDING_IDS = [
@@ -96,14 +99,6 @@ export const STAKE_SHARE_POWER_GUILD_STANDING_IDS = [
96
99
  'WorkProjectManager',
97
100
  'StakeShareManager',
98
101
  ];
99
- /**
100
- * The standings that open the Work's invites: the invite handlers, and the stake-power standings,
101
- * which open an invite to change its offer. Opening an invite is not taking part in it — the
102
- * conversation, its files, the Work's agreement, and cancelling stay the handlers'.
103
- */
104
- export const GUILD_INVITE_VIEWER_GUILD_STANDING_IDS = [
105
- ...new Set([...GUILD_INVITE_HANDLER_GUILD_STANDING_IDS, ...STAKE_SHARE_POWER_GUILD_STANDING_IDS]),
106
- ];
107
102
  export const WORK_PROJECT_ACTIONS = {
108
103
  'workProject.read': {
109
104
  label: 'Read workProject',
@@ -141,9 +136,8 @@ export const WORK_PROJECT_ACTIONS = {
141
136
  },
142
137
  'guildInvite.list': {
143
138
  label: 'List invites',
144
- description: "Open the Work's invites and see their state and offers. A stake-power standing opens an invite " +
145
- 'to change its offer; replying, agreeing for the Work, and cancelling stay with the invite handlers.',
146
- grantedTo: GUILD_INVITE_VIEWER_GUILD_STANDING_IDS,
139
+ description: "Open the Work's invites and see their state and offers.",
140
+ grantedTo: GUILD_INVITE_HANDLER_GUILD_STANDING_IDS,
147
141
  },
148
142
  'guildInvite.revokeAny': {
149
143
  label: 'Revoke pending invites',
@@ -1 +1 @@
1
- {"version":3,"file":"work-project-permissions-data.js","sourceRoot":"","sources":["../../src/permissions/work-project-permissions-data.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,YAAY,EAAE;QACZ,KAAK,EAAE,SAAS;QAChB,WAAW,EAAE,8JAA8J;KAC5K;IACD,kBAAkB,EAAE;QAClB,KAAK,EAAE,qBAAqB;QAC5B,WAAW,EAAE,+HAA+H;KAC7I;IACD,uBAAuB,EAAE;QACvB,KAAK,EAAE,2BAA2B;QAClC,WAAW,EAAE,kEAAkE;KAChF;IACD,oBAAoB,EAAE;QACpB,KAAK,EAAE,wBAAwB;QAC/B,WAAW,EAAE,0NAA0N;KACxO;IACD,iBAAiB,EAAE;QACjB,KAAK,EAAE,qBAAqB;QAC5B,WAAW,EAAE,qEAAqE;KACnF;IACD,aAAa,EAAE;QACb,KAAK,EAAE,gBAAgB;QACvB,WAAW,EAAE,wFAAwF;KACtG;IACD,cAAc,EAAE;QACd,KAAK,EAAE,kBAAkB;QACzB,WAAW,EAAE,2LAA2L;KACzM;IACD,iBAAiB,EAAE;QACjB,KAAK,EAAE,oBAAoB;QAC3B,WAAW,EAAE,wGAAwG;KACtH;IACD,eAAe,EAAE;QACf,KAAK,EAAE,kBAAkB;QACzB,WAAW,EAAE,iFAAiF;KAC/F;IACD,iBAAiB,EAAE;QACjB,KAAK,EAAE,aAAa;QACpB,WAAW,EAAE,iFAAiF;KAC/F;IACD,oBAAoB,EAAE;QACpB,KAA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CAAgC;QACvC,WAAW,EAAE,uDAAuD;QACpE,SAAS,EAAE,CAAC,cAAc,EAAE,oBAAoB,EAAE,yBAAyB,CAAC;KAC7E;IACD,yBAAyB,EAAE;QACzB,KAAK,EAAE,sBAAsB;QAC7B,WAAW,EAAE,oEAAoE;QACjF,SAAS,EAAE,CAAC,cAAc,EAAE,oBAAoB,EAAE,yBAAyB,CAAC;KAC7E;IACD,qBAAqB,EAAE;QACrB,KAAK,EAAE,4BAA4B;QACnC,WAAW,EACT,0FAA0F;YAC1F,kFAAkF;QACpF,SAAS,EAAE,CAAC,cAAc,EAAE,oBAAoB,CAAC;KAClD;CAKD,CAAC;AAGH,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAA0B,CAAC","sourcesContent":["export const GUILD_STANDINGS = {\n StewardOwner: {\n label: 'Steward',\n description: 'Work steward. Holds all workProject actions implicitly. Assigned automatically at workProject creation and non-assignable via guild standing management UIs.',\n },\n WorkProjectManager: {\n label: 'WorkProject Manager',\n description: 'Can perform every workProject action except granting Steward, WorkProjectManager, GuildStandingManager, or StakeShareManager.',\n },\n PublicWorkProjectEditor: {\n label: 'Public WorkProject Editor',\n description: 'Can edit public-facing workProject title, description, and copy.',\n },\n GuildStandingManager: {\n label: 'Guild Standing Manager',\n description: 'Can assign and remove ordinary workProject guild standings without escalating manager, stake-share, or trade-profession authority (tradeProfessions are folder/chat access keys, editable only by file-admin standings).',\n },\n StakeShareManager: {\n label: 'Stake Share Manager',\n description: 'Can adjust active Guildmate stakes and pending invite stake offers.',\n },\n InviteManager: {\n label: 'Invite Manager',\n description: 'Can send workProject invites, view invite state, and cancel or revoke pending invites.',\n },\n WorkAssetAdmin: {\n label: 'Work Asset Admin',\n description: 'Delegated file-system administration: create/rename file folders, assign folder trade-profession access, view every folder and file, and delete any file. Assignable only by the Steward.',\n },\n CommissionManager: {\n label: 'Commission Manager',\n description: 'Can open and close workProject commissions and manage proposals without starting invite conversations.',\n },\n AuditionManager: {\n label: 'Audition Manager',\n description: 'Can open and close workProject auditions without starting invite conversations.',\n },\n HallLibraryEditor: {\n label: 'Hall Editor',\n description: 'Can create and edit Tales, Tunes, Television content, Genres, and media assets.',\n },\n HallLibrarySubmitter: {\n label: 'Hall Submitter',\n description: 'Can submit workProject hall content for admin hall review.',\n },\n GuildChatChannelManager: {\n label: 'Guild Chat Channel Manager',\n description: 'Can create, update, archive, and delete workProject chat channels.',\n },\n} as const;\n\nexport type GuildStandingId = keyof typeof GUILD_STANDINGS;\nexport const GUILD_STANDING_IDS = Object.keys(GUILD_STANDINGS) as GuildStandingId[];\n\n/**\n * The work steward's standing id — the one standing that is never assignable and that\n * `GuildmateUser.guildStandings` carries (that array stores IDs, not display values;\n * this id's display value is 'Steward', so the two are not interchangeable).\n * Consumers branch on this rather than re-quoting the member.\n */\nexport const STEWARD_OWNER_GUILD_STANDING_ID = 'StewardOwner' as const satisfies GuildStandingId;\nexport const GUILD_STANDING_VALUE_BY_ID = {\n StewardOwner: 'Steward',\n WorkProjectManager: 'WorkProjectManager',\n PublicWorkProjectEditor: 'PublicWorkProjectEditor',\n GuildStandingManager: 'GuildStandingManager',\n StakeShareManager: 'StakeShareManager',\n InviteManager: 'InviteManager',\n WorkAssetAdmin: 'WorkAssetAdmin',\n CommissionManager: 'CommissionManager',\n AuditionManager: 'AuditionManager',\n HallLibraryEditor: 'HallLibraryEditor',\n HallLibrarySubmitter: 'HallLibrarySubmitter',\n GuildChatChannelManager: 'GuildChatChannelManager',\n} as const satisfies Record<GuildStandingId, string>;\nexport type GuildStandingValue = (typeof GUILD_STANDING_VALUE_BY_ID)[GuildStandingId];\nexport const GUILD_STANDING_VALUES = Object.values(GUILD_STANDING_VALUE_BY_ID) as GuildStandingValue[];\n\n/**\n * The standings that administer a Work's file system: create and manage folders, see every folder\n * and file, upload anywhere, delete any file, and request a file's share to the Realm. Every file\n * action's grant reads this list, and so does the file-admin check (`isWorkFileAdmin`).\n */\nexport const WORK_FILE_ADMIN_GUILD_STANDING_IDS = [\n 'StewardOwner',\n 'WorkProjectManager',\n 'WorkAssetAdmin',\n] as const satisfies readonly GuildStandingId[];\n\n/**\n * A Work's invite handlers: they send the Work's invites, list them, cancel them, and take the\n * Work's side in every invite conversation — they see it, reply in it, and accept for the Work.\n */\nexport const GUILD_INVITE_HANDLER_GUILD_STANDING_IDS = [\n 'StewardOwner',\n 'WorkProjectManager',\n 'InviteManager',\n] as const satisfies readonly GuildStandingId[];\n\n/** The standings that change stake amounts — active Guildmates' stakes and pending invite offers. */\nexport const STAKE_SHARE_POWER_GUILD_STANDING_IDS = [\n 'StewardOwner',\n 'WorkProjectManager',\n 'StakeShareManager',\n] as const satisfies readonly GuildStandingId[];\n\n/**\n * The standings that open the Work's invites: the invite handlers, and the stake-power standings,\n * which open an invite to change its offer. Opening an invite is not taking part in it — the\n * conversation, its files, the Work's agreement, and cancelling stay the handlers'.\n */\nexport const GUILD_INVITE_VIEWER_GUILD_STANDING_IDS: readonly GuildStandingId[] = [\n ...new Set<GuildStandingId>([...GUILD_INVITE_HANDLER_GUILD_STANDING_IDS, ...STAKE_SHARE_POWER_GUILD_STANDING_IDS]),\n];\n\nexport const WORK_PROJECT_ACTIONS = {\n 'workProject.read': {\n label: 'Read workProject',\n description: 'Baseline active-Guildmate read floor for internal workProject state.',\n grantedTo: GUILD_STANDING_IDS,\n },\n 'workProject.metadata.update': {\n label: 'Update workProject metadata',\n description: 'Edit working title, description, and public workProject copy.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'PublicWorkProjectEditor'],\n },\n 'guildmateUser.guildStanding.update': {\n label: 'Update Guildmate guild standings',\n description: 'Assign or remove workProject guild standings on active Guildmates.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'GuildStandingManager'],\n },\n 'guildmateUser.tradeProfession.update': {\n label: 'Update Guildmate tradeProfessions',\n description:\n 'Assign or remove Guildmate tradeProfessions. tradeProfessions gate custom-folder ' +\n 'visibility and chat-channel access targeting — they are access keys, not just staffing ' +\n 'labels — so this is restricted to file-admin standings (Steward + WorkProject Manager). ' +\n 'A trade edit can never grant the editor access they lack, since every grantee already ' +\n 'holds file-admin override.',\n grantedTo: ['StewardOwner', 'WorkProjectManager'],\n },\n 'workProject.stakeShares.addActive': {\n label: 'Add active Guildmate stakes',\n description: 'Increase stakes for an existing active workProject Guildmate.',\n grantedTo: STAKE_SHARE_POWER_GUILD_STANDING_IDS,\n },\n 'guildInvite.send': {\n label: 'Send invites',\n description: 'Start a workProject invite conversation and reserve pending stakes.',\n grantedTo: GUILD_INVITE_HANDLER_GUILD_STANDING_IDS,\n },\n 'guildInvite.list': {\n label: 'List invites',\n description:\n \"Open the Work's invites and see their state and offers. A stake-power standing opens an invite \" +\n 'to change its offer; replying, agreeing for the Work, and cancelling stay with the invite handlers.',\n grantedTo: GUILD_INVITE_VIEWER_GUILD_STANDING_IDS,\n },\n 'guildInvite.revokeAny': {\n label: 'Revoke pending invites',\n description: 'Cancel or revoke pending workProject invites.',\n grantedTo: GUILD_INVITE_HANDLER_GUILD_STANDING_IDS,\n },\n 'guildInvite.stakeShares.update': {\n label: 'Update invite stakes',\n description: 'Increase stakes offered on a pending invite.',\n grantedTo: STAKE_SHARE_POWER_GUILD_STANDING_IDS,\n },\n 'fileFolder.create': {\n label: 'Create file folders',\n description: 'Create workProject file folders and set their trade-profession access lists.',\n grantedTo: WORK_FILE_ADMIN_GUILD_STANDING_IDS,\n },\n 'fileFolder.manage': {\n label: 'Manage file folders',\n description: 'Rename folders, edit folder trade-profession access lists, and delete folders.',\n grantedTo: WORK_FILE_ADMIN_GUILD_STANDING_IDS,\n },\n 'fileFolder.viewAll': {\n label: 'View all file folders',\n description: 'View every folder and file regardless of folder trade-profession access (admin override).',\n grantedTo: WORK_FILE_ADMIN_GUILD_STANDING_IDS,\n },\n 'workFile.uploadAny': {\n label: 'Upload to any folder',\n description: 'Upload files to any folder regardless of folder trade-profession access (admin override).',\n grantedTo: WORK_FILE_ADMIN_GUILD_STANDING_IDS,\n },\n 'workFile.deleteAny': {\n label: 'Delete any file',\n description: 'Delete any file regardless of folder trade-profession access (admin override).',\n grantedTo: WORK_FILE_ADMIN_GUILD_STANDING_IDS,\n },\n 'workFile.promoteToRealm': {\n label: 'Request file sharing to realm',\n description: 'Submit a request to share a work file into its realm shared-file pool. ' +\n 'The realm steward approves the request and chooses the folder, or declines it; ' +\n 'nothing is shared to the realm until then. Canon promotion is a separate ' +\n 'realm-steward power, evaluated at the realm level, not here.',\n grantedTo: WORK_FILE_ADMIN_GUILD_STANDING_IDS,\n },\n 'commission.open': {\n label: 'Open commissions',\n description: 'Create workProject commission postings.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'CommissionManager'],\n },\n 'commission.close': {\n label: 'Close commissions',\n description: 'Close workProject commission postings.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'CommissionManager'],\n },\n 'commission.commissionProposal.save': {\n label: 'Save commission proposals',\n description: 'Save or unsave workProject commission proposals.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'CommissionManager'],\n },\n 'commission.commissionProposal.reject': {\n label: 'Reject commission proposals',\n description: 'Reject workProject commission proposals.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'CommissionManager'],\n },\n 'audition.open': {\n label: 'Open auditions',\n description: 'Create workProject audition prompts.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'AuditionManager'],\n },\n 'audition.close': {\n label: 'Close auditions',\n description: 'Close workProject auditions.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'AuditionManager'],\n },\n 'hallLibrary.chapter.create': {\n label: 'Create Tale chapters',\n description: 'Create Tale chapter content.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.tuneTrack.create': {\n label: 'Create Tune tracks',\n description: 'Create Tune track content.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.televisionEpisode.create': {\n label: 'Create Television episodes',\n description: 'Create Television episode content.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.chapter.details.update': {\n label: 'Update chapter details',\n description: 'Edit chapter details and body fields.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.tuneTrack.details.update': {\n label: 'Update track details',\n description: 'Edit track details and media metadata.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.televisionEpisode.details.update': {\n label: 'Update episode details',\n description: 'Edit episode details and media metadata.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.tale.workGenres.update': {\n label: 'Update Tale Genres',\n description: 'Edit Tale Genre assignments.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.tune.workGenres.update': {\n label: 'Update Tune Genres',\n description: 'Edit Tune Genre assignments.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.television.workGenres.update': {\n label: 'Update Television Genres',\n description: 'Edit Television Genre assignments.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.asset.upload': {\n label: 'Upload hallLibrary assets',\n description: 'Upload or replace covers and sub-item media assets.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.review.submit': {\n label: 'Submit hall review',\n description: 'Submit workProject content for admin hall review. Also gates withdrawing a still-pending submission.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibrarySubmitter'],\n },\n 'hallLibrary.changeRequest.submit': {\n label: 'Request published changes',\n description: 'Propose text changes to a PUBLISHED hall item (reviewed by admins before anything changes).',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibrarySubmitter'],\n },\n 'guildChatChannel.create': {\n label: 'Create chat channels',\n description: 'Create workProject chat channels.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'GuildChatChannelManager'],\n },\n 'guildChatChannel.update': {\n label: 'Update chat channels',\n description: 'Update workProject chat channel settings and access policy.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'GuildChatChannelManager'],\n },\n 'guildChatChannel.archive': {\n label: 'Archive chat channels',\n description: 'Archive workProject chat channels.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'GuildChatChannelManager'],\n },\n 'guildChatChannel.unarchive': {\n label: 'Restore archived chat channels',\n description: 'Restore workProject chat channels out of the archive.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'GuildChatChannelManager'],\n },\n 'guildChatChannel.delete': {\n label: 'Delete chat channels',\n description: 'Delete (tombstone) workProject chat channels; storage is retained.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'GuildChatChannelManager'],\n },\n 'adminDispatch.start': {\n label: 'Start admin correspondence',\n description:\n 'Open a platform correspondence thread with the admin team on behalf of the workProject. ' +\n 'Replying in an open workProject thread is any active Guildmate (not gated here).',\n grantedTo: ['StewardOwner', 'WorkProjectManager'],\n },\n} as const satisfies Record<string, {\n label: string;\n description: string;\n grantedTo: readonly GuildStandingId[];\n}>;\n\nexport type WorkProjectActionId = keyof typeof WORK_PROJECT_ACTIONS;\nexport const WORK_PROJECT_ACTION_IDS = Object.keys(WORK_PROJECT_ACTIONS) as WorkProjectActionId[];\n\n\n\n"]}
1
+ {"version":3,"file":"work-project-permissions-data.js","sourceRoot":"","sources":["../../src/permissions/work-project-permissions-data.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,YAAY,EAAE;QACZ,KAAK,EAAE,SAAS;QAChB,WAAW,EAAE,8JAA8J;KAC5K;IACD,kBAAkB,EAAE;QAClB,KAAK,EAAE,qBAAqB;QAC5B,WAAW,EAAE,+HAA+H;KAC7I;IACD,uBAAuB,EAAE;QACvB,KAAK,EAAE,2BAA2B;QAClC,WAAW,EA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AAsB;QAC7B,WAAW,EAAE,mCAAmC;QAChD,SAAS,EAAE,CAAC,cAAc,EAAE,oBAAoB,EAAE,yBAAyB,CAAC;KAC7E;IACD,yBAAyB,EAAE;QACzB,KAAK,EAAE,sBAAsB;QAC7B,WAAW,EAAE,6DAA6D;QAC1E,SAAS,EAAE,CAAC,cAAc,EAAE,oBAAoB,EAAE,yBAAyB,CAAC;KAC7E;IACD,0BAA0B,EAAE;QAC1B,KAAK,EAAE,uBAAuB;QAC9B,WAAW,EAAE,oCAAoC;QACjD,SAAS,EAAE,CAAC,cAAc,EAAE,oBAAoB,EAAE,yBAAyB,CAAC;KAC7E;IACD,4BAA4B,EAAE;QAC5B,KAAK,EAAE,gCAAgC;QACvC,WAAW,EAAE,uDAAuD;QACpE,SAAS,EAAE,CAAC,cAAc,EAAE,oBAAoB,EAAE,yBAAyB,CAAC;KAC7E;IACD,yBAAyB,EAAE;QACzB,KAAK,EAAE,sBAAsB;QAC7B,WAAW,EAAE,oEAAoE;QACjF,SAAS,EAAE,CAAC,cAAc,EAAE,oBAAoB,EAAE,yBAAyB,CAAC;KAC7E;IACD,qBAAqB,EAAE;QACrB,KAAK,EAAE,4BAA4B;QACnC,WAAW,EACT,0FAA0F;YAC1F,kFAAkF;QACpF,SAAS,EAAE,CAAC,cAAc,EAAE,oBAAoB,CAAC;KAClD;CAKD,CAAC;AAGH,MAAM,CAAC,MAAM,uBAAuB,GAAG,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAA0B,CAAC","sourcesContent":["export const GUILD_STANDINGS = {\n StewardOwner: {\n label: 'Steward',\n description: 'Work steward. Holds all workProject actions implicitly. Assigned automatically at workProject creation and non-assignable via guild standing management UIs.',\n },\n WorkProjectManager: {\n label: 'WorkProject Manager',\n description: 'Can perform every workProject action except granting Steward, WorkProjectManager, GuildStandingManager, or StakeShareManager.',\n },\n PublicWorkProjectEditor: {\n label: 'Public WorkProject Editor',\n description: 'Can edit public-facing workProject title, description, and copy.',\n },\n GuildStandingManager: {\n label: 'Guild Standing Manager',\n description: 'Can assign and remove ordinary workProject guild standings without escalating manager, stake-share, or trade-profession authority (tradeProfessions are folder/chat access keys, editable only by file-admin standings).',\n },\n StakeShareManager: {\n label: 'Stake Share Manager',\n description: 'Can adjust active Guildmate stakes and pending invite stake offers.',\n },\n InviteManager: {\n label: 'Invite Manager',\n description: 'Can send workProject invites, view invite state, and cancel or revoke pending invites.',\n },\n WorkAssetAdmin: {\n label: 'Work Asset Admin',\n description: 'Delegated file-system administration: create/rename file folders, assign folder trade-profession access, view every folder and file, and delete any file. Assignable only by the Steward.',\n },\n CommissionManager: {\n label: 'Commission Manager',\n description: 'Can open and close workProject commissions and manage proposals without starting invite conversations.',\n },\n AuditionManager: {\n label: 'Audition Manager',\n description: 'Can open and close workProject auditions without starting invite conversations.',\n },\n HallLibraryEditor: {\n label: 'Hall Editor',\n description: 'Can create and edit Tales, Tunes, Television content, Genres, and media assets.',\n },\n HallLibrarySubmitter: {\n label: 'Hall Submitter',\n description: 'Can submit workProject hall content for admin hall review.',\n },\n GuildChatChannelManager: {\n label: 'Guild Chat Channel Manager',\n description: 'Can create, update, archive, and delete workProject chat channels.',\n },\n} as const;\n\nexport type GuildStandingId = keyof typeof GUILD_STANDINGS;\nexport const GUILD_STANDING_IDS = Object.keys(GUILD_STANDINGS) as GuildStandingId[];\n\n/**\n * The work steward's standing id — the one standing that is never assignable and that\n * `GuildmateUser.guildStandings` carries (that array stores IDs, not display values;\n * this id's display value is 'Steward', so the two are not interchangeable).\n * Consumers branch on this rather than re-quoting the member.\n */\nexport const STEWARD_OWNER_GUILD_STANDING_ID = 'StewardOwner' as const satisfies GuildStandingId;\nexport const GUILD_STANDING_VALUE_BY_ID = {\n StewardOwner: 'Steward',\n WorkProjectManager: 'WorkProjectManager',\n PublicWorkProjectEditor: 'PublicWorkProjectEditor',\n GuildStandingManager: 'GuildStandingManager',\n StakeShareManager: 'StakeShareManager',\n InviteManager: 'InviteManager',\n WorkAssetAdmin: 'WorkAssetAdmin',\n CommissionManager: 'CommissionManager',\n AuditionManager: 'AuditionManager',\n HallLibraryEditor: 'HallLibraryEditor',\n HallLibrarySubmitter: 'HallLibrarySubmitter',\n GuildChatChannelManager: 'GuildChatChannelManager',\n} as const satisfies Record<GuildStandingId, string>;\nexport type GuildStandingValue = (typeof GUILD_STANDING_VALUE_BY_ID)[GuildStandingId];\nexport const GUILD_STANDING_VALUES = Object.values(GUILD_STANDING_VALUE_BY_ID) as GuildStandingValue[];\n\n/**\n * The standings that administer a Work's file system: create and manage folders, see every folder\n * and file, upload anywhere, delete any file, and request a file's share to the Realm. Every file\n * action's grant reads this list, and so does the file-admin check (`isWorkFileAdmin`).\n */\nexport const WORK_FILE_ADMIN_GUILD_STANDING_IDS = [\n 'StewardOwner',\n 'WorkProjectManager',\n 'WorkAssetAdmin',\n] as const satisfies readonly GuildStandingId[];\n\n/**\n * A Work's invite handlers: they send the Work's invites, list them, cancel them, and take the\n * Work's side in every invite conversation — they see it, reply in it, share files in it, and\n * agree for the Work. A Stake Share Manager is one: it handles invites like an Invite Manager and\n * also changes their offers.\n */\nexport const GUILD_INVITE_HANDLER_GUILD_STANDING_IDS = [\n 'StewardOwner',\n 'WorkProjectManager',\n 'InviteManager',\n 'StakeShareManager',\n] as const satisfies readonly GuildStandingId[];\n\n/** The standings that change stake amounts — active Guildmates' stakes and pending invite offers. */\nexport const STAKE_SHARE_POWER_GUILD_STANDING_IDS = [\n 'StewardOwner',\n 'WorkProjectManager',\n 'StakeShareManager',\n] as const satisfies readonly GuildStandingId[];\n\nexport const WORK_PROJECT_ACTIONS = {\n 'workProject.read': {\n label: 'Read workProject',\n description: 'Baseline active-Guildmate read floor for internal workProject state.',\n grantedTo: GUILD_STANDING_IDS,\n },\n 'workProject.metadata.update': {\n label: 'Update workProject metadata',\n description: 'Edit working title, description, and public workProject copy.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'PublicWorkProjectEditor'],\n },\n 'guildmateUser.guildStanding.update': {\n label: 'Update Guildmate guild standings',\n description: 'Assign or remove workProject guild standings on active Guildmates.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'GuildStandingManager'],\n },\n 'guildmateUser.tradeProfession.update': {\n label: 'Update Guildmate tradeProfessions',\n description:\n 'Assign or remove Guildmate tradeProfessions. tradeProfessions gate custom-folder ' +\n 'visibility and chat-channel access targeting — they are access keys, not just staffing ' +\n 'labels — so this is restricted to file-admin standings (Steward + WorkProject Manager). ' +\n 'A trade edit can never grant the editor access they lack, since every grantee already ' +\n 'holds file-admin override.',\n grantedTo: ['StewardOwner', 'WorkProjectManager'],\n },\n 'workProject.stakeShares.addActive': {\n label: 'Add active Guildmate stakes',\n description: 'Increase stakes for an existing active workProject Guildmate.',\n grantedTo: STAKE_SHARE_POWER_GUILD_STANDING_IDS,\n },\n 'guildInvite.send': {\n label: 'Send invites',\n description: 'Start a workProject invite conversation and reserve pending stakes.',\n grantedTo: GUILD_INVITE_HANDLER_GUILD_STANDING_IDS,\n },\n 'guildInvite.list': {\n label: 'List invites',\n description: \"Open the Work's invites and see their state and offers.\",\n grantedTo: GUILD_INVITE_HANDLER_GUILD_STANDING_IDS,\n },\n 'guildInvite.revokeAny': {\n label: 'Revoke pending invites',\n description: 'Cancel or revoke pending workProject invites.',\n grantedTo: GUILD_INVITE_HANDLER_GUILD_STANDING_IDS,\n },\n 'guildInvite.stakeShares.update': {\n label: 'Update invite stakes',\n description: 'Increase stakes offered on a pending invite.',\n grantedTo: STAKE_SHARE_POWER_GUILD_STANDING_IDS,\n },\n 'fileFolder.create': {\n label: 'Create file folders',\n description: 'Create workProject file folders and set their trade-profession access lists.',\n grantedTo: WORK_FILE_ADMIN_GUILD_STANDING_IDS,\n },\n 'fileFolder.manage': {\n label: 'Manage file folders',\n description: 'Rename folders, edit folder trade-profession access lists, and delete folders.',\n grantedTo: WORK_FILE_ADMIN_GUILD_STANDING_IDS,\n },\n 'fileFolder.viewAll': {\n label: 'View all file folders',\n description: 'View every folder and file regardless of folder trade-profession access (admin override).',\n grantedTo: WORK_FILE_ADMIN_GUILD_STANDING_IDS,\n },\n 'workFile.uploadAny': {\n label: 'Upload to any folder',\n description: 'Upload files to any folder regardless of folder trade-profession access (admin override).',\n grantedTo: WORK_FILE_ADMIN_GUILD_STANDING_IDS,\n },\n 'workFile.deleteAny': {\n label: 'Delete any file',\n description: 'Delete any file regardless of folder trade-profession access (admin override).',\n grantedTo: WORK_FILE_ADMIN_GUILD_STANDING_IDS,\n },\n 'workFile.promoteToRealm': {\n label: 'Request file sharing to realm',\n description: 'Submit a request to share a work file into its realm shared-file pool. ' +\n 'The realm steward approves the request and chooses the folder, or declines it; ' +\n 'nothing is shared to the realm until then. Canon promotion is a separate ' +\n 'realm-steward power, evaluated at the realm level, not here.',\n grantedTo: WORK_FILE_ADMIN_GUILD_STANDING_IDS,\n },\n 'commission.open': {\n label: 'Open commissions',\n description: 'Create workProject commission postings.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'CommissionManager'],\n },\n 'commission.close': {\n label: 'Close commissions',\n description: 'Close workProject commission postings.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'CommissionManager'],\n },\n 'commission.commissionProposal.save': {\n label: 'Save commission proposals',\n description: 'Save or unsave workProject commission proposals.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'CommissionManager'],\n },\n 'commission.commissionProposal.reject': {\n label: 'Reject commission proposals',\n description: 'Reject workProject commission proposals.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'CommissionManager'],\n },\n 'audition.open': {\n label: 'Open auditions',\n description: 'Create workProject audition prompts.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'AuditionManager'],\n },\n 'audition.close': {\n label: 'Close auditions',\n description: 'Close workProject auditions.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'AuditionManager'],\n },\n 'hallLibrary.chapter.create': {\n label: 'Create Tale chapters',\n description: 'Create Tale chapter content.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.tuneTrack.create': {\n label: 'Create Tune tracks',\n description: 'Create Tune track content.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.televisionEpisode.create': {\n label: 'Create Television episodes',\n description: 'Create Television episode content.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.chapter.details.update': {\n label: 'Update chapter details',\n description: 'Edit chapter details and body fields.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.tuneTrack.details.update': {\n label: 'Update track details',\n description: 'Edit track details and media metadata.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.televisionEpisode.details.update': {\n label: 'Update episode details',\n description: 'Edit episode details and media metadata.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.tale.workGenres.update': {\n label: 'Update Tale Genres',\n description: 'Edit Tale Genre assignments.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.tune.workGenres.update': {\n label: 'Update Tune Genres',\n description: 'Edit Tune Genre assignments.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.television.workGenres.update': {\n label: 'Update Television Genres',\n description: 'Edit Television Genre assignments.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.asset.upload': {\n label: 'Upload hallLibrary assets',\n description: 'Upload or replace covers and sub-item media assets.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibraryEditor'],\n },\n 'hallLibrary.review.submit': {\n label: 'Submit hall review',\n description: 'Submit workProject content for admin hall review. Also gates withdrawing a still-pending submission.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibrarySubmitter'],\n },\n 'hallLibrary.changeRequest.submit': {\n label: 'Request published changes',\n description: 'Propose text changes to a PUBLISHED hall item (reviewed by admins before anything changes).',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'HallLibrarySubmitter'],\n },\n 'guildChatChannel.create': {\n label: 'Create chat channels',\n description: 'Create workProject chat channels.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'GuildChatChannelManager'],\n },\n 'guildChatChannel.update': {\n label: 'Update chat channels',\n description: 'Update workProject chat channel settings and access policy.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'GuildChatChannelManager'],\n },\n 'guildChatChannel.archive': {\n label: 'Archive chat channels',\n description: 'Archive workProject chat channels.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'GuildChatChannelManager'],\n },\n 'guildChatChannel.unarchive': {\n label: 'Restore archived chat channels',\n description: 'Restore workProject chat channels out of the archive.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'GuildChatChannelManager'],\n },\n 'guildChatChannel.delete': {\n label: 'Delete chat channels',\n description: 'Delete (tombstone) workProject chat channels; storage is retained.',\n grantedTo: ['StewardOwner', 'WorkProjectManager', 'GuildChatChannelManager'],\n },\n 'adminDispatch.start': {\n label: 'Start admin correspondence',\n description:\n 'Open a platform correspondence thread with the admin team on behalf of the workProject. ' +\n 'Replying in an open workProject thread is any active Guildmate (not gated here).',\n grantedTo: ['StewardOwner', 'WorkProjectManager'],\n },\n} as const satisfies Record<string, {\n label: string;\n description: string;\n grantedTo: readonly GuildStandingId[];\n}>;\n\nexport type WorkProjectActionId = keyof typeof WORK_PROJECT_ACTIONS;\nexport const WORK_PROJECT_ACTION_IDS = Object.keys(WORK_PROJECT_ACTIONS) as WorkProjectActionId[];\n\n\n\n"]}
@@ -32,28 +32,6 @@ export declare function guildInvitePartyOf(args: {
32
32
  recipientUid: string;
33
33
  member: GuildChatAccessMember | null;
34
34
  }): GuildInviteParty | null;
35
- /** How a person opens an invite: as one of its two sides, or as a stake editor of the inviting Work. */
36
- export type GuildInviteViewerRole = GuildInviteParty | 'stakeEditor';
37
- /**
38
- * How a person may open an invite, or null when they may not. A party opens it on its own side
39
- * (`guildInvitePartyOf`). Any other active person Guildmate of the inviting Work whose standings
40
- * grant both `guildInvite.list` and `guildInvite.stakeShares.update` — a stake-power standing that
41
- * handles no invites — opens it as a `stakeEditor`: they see the invite and its offer to change
42
- * the offer, and take no part in the conversation, its files, the Work's agreement, or a cancel.
43
- */
44
- export declare function guildInviteViewerRoleOf(args: {
45
- uid: string;
46
- senderUid: string;
47
- recipientUid: string;
48
- member: GuildChatAccessMember | null;
49
- }): GuildInviteViewerRole | null;
50
- /** Whether a person may open an invite (read the invite itself): a party, or a stake editor. */
51
- export declare function canViewGuildInvite(args: {
52
- uid: string;
53
- senderUid: string;
54
- recipientUid: string;
55
- member: GuildChatAccessMember | null;
56
- }): boolean;
57
35
  /** Whether a person may use an invite's conversation now: a party to it, while it is open. */
58
36
  export declare function canAccessGuildInviteConversation(args: {
59
37
  uid: string;
@@ -1 +1 @@
1
- {"version":3,"file":"guild-chat-access.d.ts","sourceRoot":"","sources":["../../src/utils/guild-chat-access.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAEpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAOpE,qDAAqD;AACrD,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC,aAAa,EAAE,QAAQ,GAAG,YAAY,GAAG,gBAAgB,GAAG,kBAAkB,CAAC,CAAC;AAMzH;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,qBAAqB,GAAG,IAAI,EACpC,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAAE,wBAAwB,GAAG,WAAW,CAAC,GAAG,IAAI,GAC7E,OAAO,CAMT;AAED,oGAAoG;AACpG,eAAO,MAAM,uCAAuC,kCAGS,CAAC;AAE9D,wBAAgB,6BAA6B,CAAC,MAAM,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GAAG,OAAO,CAElF"}
@@ -52,28 +52,6 @@ export function guildInvitePartyOf(args) {
52
52
  const handles = member.guildStandings.some((standing) => GUILD_INVITE_HANDLER_GUILD_STANDING_IDS.includes(standing));
53
53
  return handles ? 'work' : null;
54
54
  }
55
- /**
56
- * How a person may open an invite, or null when they may not. A party opens it on its own side
57
- * (`guildInvitePartyOf`). Any other active person Guildmate of the inviting Work whose standings
58
- * grant both `guildInvite.list` and `guildInvite.stakeShares.update` — a stake-power standing that
59
- * handles no invites — opens it as a `stakeEditor`: they see the invite and its offer to change
60
- * the offer, and take no part in the conversation, its files, the Work's agreement, or a cancel.
61
- */
62
- export function guildInviteViewerRoleOf(args) {
63
- const party = guildInvitePartyOf(args);
64
- if (party !== null)
65
- return party;
66
- const { uid, member } = args;
67
- if (!uid || !isActivePersonGuildmate(member))
68
- return null;
69
- const opensToChangeOffer = guildStandingsGrantAction(member.guildStandings, 'guildInvite.list') &&
70
- guildStandingsGrantAction(member.guildStandings, 'guildInvite.stakeShares.update');
71
- return opensToChangeOffer ? 'stakeEditor' : null;
72
- }
73
- /** Whether a person may open an invite (read the invite itself): a party, or a stake editor. */
74
- export function canViewGuildInvite(args) {
75
- return guildInviteViewerRoleOf(args) !== null;
76
- }
77
55
  /** Whether a person may use an invite's conversation now: a party to it, while it is open. */
78
56
  export function canAccessGuildInviteConversation(args) {
79
57
  return guildInvitePartyOf(args) !== null && isGuildInviteConversationLive(args.status);
@@ -1 +1 @@
1
- {"version":3,"file":"guild-chat-access.js","sourceRoot":"","sources":["../../src/utils/guild-chat-access.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAG3E,OAAO,EACL,uCAAuC,EACvC,yBAAyB,GAC1B,MAAM,4CAA4C,CAAC;AAKpD,SAAS,uBAAuB,CAAC,MAAoC;IACnE,OAAO,MAAM,KAAK,IAAI,IAAI,MAAM,CAAC,MAAM,KAAK,QAAQ,IAAI,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. The grant\n * minting, the access projection the chat rooms enforce, the conversation-file checks, and every\n * screen that lists or offers a conversation decide from these, never from a restatement.\n */\n\nimport type { GuildmateUser } from '../doc-schemas/work-project.js';\nimport { FOUNDING_WORK_HOLDER_TYPE } from '../doc-schemas/work-project.js';\nimport type { GuildChatChannel } from '../doc-schemas/messaging.js';\nimport type { GuildInviteConversationStatus } from '../schemas/atoms.js';\nimport {\n GUILD_INVITE_HANDLER_GUILD_STANDING_IDS,\n guildStandingsGrantAction,\n} from '../permissions/work-project-permissions.js';\n\n/** The Guildmate facts a conversation rule reads. */\nexport type GuildChatAccessMember = Pick<GuildmateUser, 'status' | 'holderType' | 'guildStandings' | 'tradeProfessions'>;\n\nfunction isActivePersonGuildmate(member: GuildChatAccessMember | null): member is GuildChatAccessMember {\n return member !== null && member.status === 'active' && member.holderType !== FOUNDING_WORK_HOLDER_TYPE;\n}\n\n/**\n * Whether a Guildmate may use a Work's guild chat channel: an active person Guildmate (never the\n * founding-Work stake holder) of a channel that exists and is not deleted, holding one of the\n * channel's required standings OR trade professions — an empty requirement admits every active\n * Guildmate.\n */\nexport function canAccessGuildChatChannel(\n member: GuildChatAccessMember | null,\n channel: Pick<GuildChatChannel, 'requiredGuildStandings' | 'isDeleted'> | null,\n): boolean {\n if (!channel || channel.isDeleted === true) return false;\n if (!isActivePersonGuildmate(member)) return false;\n if (channel.requiredGuildStandings.length === 0) return true;\n const held = new Set<string>([...member.guildStandings, ...member.tradeProfessions]);\n return channel.requiredGuildStandings.some((required) => held.has(required));\n}\n\n/** The invite statuses whose conversation is open: negotiating, or accepted and being confirmed. */\nexport const GUILD_INVITE_CONVERSATION_LIVE_STATUSES = [\n 'pending',\n 'accepted',\n] as const satisfies readonly GuildInviteConversationStatus[];\n\nexport function isGuildInviteConversationLive(status: string): boolean {\n return (GUILD_INVITE_CONVERSATION_LIVE_STATUSES as readonly string[]).includes(status);\n}\n\n/** The two sides of an invite: the person invited, and the inviting Work. */\nexport type GuildInviteParty = 'recipient' | 'work';\n\n/**\n * Which side of an invite a person takes part on, or null when they take no part. The recipient\n * is the `recipient` side. The Work's side is the sender, and every active person Guildmate of the\n * inviting Work who holds an invite-handling standing (`GUILD_INVITE_HANDLER_GUILD_STANDING_IDS`):\n * they see the conversation, reply in it, and accept for the Work. `member` is the person's\n * Guildmate record in the inviting Work, or null when they have none.\n */\nexport function guildInvitePartyOf(args: {\n uid: string;\n senderUid: string;\n recipientUid: string;\n member: GuildChatAccessMember | null;\n}): GuildInviteParty | null {\n const { uid, senderUid, recipientUid, member } = args;\n if (!uid) return null;\n if (uid === recipientUid) return 'recipient';\n if (uid === senderUid) return 'work';\n if (!isActivePersonGuildmate(member)) return null;\n const handles = member.guildStandings.some((standing) =>\n (GUILD_INVITE_HANDLER_GUILD_STANDING_IDS as readonly string[]).includes(standing),\n );\n return handles ? 'work' : null;\n}\n\n/** How a person opens an invite: as one of its two sides, or as a stake editor of the inviting Work. */\nexport type GuildInviteViewerRole = GuildInviteParty | 'stakeEditor';\n\n/**\n * How a person may open an invite, or null when they may not. A party opens it on its own side\n * (`guildInvitePartyOf`). Any other active person Guildmate of the inviting Work whose standings\n * grant both `guildInvite.list` and `guildInvite.stakeShares.update` — a stake-power standing that\n * handles no invites — opens it as a `stakeEditor`: they see the invite and its offer to change\n * the offer, and take no part in the conversation, its files, the Work's agreement, or a cancel.\n */\nexport function guildInviteViewerRoleOf(args: {\n uid: string;\n senderUid: string;\n recipientUid: string;\n member: GuildChatAccessMember | null;\n}): GuildInviteViewerRole | null {\n const party = guildInvitePartyOf(args);\n if (party !== null) return party;\n const { uid, member } = args;\n if (!uid || !isActivePersonGuildmate(member)) return null;\n const opensToChangeOffer =\n guildStandingsGrantAction(member.guildStandings, 'guildInvite.list') &&\n guildStandingsGrantAction(member.guildStandings, 'guildInvite.stakeShares.update');\n return opensToChangeOffer ? 'stakeEditor' : null;\n}\n\n/** Whether a person may open an invite (read the invite itself): a party, or a stake editor. */\nexport function canViewGuildInvite(args: {\n uid: string;\n senderUid: string;\n recipientUid: string;\n member: GuildChatAccessMember | null;\n}): boolean {\n return guildInviteViewerRoleOf(args) !== null;\n}\n\n/** Whether a person may use an invite's conversation now: a party to it, while it is open. */\nexport function canAccessGuildInviteConversation(args: {\n uid: string;\n senderUid: string;\n recipientUid: string;\n member: GuildChatAccessMember | null;\n status: string;\n}): boolean {\n return guildInvitePartyOf(args) !== null && isGuildInviteConversationLive(args.status);\n}\n\n/**\n * Whether a Guildmate may cancel the Work's invites: an active person Guildmate whose standings\n * grant `guildInvite.revokeAny`. Sending an invite gives no power to cancel it — a sender cancels\n * only while holding one of those standings.\n */\nexport function canCancelGuildInvite(member: GuildChatAccessMember | null): boolean {\n return isActivePersonGuildmate(member) && guildStandingsGrantAction(member.guildStandings, 'guildInvite.revokeAny');\n}\n"]}
1
+ {"version":3,"file":"guild-chat-access.js","sourceRoot":"","sources":["../../src/utils/guild-chat-access.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAG3E,OAAO,EACL,uCAAuC,EACvC,yBAAyB,GAC1B,MAAM,4CAA4C,CAAC;AAKpD,SAAS,uBAAuB,CAAC,MAAoC;IACnE,OAAO,MAAM,KAAK,IAAI,IAAI,MAAM,CAAC,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,UAAU,KAAK,yBAAyB,CAAC;AAC1G,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,yBAAyB,CACvC,MAAoC,EACpC,OAA8E;IAE9E,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,SAAS,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IACzD,IAAI,CAAC,uBAAuB,CAAC,MAAM,CAAC;QAAE,OAAO,KAAK,CAAC;IACnD,IAAI,OAAO,CAAC,sBAAsB,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAC7D,MAAM,IAAI,GAAG,IAAI,GAAG,CAAS,CAAC,GAA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OAAO,uBAAuB,CAAC,MAAM,CAAC,IAAI,yBAAyB,CAAC,MAAM,CAAC,cAAc,EAAE,uBAAuB,CAAC,CAAC;AACtH,CAAC","sourcesContent":["/**\n * Who may take part in TTT's realtime conversations — ONE rule per conversation kind. The grant\n * minting, the access projection the chat rooms enforce, the conversation-file checks, and every\n * screen that lists or offers a conversation decide from these, never from a restatement.\n */\n\nimport type { GuildmateUser } from '../doc-schemas/work-project.js';\nimport { FOUNDING_WORK_HOLDER_TYPE } from '../doc-schemas/work-project.js';\nimport type { GuildChatChannel } from '../doc-schemas/messaging.js';\nimport type { GuildInviteConversationStatus } from '../schemas/atoms.js';\nimport {\n GUILD_INVITE_HANDLER_GUILD_STANDING_IDS,\n guildStandingsGrantAction,\n} from '../permissions/work-project-permissions.js';\n\n/** The Guildmate facts a conversation rule reads. */\nexport type GuildChatAccessMember = Pick<GuildmateUser, 'status' | 'holderType' | 'guildStandings' | 'tradeProfessions'>;\n\nfunction isActivePersonGuildmate(member: GuildChatAccessMember | null): member is GuildChatAccessMember {\n return member !== null && member.status === 'active' && member.holderType !== FOUNDING_WORK_HOLDER_TYPE;\n}\n\n/**\n * Whether a Guildmate may use a Work's guild chat channel: an active person Guildmate (never the\n * founding-Work stake holder) of a channel that exists and is not deleted, holding one of the\n * channel's required standings OR trade professions — an empty requirement admits every active\n * Guildmate.\n */\nexport function canAccessGuildChatChannel(\n member: GuildChatAccessMember | null,\n channel: Pick<GuildChatChannel, 'requiredGuildStandings' | 'isDeleted'> | null,\n): boolean {\n if (!channel || channel.isDeleted === true) return false;\n if (!isActivePersonGuildmate(member)) return false;\n if (channel.requiredGuildStandings.length === 0) return true;\n const held = new Set<string>([...member.guildStandings, ...member.tradeProfessions]);\n return channel.requiredGuildStandings.some((required) => held.has(required));\n}\n\n/** The invite statuses whose conversation is open: negotiating, or accepted and being confirmed. */\nexport const GUILD_INVITE_CONVERSATION_LIVE_STATUSES = [\n 'pending',\n 'accepted',\n] as const satisfies readonly GuildInviteConversationStatus[];\n\nexport function isGuildInviteConversationLive(status: string): boolean {\n return (GUILD_INVITE_CONVERSATION_LIVE_STATUSES as readonly string[]).includes(status);\n}\n\n/** The two sides of an invite: the person invited, and the inviting Work. */\nexport type GuildInviteParty = 'recipient' | 'work';\n\n/**\n * Which side of an invite a person takes part on, or null when they take no part. The recipient\n * is the `recipient` side. The Work's side is the sender, and every active person Guildmate of the\n * inviting Work who holds an invite-handling standing (`GUILD_INVITE_HANDLER_GUILD_STANDING_IDS`):\n * they see the conversation, reply in it, and accept for the Work. `member` is the person's\n * Guildmate record in the inviting Work, or null when they have none.\n */\nexport function guildInvitePartyOf(args: {\n uid: string;\n senderUid: string;\n recipientUid: string;\n member: GuildChatAccessMember | null;\n}): GuildInviteParty | null {\n const { uid, senderUid, recipientUid, member } = args;\n if (!uid) return null;\n if (uid === recipientUid) return 'recipient';\n if (uid === senderUid) return 'work';\n if (!isActivePersonGuildmate(member)) return null;\n const handles = member.guildStandings.some((standing) =>\n (GUILD_INVITE_HANDLER_GUILD_STANDING_IDS as readonly string[]).includes(standing),\n );\n return handles ? 'work' : null;\n}\n\n/** Whether a person may use an invite's conversation now: a party to it, while it is open. */\nexport function canAccessGuildInviteConversation(args: {\n uid: string;\n senderUid: string;\n recipientUid: string;\n member: GuildChatAccessMember | null;\n status: string;\n}): boolean {\n return guildInvitePartyOf(args) !== null && isGuildInviteConversationLive(args.status);\n}\n\n/**\n * Whether a Guildmate may cancel the Work's invites: an active person Guildmate whose standings\n * grant `guildInvite.revokeAny`. Sending an invite gives no power to cancel it — a sender cancels\n * only while holding one of those standings.\n */\nexport function canCancelGuildInvite(member: GuildChatAccessMember | null): boolean {\n return isActivePersonGuildmate(member) && guildStandingsGrantAction(member.guildStandings, 'guildInvite.revokeAny');\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttt-productions/ttt-core",
3
- "version": "0.79.74",
3
+ "version": "0.79.76",
4
4
  "description": "Core types, Firestore path constants, and shared constants for TTT Productions",
5
5
  "repository": {
6
6
  "type": "git",