@ttt-productions/ttt-core 0.78.22 → 0.78.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/dist/constants/business-user.d.ts +1 -1
  2. package/dist/constants/business-user.js +1 -1
  3. package/dist/constants/business-user.js.map +1 -1
  4. package/dist/constants/release-flags.d.ts +2 -2
  5. package/dist/constants/release-flags.d.ts.map +1 -1
  6. package/dist/constants/release-flags.js +2 -2
  7. package/dist/constants/release-flags.js.map +1 -1
  8. package/dist/doc-schemas/chat-sync.d.ts.map +1 -1
  9. package/dist/doc-schemas/chat-sync.js +3 -2
  10. package/dist/doc-schemas/chat-sync.js.map +1 -1
  11. package/dist/doc-schemas/commissions.d.ts +14 -11
  12. package/dist/doc-schemas/commissions.d.ts.map +1 -1
  13. package/dist/doc-schemas/commissions.js +14 -4
  14. package/dist/doc-schemas/commissions.js.map +1 -1
  15. package/dist/doc-schemas/media-activation-jobs.d.ts.map +1 -1
  16. package/dist/doc-schemas/media-activation-jobs.js +4 -3
  17. package/dist/doc-schemas/media-activation-jobs.js.map +1 -1
  18. package/dist/doc-schemas/media-assets.d.ts +2 -2
  19. package/dist/doc-schemas/media-assets.d.ts.map +1 -1
  20. package/dist/doc-schemas/media-assets.js +5 -4
  21. package/dist/doc-schemas/media-assets.js.map +1 -1
  22. package/dist/doc-schemas/messaging.d.ts.map +1 -1
  23. package/dist/doc-schemas/messaging.js +3 -2
  24. package/dist/doc-schemas/messaging.js.map +1 -1
  25. package/dist/doc-schemas/ncii/allegations.js +3 -3
  26. package/dist/doc-schemas/ncii/allegations.js.map +1 -1
  27. package/dist/doc-schemas/ncii/cases.d.ts.map +1 -1
  28. package/dist/doc-schemas/ncii/cases.js +4 -3
  29. package/dist/doc-schemas/ncii/cases.js.map +1 -1
  30. package/dist/doc-schemas/ncii/config.d.ts.map +1 -1
  31. package/dist/doc-schemas/ncii/config.js +4 -3
  32. package/dist/doc-schemas/ncii/config.js.map +1 -1
  33. package/dist/doc-schemas/ncii/holds.js +3 -3
  34. package/dist/doc-schemas/ncii/holds.js.map +1 -1
  35. package/dist/doc-schemas/ncii/removal.js +3 -3
  36. package/dist/doc-schemas/ncii/removal.js.map +1 -1
  37. package/dist/doc-schemas/ncii/requests.d.ts.map +1 -1
  38. package/dist/doc-schemas/ncii/requests.js +4 -3
  39. package/dist/doc-schemas/ncii/requests.js.map +1 -1
  40. package/dist/doc-schemas/notification-ledger.d.ts.map +1 -1
  41. package/dist/doc-schemas/notification-ledger.js +3 -1
  42. package/dist/doc-schemas/notification-ledger.js.map +1 -1
  43. package/dist/doc-schemas/payments.d.ts.map +1 -1
  44. package/dist/doc-schemas/payments.js +2 -1
  45. package/dist/doc-schemas/payments.js.map +1 -1
  46. package/dist/doc-schemas/registry.d.ts +108 -35
  47. package/dist/doc-schemas/registry.d.ts.map +1 -1
  48. package/dist/doc-schemas/registry.js +4 -0
  49. package/dist/doc-schemas/registry.js.map +1 -1
  50. package/dist/doc-schemas/safety/age.d.ts.map +1 -1
  51. package/dist/doc-schemas/safety/age.js +4 -3
  52. package/dist/doc-schemas/safety/age.js.map +1 -1
  53. package/dist/doc-schemas/safety/case-aliases.d.ts.map +1 -1
  54. package/dist/doc-schemas/safety/case-aliases.js +5 -4
  55. package/dist/doc-schemas/safety/case-aliases.js.map +1 -1
  56. package/dist/doc-schemas/safety/case.d.ts.map +1 -1
  57. package/dist/doc-schemas/safety/case.js +4 -3
  58. package/dist/doc-schemas/safety/case.js.map +1 -1
  59. package/dist/doc-schemas/safety/evidence.js +3 -3
  60. package/dist/doc-schemas/safety/evidence.js.map +1 -1
  61. package/dist/doc-schemas/safety/foundation.d.ts.map +1 -1
  62. package/dist/doc-schemas/safety/foundation.js +5 -3
  63. package/dist/doc-schemas/safety/foundation.js.map +1 -1
  64. package/dist/doc-schemas/safety/holds.d.ts.map +1 -1
  65. package/dist/doc-schemas/safety/holds.js +4 -3
  66. package/dist/doc-schemas/safety/holds.js.map +1 -1
  67. package/dist/doc-schemas/safety/monitors.d.ts.map +1 -1
  68. package/dist/doc-schemas/safety/monitors.js +5 -3
  69. package/dist/doc-schemas/safety/monitors.js.map +1 -1
  70. package/dist/doc-schemas/safety/provenance.js +3 -3
  71. package/dist/doc-schemas/safety/provenance.js.map +1 -1
  72. package/dist/doc-schemas/safety/report.d.ts.map +1 -1
  73. package/dist/doc-schemas/safety/report.js +4 -3
  74. package/dist/doc-schemas/safety/report.js.map +1 -1
  75. package/dist/doc-schemas/safety/sagas.js +3 -3
  76. package/dist/doc-schemas/safety/sagas.js.map +1 -1
  77. package/dist/doc-schemas/social.d.ts +130 -0
  78. package/dist/doc-schemas/social.d.ts.map +1 -1
  79. package/dist/doc-schemas/social.js +91 -2
  80. package/dist/doc-schemas/social.js.map +1 -1
  81. package/dist/doc-schemas/square-announcement-jobs.d.ts +306 -14
  82. package/dist/doc-schemas/square-announcement-jobs.d.ts.map +1 -1
  83. package/dist/doc-schemas/square-announcement-jobs.js +15 -2
  84. package/dist/doc-schemas/square-announcement-jobs.js.map +1 -1
  85. package/dist/doc-schemas/user.js +3 -3
  86. package/dist/doc-schemas/user.js.map +1 -1
  87. package/dist/doc-schemas/work-project.js +2 -2
  88. package/dist/doc-schemas/work-project.js.map +1 -1
  89. package/dist/ids/chat-ids.d.ts +3 -2
  90. package/dist/ids/chat-ids.d.ts.map +1 -1
  91. package/dist/ids/chat-ids.js +3 -2
  92. package/dist/ids/chat-ids.js.map +1 -1
  93. package/dist/media/domain-events-admin.d.ts +0 -7
  94. package/dist/media/domain-events-admin.d.ts.map +1 -1
  95. package/dist/media/domain-events-admin.js +0 -11
  96. package/dist/media/domain-events-admin.js.map +1 -1
  97. package/dist/media/domain-events.d.ts +0 -6
  98. package/dist/media/domain-events.d.ts.map +1 -1
  99. package/dist/media/domain-events.js +1 -2
  100. package/dist/media/domain-events.js.map +1 -1
  101. package/dist/media/hall-library-target-fields.js +1 -1
  102. package/dist/media/hall-library-target-fields.js.map +1 -1
  103. package/dist/media/pending-media.d.ts +0 -54
  104. package/dist/media/pending-media.d.ts.map +1 -1
  105. package/dist/media/photodna-coverage.d.ts.map +1 -1
  106. package/dist/media/photodna-coverage.js +5 -3
  107. package/dist/media/photodna-coverage.js.map +1 -1
  108. package/dist/paths/related-ids.js +1 -1
  109. package/dist/paths/related-ids.js.map +1 -1
  110. package/dist/safety/ncii-intake-derivations.d.ts.map +1 -1
  111. package/dist/safety/ncii-intake-derivations.js +4 -2
  112. package/dist/safety/ncii-intake-derivations.js.map +1 -1
  113. package/dist/safety/resource-keys.d.ts +8 -0
  114. package/dist/safety/resource-keys.d.ts.map +1 -1
  115. package/dist/safety/resource-keys.js +12 -1
  116. package/dist/safety/resource-keys.js.map +1 -1
  117. package/dist/schemas/chat.js +3 -3
  118. package/dist/schemas/chat.js.map +1 -1
  119. package/dist/schemas/ncii.js +1 -1
  120. package/dist/schemas/ncii.js.map +1 -1
  121. package/dist/schemas/notification.d.ts +8 -8
  122. package/dist/schemas/notification.d.ts.map +1 -1
  123. package/dist/schemas/notification.js +17 -11
  124. package/dist/schemas/notification.js.map +1 -1
  125. package/dist/types/social.d.ts +1 -45
  126. package/dist/types/social.d.ts.map +1 -1
  127. package/dist/types/social.js.map +1 -1
  128. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"notification.js","sourceRoot":"","sources":["../../src/schemas/notification.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,EAAE;AACF,8EAA8E;AAC9E,+EAA+E;AAC/E,+EAA+E;AAC/E,8EAA8E;AAC9E,2EAA2E;AAC3E,gFAAgF;AAChF,EAAE;AACF,qEAAqE;AACrE,gEAAgE;AAChE,8EAA8E;AAC9E,2DAA2D;AAE3D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,EACrB,q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AO,CAAC,KAAK,CAAC;KACvB,CAAC,CAAC,MAAM,EAAE;CACZ,CAAC,CAAC;AAGH;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,sCAAsC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7D,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5B,QAAQ,EAAE,0BAA0B;IACpC,KAAK,EAAE,sCAAsC;CAC9C,CAAC,CAAC,MAAM,EAAE,CAAC;AAGZ,+EAA+E;AAC/E,qEAAqE;AACrE,EAAE;AACF,+EAA+E;AAC/E,+EAA+E;AAC/E,4EAA4E;AAC5E,kFAAkF;AAClF,8EAA8E;AAC9E,wEAAwE;AACxE,+EAA+E;AAE/E,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IACnD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5B,QAAQ,EAAE,0BAA0B;CACrC,CAAC,CAAC,MAAM,EAAE,CAAC;AAGZ,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,MAAM,CAAC;IACrD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CACzB,CAAC,CAAC,MAAM,EAAE,CAAC;AAGZ,iFAAiF;AACjF,kFAAkF;AAClF,oFAAoF;AACpF,sCAAsC;AACtC,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,KAAK,EAAE,6BAA6B;CACrC,CAAC,CAAC,MAAM,EAAE,CAAC","sourcesContent":["// TTT notification contracts.\n//\n// `@ttt-productions/notification-core` is generic — at its package boundary a\n// notification's `metadata` is `Record<string, unknown>`. All TTT notification\n// policy lives here: the canonical type catalog (category / delivery / default\n// channels), the per-type typed `metadata` discriminated union, the broadcast\n// audience selector, and the callable input schemas. `runSendNotification`\n// (ttt-prod) validates `metadata` against the per-type schema before any write.\n//\n// The two notification audit-event payload shapes live here too (the\n// `AuditEventType` union members `notification.broadcastSent` /\n// `notification.adminArchived` are added in ../types/audit.ts; their actor is\n// always an admin mode — `adminReview` / `adminOverride`).\n\nimport { z } from 'zod';\nimport {\n userIdSchema,\n workProjectIdSchema,\n guildInviteIdSchema,\n adminDispatchIdSchema,\n hallItemIdSchema,\n thresholdItemIdSchema,\n changeRequestIdSchema,\n workProjectTypeSchema,\n notificationFanoutJobIdSchema,\n titleSchema,\n reportGroupIdSchema,\n} from './atoms.js';\nimport {\n MAX_THRESHOLD_REVIEW_NOTES_LENGTH,\n MAX_HALL_CHANGE_REQUEST_REASON_LENGTH,\n MAX_NOTIFICATION_MESSAGE_LENGTH,\n MAX_BROADCAST_EXPLICIT_UIDS,\n} from '../constants/business.js';\nimport { HallSubItemTypeSchema } from '../doc-schemas/content.js';\nimport { ReportableItemTypeSchema } from '../doc-schemas/safety/foundation.js';\n\n// String shape atoms specific to notifications.\nconst notificationMessageSchema = z.string().min(1).max(MAX_NOTIFICATION_MESSAGE_LENGTH);\n// The canonical reportable-item enum — never an open string (ARCH-102).\nconst reportedItemTypeSchema = ReportableItemTypeSchema;\nconst reportedItemIdSchema = z.string().min(1).max(128);\nconst reportIdSchema = z.string().min(1);\nconst appealIdSchema = z.string().min(1);\nconst workRealmIdSchema = z.string().min(1);\n\n// ============================================================================\n// TYPE + CHANNEL CATALOG\n// ============================================================================\n\nexport const NOTIFICATION_TYPE_VALUES = [\n 'content_report',\n 'guild_invite',\n 'admin_dispatch_reply',\n 'threshold_library_submission',\n // Author feedback for a Threshold Library review decision (only needs_revision is\n // delivered today — an approval reaches the author via the publish member fanout).\n 'threshold_library_reviewed',\n // Proposer feedback for a PUBLISHED change-request decision (approve/deny).\n 'hall_content_change_request_resolved',\n 'admin_announcement',\n 'followed_content_published',\n // chat-edge-rebuild P7 — the two new fanout triggers (NOTIFICATIONS_REDESIGN \"Triggers\").\n // `member_content_published`: the Hall-publish MEMBER job (\"your work was published!\") — same\n // `thresholdItemId` eventId as the follower job, different type so `deliveryId` stays distinct.\n // `followed_craft_skill_published`: craft-skill publish → the artisan's followers\n // (`staticRelight` strategy — count 1 forever, static copy, no count shown).\n 'member_content_published',\n 'followed_craft_skill_published',\n // Reporter feedback (DJ ruling 2026-07-06): when a report a user submitted is\n // closed as a REAL case WITH action (ordinary report root flips to `actioned`),\n // the reporter gets one light informational card. Never sent on dismissals.\n // Generic copy only — the card must not reveal the reported user, reason, or\n // remedy (a bad-faith reporter must not be able to probe moderation outcomes).\n 'report_action_taken',\n // Appellant feedback for a content-appeal decision (DJ ruling 2026-07-10 —\n // gap found by the hosted E2E build: reviewContentAppeal decided appeals with\n // NO channel reporting the outcome to the appellant). Fired on BOTH approve\n // and deny. It is the appellant's OWN appeal, so unlike report_action_taken\n // there is no privacy ceiling: the card states the outcome plainly and\n // targets My Uploads, where the resulting upload state lives.\n 'content_appeal_reviewed',\n] as const;\n\nexport const NotificationTypeSchema = z.enum(NOTIFICATION_TYPE_VALUES);\nexport type NotificationType = z.infer<typeof NotificationTypeSchema>;\n\n/** Delivery channels. Only `inApp` is implemented at launch; `email`/`push`\n * are future channel handlers dispatched from the `runSendNotification`\n * chokepoint. */\nexport const NOTIFICATION_CHANNEL_VALUES = ['inApp', 'email', 'push'] as const;\nexport const NotificationChannelSchema = z.enum(NOTIFICATION_CHANNEL_VALUES);\nexport type NotificationChannel = z.infer<typeof NotificationChannelSchema>;\n\nexport type NotificationCategory = 'user' | 'admin';\nexport const NotificationCategorySchema = z.enum(['user', 'admin']);\n\nexport interface NotificationTypeCatalogEntry {\n /** Which active collection / audience this type writes to. */\n category: NotificationCategory;\n /** `realtime` writes straight to active; `queued` goes through the batch processor. */\n delivery: 'realtime' | 'queued';\n /** Default channel list applied when a send omits `channels`. All `['inApp']` at launch. */\n defaultChannels: NotificationChannel[];\n}\n\n/**\n * The canonical TTT notification type catalog. `runSendNotification` resolves a\n * type's category/delivery here and carries `defaultChannels` through when a\n * send omits `channels`.\n */\nexport const NOTIFICATION_TYPE_CATALOG: Record<NotificationType, NotificationTypeCatalogEntry> = {\n content_report: { category: 'admin', delivery: 'realtime', defaultChannels: ['inApp'] },\n guild_invite: { category: 'user', delivery: 'queued', defaultChannels: ['inApp'] },\n admin_dispatch_reply: { category: 'user', delivery: 'realtime', defaultChannels: ['inApp'] },\n threshold_library_submission: { category: 'admin', delivery: 'queued', defaultChannels: ['inApp'] },\n threshold_library_reviewed: { category: 'user', delivery: 'queued', defaultChannels: ['inApp'] },\n hall_content_change_request_resolved: { category: 'user', delivery: 'queued', defaultChannels: ['inApp'] },\n admin_announcement: { category: 'user', delivery: 'queued', defaultChannels: ['inApp'] },\n followed_content_published: { category: 'user', delivery: 'queued', defaultChannels: ['inApp'] },\n member_content_published: { category: 'user', delivery: 'queued', defaultChannels: ['inApp'] },\n followed_craft_skill_published: { category: 'user', delivery: 'queued', defaultChannels: ['inApp'] },\n report_action_taken: { category: 'user', delivery: 'queued', defaultChannels: ['inApp'] },\n content_appeal_reviewed: { category: 'user', delivery: 'queued', defaultChannels: ['inApp'] },\n};\n\n// ============================================================================\n// PER-TYPE METADATA (discriminated union, keyed by `type`)\n// ============================================================================\n\n/**\n * Typed `metadata` payload for each notification type. The generic package\n * boundary takes `Record<string, unknown>`; the app validates against this\n * before sending so each type's payload is checked like every other callable\n * schema.\n */\nexport const NotificationMetadataByTypeSchema = z.discriminatedUnion('type', [\n z.object({\n type: z.literal('content_report'),\n reportGroupId: reportGroupIdSchema,\n reportedItemType: reportedItemTypeSchema,\n reportedItemId: reportedItemIdSchema,\n }).strict(),\n z.object({\n type: z.literal('guild_invite'),\n workProjectId: workProjectIdSchema,\n guildInviteId: guildInviteIdSchema,\n workTitle: titleSchema,\n }).strict(),\n z.object({\n type: z.literal('admin_dispatch_reply'),\n adminDispatchId: adminDispatchIdSchema,\n // Party-generic dispatch: present on workProject-party threads so the card routes\n // to the Work's correspondence surface. Absent on user-party threads (legacy shape).\n partyKind: z.enum(['user', 'workProject']).optional(),\n workProjectId: workProjectIdSchema.optional(),\n }).strict(),\n z.object({\n type: z.literal('threshold_library_submission'),\n thresholdItemId: thresholdItemIdSchema,\n hallItemId: hallItemIdSchema,\n workProjectId: workProjectIdSchema,\n }).strict(),\n // Author feedback for a review decision. Mirrors what runReviewThresholdItem\n // (ttt-prod) sends: only `needs_revision` is delivered today; `adminNotes` is\n // the reviewer's note, sent as null when the reviewer left none.\n z.object({\n type: z.literal('threshold_library_reviewed'),\n thresholdItemId: thresholdItemIdSchema,\n hallItemId: hallItemIdSchema,\n workProjectId: workProjectIdSchema,\n workProjectType: workProjectTypeSchema,\n itemId: z.string().min(1),\n decision: z.literal('needs_revision'),\n adminNotes: z.string().max(MAX_THRESHOLD_REVIEW_NOTES_LENGTH).nullable(),\n }).strict(),\n // Proposer feedback for a published change-request decision. Mirrors what\n // runReviewHallContentChangeRequest (ttt-prod) sends: `resolutionReason` is\n // required on a deny, optional on an approve — null when absent. The realm\n // grain (R1) sends `workRealmId` with `hallItemId` null; hall grains the\n // reverse.\n z.object({\n type: z.literal('hall_content_change_request_resolved'),\n changeRequestId: changeRequestIdSchema,\n hallItemId: hallItemIdSchema.nullable(),\n workRealmId: z.string().min(1).nullish(),\n workProjectId: workProjectIdSchema,\n decision: z.enum(['approved', 'denied']),\n resolutionReason: z.string().max(MAX_HALL_CHANGE_REQUEST_REASON_LENGTH).nullable(),\n }).strict(),\n z.object({\n type: z.literal('admin_announcement'),\n title: titleSchema,\n message: notificationMessageSchema,\n }).strict(),\n z.object({\n type: z.literal('followed_content_published'),\n workProjectId: workProjectIdSchema,\n workTitle: titleSchema,\n hallItemId: hallItemIdSchema,\n hallItemTitle: titleSchema,\n hallSubItemType: HallSubItemTypeSchema,\n }).strict(),\n // P7 Hall-publish MEMBER job — same Hall-publication fields as the follower type (it describes\n // the SAME publication to the work's members; the work route + \"your work was published!\" copy\n // are set by the emitter via targetPath/title, not metadata).\n z.object({\n type: z.literal('member_content_published'),\n workProjectId: workProjectIdSchema,\n workTitle: titleSchema,\n hallItemId: hallItemIdSchema,\n hallItemTitle: titleSchema,\n hallSubItemType: HallSubItemTypeSchema,\n }).strict(),\n // P7 craft-skill publish — points at the artisan whose skills updated. The actor name\n // (\"X uploaded new craft skills\") + the profile/skills route resolve from `artisanUid` at\n // render time (Display Identity Invariant); `staticRelight` shows no count.\n z.object({\n type: z.literal('followed_craft_skill_published'),\n artisanUid: userIdSchema,\n }).strict(),\n // Reporter feedback — metadata is deliberately minimal: `reportId` is the\n // reporter's OWN report-root doc id (deterministic per reporterUid + target,\n // see writeOrdinaryReport), used only as the dedup/aggregation key so a\n // reporter gets at most one card per report they filed. NO fields that\n // identify the reported user/content/remedy may ever be added here.\n z.object({\n type: z.literal('report_action_taken'),\n reportId: reportIdSchema,\n }).strict(),\n // Appellant feedback for a content-appeal decision. `appealId` is the\n // appellant's OWN appeal doc id (the dedup/aggregation key — one card per\n // appeal, a re-decision coalesces); `decision` drives the card copy.\n z.object({\n type: z.literal('content_appeal_reviewed'),\n appealId: appealIdSchema,\n decision: z.enum(['approved', 'denied']),\n }).strict(),\n]);\nexport type NotificationMetadataByType = z.infer<typeof NotificationMetadataByTypeSchema>;\n\n// ============================================================================\n// BROADCAST AUDIENCE SELECTOR\n// ============================================================================\n\n/**\n * Admin broadcast audience selector. Stored on a broadcast job; the scheduled\n * fan-out worker resolves a page of it into uids (domain-aware queries live in\n * ttt-prod — the package only ever receives uids).\n */\nexport const BroadcastAudienceSelectorSchema = z.discriminatedUnion('kind', [\n z.object({ kind: z.literal('allActiveUsers') }).strict(),\n z.object({\n kind: z.literal('explicitUids'),\n // The selector's documented audience cap (dedup + serialized-byte enforcement\n // for work/realm snapshots is app-side). Derives from the ONE named constant.\n uids: z.array(userIdSchema).min(1).max(MAX_BROADCAST_EXPLICIT_UIDS),\n }).strict(),\n z.object({\n kind: z.literal('workMembers'),\n workProjectId: workProjectIdSchema,\n }).strict(),\n z.object({\n kind: z.literal('realmMembers'),\n workRealmId: workRealmIdSchema,\n }).strict(),\n z.object({ kind: z.literal('allArtisans') }).strict(),\n]);\nexport type BroadcastAudienceSelector = z.infer<typeof BroadcastAudienceSelectorSchema>;\n\n// ============================================================================\n// CALLABLE INPUT SCHEMAS\n// ============================================================================\n\nexport const CreateNotificationBroadcastInputSchema = z.object({\n // Client-generated idempotency key — the app derives the broadcast eventId\n // deterministically from (actorUid, requestId) so a lost-ack retry is idempotent.\n requestId: z.string().min(1),\n selector: BroadcastAudienceSelectorSchema,\n title: titleSchema,\n message: notificationMessageSchema,\n}).strict();\nexport type CreateNotificationBroadcastInput = z.infer<typeof CreateNotificationBroadcastInputSchema>;\n\n/** Archive scope: a single notification, or the caller's whole category. */\nexport const ArchiveNotificationScopeSchema = z.discriminatedUnion('kind', [\n z.object({ kind: z.literal('single'), notificationId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('all') }).strict(),\n]);\nexport type ArchiveNotificationScope = z.infer<typeof ArchiveNotificationScopeSchema>;\n\n// No `device` field on the archive input — archive metadata is server-derived (A1).\nexport const ArchiveNotificationInputSchema = z.object({\n category: NotificationCategorySchema,\n scope: ArchiveNotificationScopeSchema,\n}).strict();\nexport type ArchiveNotificationInput = z.infer<typeof ArchiveNotificationInputSchema>;\n\n// Shared admin notifications have no per-admin seen state, so only the personal\n// `user` category can be marked seen.\nexport const MarkNotificationsSeenInputSchema = z.object({\n category: z.literal('user'),\n}).strict();\nexport type MarkNotificationsSeenInput = z.infer<typeof MarkNotificationsSeenInputSchema>;\n\n// ============================================================================\n// OBSERVED-GENERATION CALLABLE INPUT SCHEMAS (P6 tray)\n//\n// These are for the NEW observed-generation callables the P6 notification tray\n// will invoke. The LEGACY schemas above (MarkNotificationsSeenInputSchema /\n// ArchiveNotificationInputSchema) remain intact — the legacy callables still use\n// them.\n// ============================================================================\n\n// Max items per mark-seen call matches a sane notification tray page size.\nconst MARK_SEEN_MAX_ITEMS = 50;\n\n/**\n * A single rendered notification row and the generation the UI observed.\n * `activeId` is the Firestore active-notification document id;\n * `observedActivityGeneration` is the opaque token from that document.\n */\nconst SeenItemSchema = z.object({\n activeId: z.string().min(1),\n observedActivityGeneration: z.string().min(1),\n}).strict();\n\n/**\n * Input for the new observed-generation mark-seen callable (P6 tray).\n *\n * The UI sends only the rows it actually rendered plus their observed\n * `activityGeneration` tokens. The server sets `seenAt = now` ONLY when the\n * card's current `activityGeneration` matches `observedActivityGeneration`;\n * otherwise it is a no-op for that row (activity arrived after render, or a\n * delete+recreate rotated the token).\n *\n * category is always `'user'` — shared admin notifications have no per-admin\n * seen state.\n */\nexport const MarkNotificationsSeenObservedInputSchema = z.object({\n category: z.literal('user'),\n items: z.array(SeenItemSchema).min(1).max(MARK_SEEN_MAX_ITEMS),\n}).strict();\nexport type MarkNotificationsSeenObservedInput = z.infer<typeof MarkNotificationsSeenObservedInputSchema>;\n\n/**\n * Archive scope for the observed-generation callable.\n *\n * `single` — archive one notification card. Carries `notificationId` (the\n * active-card doc id) and `observedActivityGeneration` (the precondition:\n * the server archives only if the card's current generation matches).\n *\n * `all` — archive every card in the category. The per-card generation\n * precondition is applied server-side per card during bounded-page sweeps;\n * the caller supplies no single generation token here because there is no\n * single observed generation for the whole category. (Design choice: archive-all\n * carries no observedActivityGeneration at the top level; the server reads each\n * card's current generation as its own precondition. This is consistent with the\n * NOTIFICATIONS_REDESIGN \"mark-all/archive-all run bounded pages with stable\n * cursors until exhausted\" protocol and the archive-history identity formula\n * which keys each occurrence on requestId independently.)\n */\nexport const ArchiveNotificationObservedScopeSchema = z.discriminatedUnion('kind', [\n z.object({\n kind: z.literal('single'),\n notificationId: z.string().min(1),\n observedActivityGeneration: z.string().min(1),\n }).strict(),\n z.object({\n kind: z.literal('all'),\n }).strict(),\n]);\nexport type ArchiveNotificationObservedScope = z.infer<typeof ArchiveNotificationObservedScopeSchema>;\n\n/**\n * Input for the observed-generation archive callable (P6 tray).\n *\n * `requestId` is a per-call nonce — the tray mints a fresh uuid on every archive /\n * clear-all click, so it is NOT a replay-stability token (R39). Idempotency is provided\n * by ACTIVE-DOC DELETION: a replay finds the card already gone and no-ops, so an archive\n * never double-applies. The server combines `requestId` with the card's `activeId` to\n * form the deterministic history doc id (`hash('notification-archive', category,\n * audienceScope, requestId:activeId)`), so a single archive can never collide on another\n * card's history doc (R35).\n *\n * `category` scopes which active-notification collection is archived\n * (`activeUserNotifications` vs `activeAdminNotifications`) and forms part of\n * the history doc path.\n */\nexport const ArchiveNotificationObservedInputSchema = z.object({\n requestId: z.string().min(1),\n category: NotificationCategorySchema,\n scope: ArchiveNotificationObservedScopeSchema,\n}).strict();\nexport type ArchiveNotificationObservedInput = z.infer<typeof ArchiveNotificationObservedInputSchema>;\n\n// ============================================================================\n// SERVER-OWNED ARCHIVE-ALL JOB (replaces the browser clear-all loop)\n//\n// `enqueueArchiveAll` enqueues ONE durable archive-all job scoped to the tab's\n// category (idempotent per user+category+requestId) and returns { jobId }; the\n// bounded server worker drains that category's active cards each in its own\n// atomic archive+audit txn (per-card observed-generation precondition preserved).\n// `getArchiveAllStatus` is polled by the thin client hook. Per-tab scoping is\n// REQUIRED — a job only ever archives its own category, never all tabs.\n// ============================================================================\n\nexport const EnqueueArchiveAllInputSchema = z.object({\n requestId: z.string().min(1),\n category: NotificationCategorySchema,\n}).strict();\nexport type EnqueueArchiveAllInput = z.infer<typeof EnqueueArchiveAllInputSchema>;\n\nexport const GetArchiveAllStatusInputSchema = z.object({\n jobId: z.string().min(1),\n}).strict();\nexport type GetArchiveAllStatusInput = z.infer<typeof GetArchiveAllStatusInputSchema>;\n\n// Wire contract for the `resumeFanoutJob` callable — the admin console re-arms a\n// dead-lettered notification fanout job by id. Admin console-invoked, but still a\n// wire contract, so it lives here (callable-validation convention) rather than as a\n// local schema in the functions repo.\nexport const ResumeFanoutJobInputSchema = z.object({\n jobId: notificationFanoutJobIdSchema,\n}).strict();\nexport type ResumeFanoutJobInput = z.infer<typeof ResumeFanoutJobInputSchema>;\n\n// ============================================================================\n// AUDIT EVENT PAYLOADS (admin-only)\n// ============================================================================\n\n/**\n * Payload of a `notification.broadcastSent` audit event — written when an admin\n * enqueues a broadcast. Actor mode is `adminReview` / `adminOverride`. Records\n * the selector (never a pre-resolved uid list) + the job it created.\n */\nexport interface NotificationBroadcastSentAuditMetadata {\n jobId: string;\n selector: BroadcastAudienceSelector;\n title: string;\n}\n\n/**\n * Payload of a `notification.adminArchived` audit event — written when an admin\n * clears a shared admin notification (the `handledBy` action). Actor mode is\n * `adminReview` / `adminOverride`.\n */\nexport interface NotificationAdminArchivedAuditMetadata {\n scope: 'single' | 'all';\n /** Present for single-archive; absent for a category-wide `all` archive. */\n notificationId?: string;\n handledBy: string;\n}\n"]}
1
+ {"version":3,"file":"notification.js","sourceRoot":"","sources":["../../src/schemas/notification.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,EAAE;AACF,8EAA8E;AAC9E,+EAA+E;AAC/E,+EAA+E;AAC/E,8EAA8E;AAC9E,6EAA6E;AAC7E,iFAAiF;AACjF,mFAAmF;AACnF,mFAAmF;AACnF,gFAAgF;AAChF,6DAA6D;AAC7D,4EAA4E;AAC5E,sCAAsC;AACtC,EAAE;AACF,qEAAqE;AACrE,gEAAgE;AAChE,8EAA8E;AAC9E,2DAA2D;AAE3D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,6BAA6B,EAC7B,WAAW,EACX,mBAAmB,GACpB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,iCAAiC,EACjC,qCAAqC,EACrC,+BAA+B,EAC/B,2BAA2B,GAC5B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAE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sCAAsC;CAC9C,CAAC,CAAC,MAAM,EAAE,CAAC;AAGZ,+EAA+E;AAC/E,qEAAqE;AACrE,EAAE;AACF,+EAA+E;AAC/E,+EAA+E;AAC/E,4EAA4E;AAC5E,kFAAkF;AAClF,8EAA8E;AAC9E,wEAAwE;AACxE,+EAA+E;AAE/E,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IACnD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5B,QAAQ,EAAE,0BAA0B;CACrC,CAAC,CAAC,MAAM,EAAE,CAAC;AAGZ,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,MAAM,CAAC;IACrD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CACzB,CAAC,CAAC,MAAM,EAAE,CAAC;AAGZ,iFAAiF;AACjF,kFAAkF;AAClF,oFAAoF;AACpF,sCAAsC;AACtC,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,KAAK,EAAE,6BAA6B;CACrC,CAAC,CAAC,MAAM,EAAE,CAAC","sourcesContent":["// TTT notification contracts.\n//\n// `@ttt-productions/notification-core` is generic — at its package boundary a\n// notification's `metadata` is `Record<string, unknown>`. All TTT notification\n// policy lives here: the canonical type catalog (category / delivery / default\n// channels), the per-type typed `metadata` discriminated union, the broadcast\n// audience selector, and the callable input schemas. There is NO single send\n// chokepoint: ttt-prod has two intake lanes — reliable single/shared occurrences\n// (`writeReliableOccurrenceRow` / `enqueueReliableOccurrence`) and audience fanout\n// (`notificationFanoutJobs` → `processNotificationFanoutJobs`) — which converge on\n// the `notificationDeliveries` ledger, with `materializeDeliveries` as the sole\n// materializer. The fanout lane validates `metadata` against\n// `NotificationMetadataByTypeSchema` before a job is enqueued. See ttt-prod\n// docs/design/notification-system.md.\n//\n// The two notification audit-event payload shapes live here too (the\n// `AuditEventType` union members `notification.broadcastSent` /\n// `notification.adminArchived` are added in ../types/audit.ts; their actor is\n// always an admin mode — `adminReview` / `adminOverride`).\n\nimport { z } from 'zod';\nimport {\n userIdSchema,\n workProjectIdSchema,\n guildInviteIdSchema,\n adminDispatchIdSchema,\n hallItemIdSchema,\n thresholdItemIdSchema,\n changeRequestIdSchema,\n workProjectTypeSchema,\n notificationFanoutJobIdSchema,\n titleSchema,\n reportGroupIdSchema,\n} from './atoms.js';\nimport {\n MAX_THRESHOLD_REVIEW_NOTES_LENGTH,\n MAX_HALL_CHANGE_REQUEST_REASON_LENGTH,\n MAX_NOTIFICATION_MESSAGE_LENGTH,\n MAX_BROADCAST_EXPLICIT_UIDS,\n} from '../constants/business.js';\nimport { HallSubItemTypeSchema } from '../doc-schemas/content.js';\nimport { ReportableItemTypeSchema } from '../doc-schemas/safety/foundation.js';\n\n// String shape atoms specific to notifications.\nconst notificationMessageSchema = z.string().min(1).max(MAX_NOTIFICATION_MESSAGE_LENGTH);\n// The canonical reportable-item enum — never an open string (ARCH-102).\nconst reportedItemTypeSchema = ReportableItemTypeSchema;\nconst reportedItemIdSchema = z.string().min(1).max(128);\nconst reportIdSchema = z.string().min(1);\nconst appealIdSchema = z.string().min(1);\nconst workRealmIdSchema = z.string().min(1);\n\n// ============================================================================\n// TYPE + CHANNEL CATALOG\n// ============================================================================\n\nexport const NOTIFICATION_TYPE_VALUES = [\n 'content_report',\n 'guild_invite',\n 'admin_dispatch_reply',\n 'threshold_library_submission',\n // Author feedback for a Threshold Library review decision (only needs_revision is\n // delivered today — an approval reaches the author via the publish member fanout).\n 'threshold_library_reviewed',\n // Proposer feedback for a PUBLISHED change-request decision (approve/deny).\n 'hall_content_change_request_resolved',\n 'admin_announcement',\n 'followed_content_published',\n // The two audience-fanout triggers (see ttt-prod docs/design/notification-system.md).\n // `member_content_published`: the Hall-publish MEMBER job (\"your work was published!\") — same\n // `thresholdItemId` eventId as the follower job, different type so `deliveryId` stays distinct.\n // `followed_craft_skill_published`: craft-skill publish → the artisan's followers\n // (`staticRelight` strategy — count 1 forever, static copy, no count shown).\n 'member_content_published',\n 'followed_craft_skill_published',\n // Reporter feedback (DJ ruling 2026-07-06): when a report a user submitted is\n // closed as a REAL case WITH action (ordinary report root flips to `actioned`),\n // the reporter gets one light informational card. Never sent on dismissals.\n // Generic copy only — the card must not reveal the reported user, reason, or\n // remedy (a bad-faith reporter must not be able to probe moderation outcomes).\n 'report_action_taken',\n // Appellant feedback for a content-appeal decision (DJ ruling 2026-07-10 —\n // gap found by the hosted E2E build: reviewContentAppeal decided appeals with\n // NO channel reporting the outcome to the appellant). Fired on BOTH approve\n // and deny. It is the appellant's OWN appeal, so unlike report_action_taken\n // there is no privacy ceiling: the card states the outcome plainly and\n // targets My Uploads, where the resulting upload state lives.\n 'content_appeal_reviewed',\n] as const;\n\nexport const NotificationTypeSchema = z.enum(NOTIFICATION_TYPE_VALUES);\nexport type NotificationType = z.infer<typeof NotificationTypeSchema>;\n\n/** Delivery channels. Only `inApp` is implemented at launch; `email`/`push` are\n * reserved for future channel handlers. */\nexport const NOTIFICATION_CHANNEL_VALUES = ['inApp', 'email', 'push'] as const;\nexport const NotificationChannelSchema = z.enum(NOTIFICATION_CHANNEL_VALUES);\nexport type NotificationChannel = z.infer<typeof NotificationChannelSchema>;\n\nexport type NotificationCategory = 'user' | 'admin';\nexport const NotificationCategorySchema = z.enum(['user', 'admin']);\n\nexport interface NotificationTypeCatalogEntry {\n /** Which active collection / audience this type writes to. */\n category: NotificationCategory;\n /** `realtime` writes straight to active; `queued` goes through the batch processor. */\n delivery: 'realtime' | 'queued';\n /** Default channel list applied when a send omits `channels`. All `['inApp']` at launch. */\n defaultChannels: NotificationChannel[];\n}\n\n/**\n * The canonical TTT notification type catalog — the source `TTT_NOTIFICATION_CONFIG`\n * (../notifications) derives every type's category/delivery from. `defaultChannels`\n * is `['inApp']` for every type at launch.\n */\nexport const NOTIFICATION_TYPE_CATALOG: Record<NotificationType, NotificationTypeCatalogEntry> = {\n content_report: { category: 'admin', delivery: 'realtime', defaultChannels: ['inApp'] },\n guild_invite: { category: 'user', delivery: 'queued', defaultChannels: ['inApp'] },\n admin_dispatch_reply: { category: 'user', delivery: 'realtime', defaultChannels: ['inApp'] },\n threshold_library_submission: { category: 'admin', delivery: 'queued', defaultChannels: ['inApp'] },\n threshold_library_reviewed: { category: 'user', delivery: 'queued', defaultChannels: ['inApp'] },\n hall_content_change_request_resolved: { category: 'user', delivery: 'queued', defaultChannels: ['inApp'] },\n admin_announcement: { category: 'user', delivery: 'queued', defaultChannels: ['inApp'] },\n followed_content_published: { category: 'user', delivery: 'queued', defaultChannels: ['inApp'] },\n member_content_published: { category: 'user', delivery: 'queued', defaultChannels: ['inApp'] },\n followed_craft_skill_published: { category: 'user', delivery: 'queued', defaultChannels: ['inApp'] },\n report_action_taken: { category: 'user', delivery: 'queued', defaultChannels: ['inApp'] },\n content_appeal_reviewed: { category: 'user', delivery: 'queued', defaultChannels: ['inApp'] },\n};\n\n// ============================================================================\n// PER-TYPE METADATA (discriminated union, keyed by `type`)\n// ============================================================================\n\n/**\n * Typed `metadata` payload for each notification type. The generic package\n * boundary takes `Record<string, unknown>`; the app validates against this\n * before sending so each type's payload is checked like every other callable\n * schema.\n */\nexport const NotificationMetadataByTypeSchema = z.discriminatedUnion('type', [\n z.object({\n type: z.literal('content_report'),\n reportGroupId: reportGroupIdSchema,\n reportedItemType: reportedItemTypeSchema,\n reportedItemId: reportedItemIdSchema,\n }).strict(),\n z.object({\n type: z.literal('guild_invite'),\n workProjectId: workProjectIdSchema,\n guildInviteId: guildInviteIdSchema,\n workTitle: titleSchema,\n }).strict(),\n z.object({\n type: z.literal('admin_dispatch_reply'),\n adminDispatchId: adminDispatchIdSchema,\n // Party-generic dispatch: present on workProject-party threads so the card routes\n // to the Work's correspondence surface. Absent on user-party threads (legacy shape).\n partyKind: z.enum(['user', 'workProject']).optional(),\n workProjectId: workProjectIdSchema.optional(),\n }).strict(),\n z.object({\n type: z.literal('threshold_library_submission'),\n thresholdItemId: thresholdItemIdSchema,\n hallItemId: hallItemIdSchema,\n workProjectId: workProjectIdSchema,\n }).strict(),\n // Author feedback for a review decision. Mirrors what runReviewThresholdItem\n // (ttt-prod) sends: only `needs_revision` is delivered today; `adminNotes` is\n // the reviewer's note, sent as null when the reviewer left none.\n z.object({\n type: z.literal('threshold_library_reviewed'),\n thresholdItemId: thresholdItemIdSchema,\n hallItemId: hallItemIdSchema,\n workProjectId: workProjectIdSchema,\n workProjectType: workProjectTypeSchema,\n itemId: z.string().min(1),\n decision: z.literal('needs_revision'),\n adminNotes: z.string().max(MAX_THRESHOLD_REVIEW_NOTES_LENGTH).nullable(),\n }).strict(),\n // Proposer feedback for a published change-request decision. Mirrors what\n // runReviewHallContentChangeRequest (ttt-prod) sends: `resolutionReason` is\n // required on a deny, optional on an approve — null when absent. The realm\n // grain (R1) sends `workRealmId` with `hallItemId` null; hall grains the\n // reverse.\n z.object({\n type: z.literal('hall_content_change_request_resolved'),\n changeRequestId: changeRequestIdSchema,\n hallItemId: hallItemIdSchema.nullable(),\n workRealmId: z.string().min(1).nullish(),\n workProjectId: workProjectIdSchema,\n decision: z.enum(['approved', 'denied']),\n resolutionReason: z.string().max(MAX_HALL_CHANGE_REQUEST_REASON_LENGTH).nullable(),\n }).strict(),\n z.object({\n type: z.literal('admin_announcement'),\n title: titleSchema,\n message: notificationMessageSchema,\n }).strict(),\n z.object({\n type: z.literal('followed_content_published'),\n workProjectId: workProjectIdSchema,\n workTitle: titleSchema,\n hallItemId: hallItemIdSchema,\n hallItemTitle: titleSchema,\n hallSubItemType: HallSubItemTypeSchema,\n }).strict(),\n // P7 Hall-publish MEMBER job — same Hall-publication fields as the follower type (it describes\n // the SAME publication to the work's members; the work route + \"your work was published!\" copy\n // are set by the emitter via targetPath/title, not metadata).\n z.object({\n type: z.literal('member_content_published'),\n workProjectId: workProjectIdSchema,\n workTitle: titleSchema,\n hallItemId: hallItemIdSchema,\n hallItemTitle: titleSchema,\n hallSubItemType: HallSubItemTypeSchema,\n }).strict(),\n // P7 craft-skill publish — points at the artisan whose skills updated. The actor name\n // (\"X uploaded new craft skills\") + the profile/skills route resolve from `artisanUid` at\n // render time (Display Identity Invariant); `staticRelight` shows no count.\n z.object({\n type: z.literal('followed_craft_skill_published'),\n artisanUid: userIdSchema,\n }).strict(),\n // Reporter feedback — metadata is deliberately minimal: `reportId` is the\n // reporter's OWN report-root doc id (deterministic per reporterUid + target,\n // see writeOrdinaryReport), used only as the dedup/aggregation key so a\n // reporter gets at most one card per report they filed. NO fields that\n // identify the reported user/content/remedy may ever be added here.\n z.object({\n type: z.literal('report_action_taken'),\n reportId: reportIdSchema,\n }).strict(),\n // Appellant feedback for a content-appeal decision. `appealId` is the\n // appellant's OWN appeal doc id (the dedup/aggregation key — one card per\n // appeal, a re-decision coalesces); `decision` drives the card copy.\n z.object({\n type: z.literal('content_appeal_reviewed'),\n appealId: appealIdSchema,\n decision: z.enum(['approved', 'denied']),\n }).strict(),\n]);\nexport type NotificationMetadataByType = z.infer<typeof NotificationMetadataByTypeSchema>;\n\n// ============================================================================\n// BROADCAST AUDIENCE SELECTOR\n// ============================================================================\n\n/**\n * Admin broadcast audience selector. Stored on a broadcast job; the scheduled\n * fan-out worker resolves a page of it into uids (domain-aware queries live in\n * ttt-prod — the package only ever receives uids).\n */\nexport const BroadcastAudienceSelectorSchema = z.discriminatedUnion('kind', [\n z.object({ kind: z.literal('allActiveUsers') }).strict(),\n z.object({\n kind: z.literal('explicitUids'),\n // The selector's documented audience cap (dedup + serialized-byte enforcement\n // for work/realm snapshots is app-side). Derives from the ONE named constant.\n uids: z.array(userIdSchema).min(1).max(MAX_BROADCAST_EXPLICIT_UIDS),\n }).strict(),\n z.object({\n kind: z.literal('workMembers'),\n workProjectId: workProjectIdSchema,\n }).strict(),\n z.object({\n kind: z.literal('realmMembers'),\n workRealmId: workRealmIdSchema,\n }).strict(),\n z.object({ kind: z.literal('allArtisans') }).strict(),\n]);\nexport type BroadcastAudienceSelector = z.infer<typeof BroadcastAudienceSelectorSchema>;\n\n// ============================================================================\n// CALLABLE INPUT SCHEMAS\n// ============================================================================\n\nexport const CreateNotificationBroadcastInputSchema = z.object({\n // Client-generated idempotency key — the app derives the broadcast eventId\n // deterministically from (actorUid, requestId) so a lost-ack retry is idempotent.\n requestId: z.string().min(1),\n selector: BroadcastAudienceSelectorSchema,\n title: titleSchema,\n message: notificationMessageSchema,\n}).strict();\nexport type CreateNotificationBroadcastInput = z.infer<typeof CreateNotificationBroadcastInputSchema>;\n\n/** Archive scope: a single notification, or the caller's whole category. */\nexport const ArchiveNotificationScopeSchema = z.discriminatedUnion('kind', [\n z.object({ kind: z.literal('single'), notificationId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('all') }).strict(),\n]);\nexport type ArchiveNotificationScope = z.infer<typeof ArchiveNotificationScopeSchema>;\n\n// No `device` field on the archive input — archive metadata is server-derived (A1).\nexport const ArchiveNotificationInputSchema = z.object({\n category: NotificationCategorySchema,\n scope: ArchiveNotificationScopeSchema,\n}).strict();\nexport type ArchiveNotificationInput = z.infer<typeof ArchiveNotificationInputSchema>;\n\n// Shared admin notifications have no per-admin seen state, so only the personal\n// `user` category can be marked seen.\nexport const MarkNotificationsSeenInputSchema = z.object({\n category: z.literal('user'),\n}).strict();\nexport type MarkNotificationsSeenInput = z.infer<typeof MarkNotificationsSeenInputSchema>;\n\n// ============================================================================\n// OBSERVED-GENERATION CALLABLE INPUT SCHEMAS (P6 tray)\n//\n// These are for the NEW observed-generation callables the P6 notification tray\n// will invoke. The LEGACY schemas above (MarkNotificationsSeenInputSchema /\n// ArchiveNotificationInputSchema) remain intact — the legacy callables still use\n// them.\n// ============================================================================\n\n// Max items per mark-seen call matches a sane notification tray page size.\nconst MARK_SEEN_MAX_ITEMS = 50;\n\n/**\n * A single rendered notification row and the generation the UI observed.\n * `activeId` is the Firestore active-notification document id;\n * `observedActivityGeneration` is the opaque token from that document.\n */\nconst SeenItemSchema = z.object({\n activeId: z.string().min(1),\n observedActivityGeneration: z.string().min(1),\n}).strict();\n\n/**\n * Input for the new observed-generation mark-seen callable (P6 tray).\n *\n * The UI sends only the rows it actually rendered plus their observed\n * `activityGeneration` tokens. The server sets `seenAt = now` ONLY when the\n * card's current `activityGeneration` matches `observedActivityGeneration`;\n * otherwise it is a no-op for that row (activity arrived after render, or a\n * delete+recreate rotated the token).\n *\n * category is always `'user'` — shared admin notifications have no per-admin\n * seen state.\n */\nexport const MarkNotificationsSeenObservedInputSchema = z.object({\n category: z.literal('user'),\n items: z.array(SeenItemSchema).min(1).max(MARK_SEEN_MAX_ITEMS),\n}).strict();\nexport type MarkNotificationsSeenObservedInput = z.infer<typeof MarkNotificationsSeenObservedInputSchema>;\n\n/**\n * Archive scope for the observed-generation callable.\n *\n * `single` — archive one notification card. Carries `notificationId` (the\n * active-card doc id) and `observedActivityGeneration` (the precondition:\n * the server archives only if the card's current generation matches).\n *\n * `all` — archive every card in the category. The per-card generation\n * precondition is applied server-side per card during bounded-page sweeps;\n * the caller supplies no single generation token here because there is no\n * single observed generation for the whole category. (Design choice: archive-all\n * carries no observedActivityGeneration at the top level; the server reads each\n * card's current generation as its own precondition. This is consistent with the\n * frozen \"mark-all/archive-all run bounded pages with stable cursors until\n * exhausted\" protocol (ttt-prod docs/design/notification-system.md) and the\n * archive-history identity formula\n * which keys each occurrence on requestId independently.)\n */\nexport const ArchiveNotificationObservedScopeSchema = z.discriminatedUnion('kind', [\n z.object({\n kind: z.literal('single'),\n notificationId: z.string().min(1),\n observedActivityGeneration: z.string().min(1),\n }).strict(),\n z.object({\n kind: z.literal('all'),\n }).strict(),\n]);\nexport type ArchiveNotificationObservedScope = z.infer<typeof ArchiveNotificationObservedScopeSchema>;\n\n/**\n * Input for the observed-generation archive callable (P6 tray).\n *\n * `requestId` is a per-call nonce — the tray mints a fresh uuid on every archive /\n * clear-all click, so it is NOT a replay-stability token (R39). Idempotency is provided\n * by ACTIVE-DOC DELETION: a replay finds the card already gone and no-ops, so an archive\n * never double-applies. The server combines `requestId` with the card's `activeId` to\n * form the deterministic history doc id (`hash('notification-archive', category,\n * audienceScope, requestId:activeId)`), so a single archive can never collide on another\n * card's history doc (R35).\n *\n * `category` scopes which active-notification collection is archived\n * (`activeUserNotifications` vs `activeAdminNotifications`) and forms part of\n * the history doc path.\n */\nexport const ArchiveNotificationObservedInputSchema = z.object({\n requestId: z.string().min(1),\n category: NotificationCategorySchema,\n scope: ArchiveNotificationObservedScopeSchema,\n}).strict();\nexport type ArchiveNotificationObservedInput = z.infer<typeof ArchiveNotificationObservedInputSchema>;\n\n// ============================================================================\n// SERVER-OWNED ARCHIVE-ALL JOB (replaces the browser clear-all loop)\n//\n// `enqueueArchiveAll` enqueues ONE durable archive-all job scoped to the tab's\n// category (idempotent per user+category+requestId) and returns { jobId }; the\n// bounded server worker drains that category's active cards each in its own\n// atomic archive+audit txn (per-card observed-generation precondition preserved).\n// `getArchiveAllStatus` is polled by the thin client hook. Per-tab scoping is\n// REQUIRED — a job only ever archives its own category, never all tabs.\n// ============================================================================\n\nexport const EnqueueArchiveAllInputSchema = z.object({\n requestId: z.string().min(1),\n category: NotificationCategorySchema,\n}).strict();\nexport type EnqueueArchiveAllInput = z.infer<typeof EnqueueArchiveAllInputSchema>;\n\nexport const GetArchiveAllStatusInputSchema = z.object({\n jobId: z.string().min(1),\n}).strict();\nexport type GetArchiveAllStatusInput = z.infer<typeof GetArchiveAllStatusInputSchema>;\n\n// Wire contract for the `resumeFanoutJob` callable — the admin console re-arms a\n// dead-lettered notification fanout job by id. Admin console-invoked, but still a\n// wire contract, so it lives here (callable-validation convention) rather than as a\n// local schema in the functions repo.\nexport const ResumeFanoutJobInputSchema = z.object({\n jobId: notificationFanoutJobIdSchema,\n}).strict();\nexport type ResumeFanoutJobInput = z.infer<typeof ResumeFanoutJobInputSchema>;\n\n// ============================================================================\n// AUDIT EVENT PAYLOADS (admin-only)\n// ============================================================================\n\n/**\n * Payload of a `notification.broadcastSent` audit event — written when an admin\n * enqueues a broadcast. Actor mode is `adminReview` / `adminOverride`. Records\n * the selector (never a pre-resolved uid list) + the job it created.\n */\nexport interface NotificationBroadcastSentAuditMetadata {\n jobId: string;\n selector: BroadcastAudienceSelector;\n title: string;\n}\n\n/**\n * Payload of a `notification.adminArchived` audit event — written when an admin\n * clears a shared admin notification (the `handledBy` action). Actor mode is\n * `adminReview` / `adminOverride`.\n */\nexport interface NotificationAdminArchivedAuditMetadata {\n scope: 'single' | 'all';\n /** Present for single-archive; absent for a category-wide `all` archive. */\n notificationId?: string;\n handledBy: string;\n}\n"]}
@@ -1,47 +1,3 @@
1
1
  export type { Mention, MentionType } from '../media/atoms.js';
2
- import type { Mention } from '../media/atoms.js';
3
- import type { CraftSkillKind, CraftSkillSourceReference } from '../doc-schemas/user.js';
4
- import type { ContentMediaKind } from '../doc-schemas/media-assets.js';
5
- import type { MediaType, AuditionAnnounceKind } from '../doc-schemas/social.js';
6
- import type { HallSubItemType } from '../doc-schemas/content.js';
7
- import type { CraftSkillTagId } from '../constants/options.js';
8
- import type { WorkProjectType } from './content.js';
9
- /**
10
- * Serializable subset of SquareStreetz post creation payload.
11
- * Frontend extends this with `mediaFile?: File` locally.
12
- * Every union/allowlist field derives from its ONE canonical declaration (ARCH-102) —
13
- * never an inline literal union.
14
- */
15
- export type SquareStreetzPostPayload = {
16
- userId: string;
17
- mentions?: Mention[];
18
- newMediaAssetId?: string;
19
- craftSkill?: {
20
- id: string;
21
- name: string;
22
- mediaAssetId: string;
23
- type: ContentMediaKind;
24
- tags?: CraftSkillTagId[];
25
- kind?: CraftSkillKind;
26
- source?: CraftSkillSourceReference;
27
- };
28
- craftSkillId?: string;
29
- workProjectTitle?: string;
30
- workProjectId?: string;
31
- workProjectType?: WorkProjectType;
32
- workProjectDescription?: string;
33
- workRealmId?: string;
34
- workRealmTitle?: string;
35
- hallItemId?: string;
36
- hallItemTitle?: string;
37
- hallSubItemType?: HallSubItemType;
38
- content?: string;
39
- mediaAssetId?: string;
40
- mediaType?: MediaType;
41
- createdAt?: number;
42
- auditionId?: string;
43
- commissionListingId?: string;
44
- auditionAnnounceKind?: AuditionAnnounceKind;
45
- };
46
- export type { SquareStreetzPostType, SquareStreetzPost, MentionHistoryItem, MentionHistoryDocument, FollowEdge, FollowCounter, } from '../doc-schemas/social.js';
2
+ export type { SquareStreetzPostType, SquareStreetzPost, SquareStreetzPostPayload, MentionHistoryItem, MentionHistoryDocument, FollowEdge, FollowCounter, } from '../doc-schemas/social.js';
47
3
  //# sourceMappingURL=social.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"social.d.ts","sourceRoot":"","sources":["../../src/types/social.ts"],"names":[],"mappings":"AAEA,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAE,cAAc,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACxF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,KAAK,EAAE,SAAS,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAOpD;;;;;GAKG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IAMzB,UAAU,CAAC,EAAE;QACX,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,YAAY,EAAE,MAAM,CAAC;QACrB,IAAI,EAAE,gBAAgB,CAAC;QACvB,IAAI,CAAC,EAAE,eAAe,EAAE,CAAC;QACzB,IAAI,CAAC,EAAE,cAAc,CAAC;QACtB,MAAM,CAAC,EAAE,yBAAyB,CAAC;KACpC,CAAC;IACF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;CAC7C,CAAC;AAEF,YAAY,EACV,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,UAAU,EACV,aAAa,GACd,MAAM,0BAA0B,CAAC"}
1
+ {"version":3,"file":"social.d.ts","sourceRoot":"","sources":["../../src/types/social.ts"],"names":[],"mappings":"AAEA,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAQ9D,YAAY,EACV,qBAAqB,EACrB,iBAAiB,EACjB,wBAAwB,EACxB,kBAAkB,EAClB,sBAAsB,EACtB,UAAU,EACV,aAAa,GACd,MAAM,0BAA0B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"social.js","sourceRoot":"","sources":["../../src/types/social.ts"],"names":[],"mappings":"","sourcesContent":["// Social types: SquareStreetz feed, Mentions, Follows. (Pledge-payment types live in\n// ../types/payments.ts.)\nexport type { Mention, MentionType } from '../media/atoms.js';\nimport type { Mention } from '../media/atoms.js';\nimport type { CraftSkillKind, CraftSkillSourceReference } from '../doc-schemas/user.js';\nimport type { ContentMediaKind } from '../doc-schemas/media-assets.js';\nimport type { MediaType, AuditionAnnounceKind } from '../doc-schemas/social.js';\nimport type { HallSubItemType } from '../doc-schemas/content.js';\nimport type { CraftSkillTagId } from '../constants/options.js';\nimport type { WorkProjectType } from './content.js';\n\n// --- SquareStreetz Social Media ---\n\n// SquareStreetz post/mention-history/follow shapes are re-exported from\n// ../doc-schemas/social.ts below (single source of truth).\n\n/**\n * Serializable subset of SquareStreetz post creation payload.\n * Frontend extends this with `mediaFile?: File` locally.\n * Every union/allowlist field derives from its ONE canonical declaration (ARCH-102) —\n * never an inline literal union.\n */\nexport type SquareStreetzPostPayload = {\n userId: string;\n mentions?: Mention[];\n newMediaAssetId?: string;\n // `tags` (canonical discipline-tag ids), `kind` (attestation kind), and `source`\n // (the mimicOnTtt original — a user/workProject reference, rendered as a resolvable\n // mention link) let the NEW_CRAFT_SKILL Streetz announcement describe the craft\n // WITHOUT the client-supplied file name (`name` = originalFileName — never put a\n // file name in public post content).\n craftSkill?: {\n id: string;\n name: string;\n mediaAssetId: string;\n type: ContentMediaKind;\n tags?: CraftSkillTagId[];\n kind?: CraftSkillKind;\n source?: CraftSkillSourceReference;\n };\n craftSkillId?: string;\n workProjectTitle?: string;\n workProjectId?: string;\n workProjectType?: WorkProjectType;\n workProjectDescription?: string;\n workRealmId?: string;\n workRealmTitle?: string;\n hallItemId?: string;\n hallItemTitle?: string;\n hallSubItemType?: HallSubItemType;\n content?: string;\n mediaAssetId?: string;\n mediaType?: MediaType;\n createdAt?: number;\n auditionId?: string;\n commissionListingId?: string;\n auditionAnnounceKind?: AuditionAnnounceKind;\n};\n\nexport type {\n SquareStreetzPostType,\n SquareStreetzPost,\n MentionHistoryItem,\n MentionHistoryDocument,\n FollowEdge,\n FollowCounter,\n} from '../doc-schemas/social.js';\n"]}
1
+ {"version":3,"file":"social.js","sourceRoot":"","sources":["../../src/types/social.ts"],"names":[],"mappings":"","sourcesContent":["// Social types: SquareStreetz feed, Mentions, Follows. (Pledge-payment types live in\n// ../types/payments.ts.)\nexport type { Mention, MentionType } from '../media/atoms.js';\n\n// --- SquareStreetz Social Media ---\n// SquareStreetz post/mention-history/follow shapes — plus SquareStreetzPostPayload (the\n// create/announcement transport shape, inferred from SquareStreetzPostPayloadSchema) — are\n// the single source of truth in ../doc-schemas/social.ts and re-exported below. The\n// frontend extends SquareStreetzPostPayload with a local `mediaFile?: File`.\n\nexport type {\n SquareStreetzPostType,\n SquareStreetzPost,\n SquareStreetzPostPayload,\n MentionHistoryItem,\n MentionHistoryDocument,\n FollowEdge,\n FollowCounter,\n} from '../doc-schemas/social.js';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttt-productions/ttt-core",
3
- "version": "0.78.22",
3
+ "version": "0.78.24",
4
4
  "description": "Core types, Firestore path constants, and shared constants for TTT Productions",
5
5
  "repository": {
6
6
  "type": "git",
@@ -115,9 +115,9 @@
115
115
  "dependencies": {
116
116
  "@ttt-productions/audit-core": "^0.7.1",
117
117
  "@ttt-productions/chat-schemas": "^0.9.3",
118
- "@ttt-productions/edge-protocol-core": "^0.1.4",
118
+ "@ttt-productions/edge-protocol-core": "^0.1.5",
119
119
  "@ttt-productions/media-schemas": "^0.14.3",
120
- "@ttt-productions/notification-core": "^0.15.4",
120
+ "@ttt-productions/notification-core": "^0.15.5",
121
121
  "@ttt-productions/report-core": "^0.16.6",
122
122
  "zod": "^4.4.3"
123
123
  },