@ttt-productions/ttt-core 0.78.23 → 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 (127) 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.map +1 -1
  114. package/dist/safety/resource-keys.js +2 -1
  115. package/dist/safety/resource-keys.js.map +1 -1
  116. package/dist/schemas/chat.js +3 -3
  117. package/dist/schemas/chat.js.map +1 -1
  118. package/dist/schemas/ncii.js +1 -1
  119. package/dist/schemas/ncii.js.map +1 -1
  120. package/dist/schemas/notification.d.ts +8 -8
  121. package/dist/schemas/notification.d.ts.map +1 -1
  122. package/dist/schemas/notification.js +17 -11
  123. package/dist/schemas/notification.js.map +1 -1
  124. package/dist/types/social.d.ts +1 -45
  125. package/dist/types/social.d.ts.map +1 -1
  126. package/dist/types/social.js.map +1 -1
  127. package/package.json +3 -3
@@ -33,7 +33,7 @@ export declare const SEARCH_RESULT_LIMIT = 6;
33
33
  * eligibility check suppresses the automatic invitation while a member's
34
34
  * `completedVersion` equals it. Bump when the permanent-shell-controls tour changes
35
35
  * enough to re-invite every member. See
36
- * docs/design/landing-backstage-guide-and-first-visit-plan.md §10.
36
+ * ttt-prod docs/design/landing-backstage-guide-and-first-visit-plan.md §10.
37
37
  */
38
38
  export declare const SITE_TOUR_CURRENT_VERSION = 1;
39
39
  //# sourceMappingURL=business-user.d.ts.map
@@ -42,7 +42,7 @@ export const SEARCH_RESULT_LIMIT = 6;
42
42
  * eligibility check suppresses the automatic invitation while a member's
43
43
  * `completedVersion` equals it. Bump when the permanent-shell-controls tour changes
44
44
  * enough to re-invite every member. See
45
- * docs/design/landing-backstage-guide-and-first-visit-plan.md §10.
45
+ * ttt-prod docs/design/landing-backstage-guide-and-first-visit-plan.md §10.
46
46
  */
47
47
  export const SITE_TOUR_CURRENT_VERSION = 1;
48
48
  //# sourceMappingURL=business-user.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"business-user.js","sourceRoot":"","sources":["../../src/constants/business-user.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,+BAA+B;AAE/B,6BAA6B;AAE7B,0DAA0D;AAC1D,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAErC,0DAA0D;AAC1D,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAEtC,2EAA2E;AAC3E,MAAM,CAAC,MAAM,cAAc,GAAG,gBAAgB,CAAC;AAE/C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,eAAe,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,oCAAoC;AAEpC,sFAAsF;AACtF,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,CAAC,IAAI,CAAC,cAAc,CAAC;AAEnE,yEAAyE;AAEzE,4EAA4E;AAC5E,MAAM,CAAC,MAAM,uBAAuB,GAAG,aAAa,CAAC,IAAI,CAAC,oBAAoB,CAAC;AAE/E,0EAA0E;AAC1E,MAAM,CAAC,MAAM,4BAA4B,GAAG,aAAa,CAAC,IAAI,CAAC,yBAAyB,CAAC;AAEzF,qDAAqD;AACrD,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAEtC,6CAA6C;AAC7C,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,CAAC;AAE/C,yFAAyF;AACzF,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,CAAC;AAE/C,0BAA0B;AAE1B,iFAAiF;AACjF,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAEpC,iBAAiB;AAEjB,6DAA6D;AAC7D,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAErC,gCAAgC;AAEhC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC","sourcesContent":["// User identity + profile business-rule constants — display names, craft skills,\n// mention history, and search.\n\n// --- User Display Names ---\n\n/** Minimum length for a user display name (inclusive). */\nexport const USERNAME_MIN_LENGTH = 3;\n\n/** Maximum length for a user display name (inclusive). */\nexport const USERNAME_MAX_LENGTH = 20;\n\n/** Allowed characters in a user display name: letters and numbers only. */\nexport const USERNAME_REGEX = /^[a-zA-Z0-9]+$/;\n\n/**\n * Display-name sentinel for an erased account (N3 data-deletion / GDPR erasure).\n * The `publicUsers/{uid}` doc is kept (so uid→name resolvers keep working) with\n * `displayName` set to this and `anonymizedAt` stamped; uid-keyed authorship /\n * share-tombstone records render with this label.\n */\nexport const FORMER_MEMBER_DISPLAY_NAME = 'Former member';\n\nimport { ACTIVE_LIMITS } from './app-mode.js';\n\n// --- User Profile Craft Skills ---\n\n/** Maximum number of craft-skills a user can upload to their profile. Mode-varied. */\nexport const CRAFT_SKILL_LIMIT = ACTIVE_LIMITS.user.maxCraftSkills;\n\n// --- Work-project participation caps (mode-varied, server-enforced) ---\n\n/** Maximum number of work projects an artisan can own (steward) at once. */\nexport const MAX_OWNED_WORK_PROJECTS = ACTIVE_LIMITS.user.maxOwnedWorkProjects;\n\n/** Maximum number of active guild memberships a user can hold at once. */\nexport const MAX_ASSOCIATED_WORK_PROJECTS = ACTIVE_LIMITS.user.maxAssociatedWorkProjects;\n\n/** Maximum number of tags allowed per craftSkill. */\nexport const MAX_CRAFT_SKILL_TAGS = 5;\n\n/** Maximum length for a craft-skill name. */\nexport const MAX_CRAFT_SKILL_NAME_LENGTH = 200;\n\n/** Non-US artisan-interest country/region free-text (input schema + privateData doc). */\nexport const MAX_ARTISAN_LOCATION_LENGTH = 100;\n\n// --- Mention History ---\n\n/** Maximum number of recent mentions kept in the user's mention-history hook. */\nexport const MAX_HISTORY_ITEMS = 10;\n\n// --- Search ---\n\n/** Maximum number of results returned by the search hook. */\nexport const SEARCH_RESULT_LIMIT = 6;\n\n// --- First-visit site tour ---\n\n/**\n * Current first-visit site-tour version. The `updateSiteTourPreference` callable stamps\n * this onto `privateData.siteTour.completedVersion` at completion, and the landing\n * eligibility check suppresses the automatic invitation while a member's\n * `completedVersion` equals it. Bump when the permanent-shell-controls tour changes\n * enough to re-invite every member. See\n * docs/design/landing-backstage-guide-and-first-visit-plan.md §10.\n */\nexport const SITE_TOUR_CURRENT_VERSION = 1;\n"]}
1
+ {"version":3,"file":"business-user.js","sourceRoot":"","sources":["../../src/constants/business-user.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,+BAA+B;AAE/B,6BAA6B;AAE7B,0DAA0D;AAC1D,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAErC,0DAA0D;AAC1D,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAEtC,2EAA2E;AAC3E,MAAM,CAAC,MAAM,cAAc,GAAG,gBAAgB,CAAC;AAE/C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,eAAe,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,oCAAoC;AAEpC,sFAAsF;AACtF,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,CAAC,IAAI,CAAC,cAAc,CAAC;AAEnE,yEAAyE;AAEzE,4EAA4E;AAC5E,MAAM,CAAC,MAAM,uBAAuB,GAAG,aAAa,CAAC,IAAI,CAAC,oBAAoB,CAAC;AAE/E,0EAA0E;AAC1E,MAAM,CAAC,MAAM,4BAA4B,GAAG,aAAa,CAAC,IAAI,CAAC,yBAAyB,CAAC;AAEzF,qDAAqD;AACrD,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAEtC,6CAA6C;AAC7C,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,CAAC;AAE/C,yFAAyF;AACzF,MAAM,CAAC,MAAM,2BAA2B,GAAG,GAAG,CAAC;AAE/C,0BAA0B;AAE1B,iFAAiF;AACjF,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,CAAC;AAEpC,iBAAiB;AAEjB,6DAA6D;AAC7D,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAErC,gCAAgC;AAEhC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC","sourcesContent":["// User identity + profile business-rule constants — display names, craft skills,\n// mention history, and search.\n\n// --- User Display Names ---\n\n/** Minimum length for a user display name (inclusive). */\nexport const USERNAME_MIN_LENGTH = 3;\n\n/** Maximum length for a user display name (inclusive). */\nexport const USERNAME_MAX_LENGTH = 20;\n\n/** Allowed characters in a user display name: letters and numbers only. */\nexport const USERNAME_REGEX = /^[a-zA-Z0-9]+$/;\n\n/**\n * Display-name sentinel for an erased account (N3 data-deletion / GDPR erasure).\n * The `publicUsers/{uid}` doc is kept (so uid→name resolvers keep working) with\n * `displayName` set to this and `anonymizedAt` stamped; uid-keyed authorship /\n * share-tombstone records render with this label.\n */\nexport const FORMER_MEMBER_DISPLAY_NAME = 'Former member';\n\nimport { ACTIVE_LIMITS } from './app-mode.js';\n\n// --- User Profile Craft Skills ---\n\n/** Maximum number of craft-skills a user can upload to their profile. Mode-varied. */\nexport const CRAFT_SKILL_LIMIT = ACTIVE_LIMITS.user.maxCraftSkills;\n\n// --- Work-project participation caps (mode-varied, server-enforced) ---\n\n/** Maximum number of work projects an artisan can own (steward) at once. */\nexport const MAX_OWNED_WORK_PROJECTS = ACTIVE_LIMITS.user.maxOwnedWorkProjects;\n\n/** Maximum number of active guild memberships a user can hold at once. */\nexport const MAX_ASSOCIATED_WORK_PROJECTS = ACTIVE_LIMITS.user.maxAssociatedWorkProjects;\n\n/** Maximum number of tags allowed per craftSkill. */\nexport const MAX_CRAFT_SKILL_TAGS = 5;\n\n/** Maximum length for a craft-skill name. */\nexport const MAX_CRAFT_SKILL_NAME_LENGTH = 200;\n\n/** Non-US artisan-interest country/region free-text (input schema + privateData doc). */\nexport const MAX_ARTISAN_LOCATION_LENGTH = 100;\n\n// --- Mention History ---\n\n/** Maximum number of recent mentions kept in the user's mention-history hook. */\nexport const MAX_HISTORY_ITEMS = 10;\n\n// --- Search ---\n\n/** Maximum number of results returned by the search hook. */\nexport const SEARCH_RESULT_LIMIT = 6;\n\n// --- First-visit site tour ---\n\n/**\n * Current first-visit site-tour version. The `updateSiteTourPreference` callable stamps\n * this onto `privateData.siteTour.completedVersion` at completion, and the landing\n * eligibility check suppresses the automatic invitation while a member's\n * `completedVersion` equals it. Bump when the permanent-shell-controls tour changes\n * enough to re-invite every member. See\n * ttt-prod docs/design/landing-backstage-guide-and-first-visit-plan.md §10.\n */\nexport const SITE_TOUR_CURRENT_VERSION = 1;\n"]}
@@ -1,6 +1,6 @@
1
- /** Theme Studio save & share (docs/charter-season/theme-sharing.md). */
1
+ /** Theme Studio save & share (ttt-prod docs/charter-season/theme-sharing.md). */
2
2
  export declare const THEME_SHARING_LIVE = false;
3
- /** Bouquet stage 1 — buy, give, see (docs/charter-season/bouquet-staging.md). */
3
+ /** Bouquet stage 1 — buy, give, see (ttt-prod docs/charter-season/bouquet-staging.md). */
4
4
  export declare const BOUQUET_STAGE_1_LIVE = false;
5
5
  /** Bouquet stage 2 — artisan earnings views. */
6
6
  export declare const BOUQUET_STAGE_2_LIVE = false;
@@ -1 +1 @@
1
- {"version":3,"file":"release-flags.d.ts","sourceRoot":"","sources":["../../src/constants/release-flags.ts"],"names":[],"mappings":"AAYA,wEAAwE;AACxE,eAAO,MAAM,kBAAkB,QAAQ,CAAC;AAExC,iFAAiF;AACjF,eAAO,MAAM,oBAAoB,QAAQ,CAAC;AAE1C,gDAAgD;AAChD,eAAO,MAAM,oBAAoB,QAAQ,CAAC;AAE1C,iDAAiD;AACjD,eAAO,MAAM,oBAAoB,QAAQ,CAAC;AAE1C,8DAA8D;AAC9D,eAAO,MAAM,oBAAoB,QAAQ,CAAC;AAE1C;gFACgF;AAChF,eAAO,MAAM,iBAAiB,QAAQ,CAAC"}
1
+ {"version":3,"file":"release-flags.d.ts","sourceRoot":"","sources":["../../src/constants/release-flags.ts"],"names":[],"mappings":"AAYA,iFAAiF;AACjF,eAAO,MAAM,kBAAkB,QAAQ,CAAC;AAExC,0FAA0F;AAC1F,eAAO,MAAM,oBAAoB,QAAQ,CAAC;AAE1C,gDAAgD;AAChD,eAAO,MAAM,oBAAoB,QAAQ,CAAC;AAE1C,iDAAiD;AACjD,eAAO,MAAM,oBAAoB,QAAQ,CAAC;AAE1C,8DAA8D;AAC9D,eAAO,MAAM,oBAAoB,QAAQ,CAAC;AAE1C;gFACgF;AAChF,eAAO,MAAM,iBAAiB,QAAQ,CAAC"}
@@ -9,9 +9,9 @@
9
9
  // and the public phase page renders live/coming per deliverable from the same
10
10
  // constants — the flags that gate the features ARE the display data source,
11
11
  // so neither surface can drift. See ttt-prod docs/charter-season/README.md.
12
- /** Theme Studio save & share (docs/charter-season/theme-sharing.md). */
12
+ /** Theme Studio save & share (ttt-prod docs/charter-season/theme-sharing.md). */
13
13
  export const THEME_SHARING_LIVE = false;
14
- /** Bouquet stage 1 — buy, give, see (docs/charter-season/bouquet-staging.md). */
14
+ /** Bouquet stage 1 — buy, give, see (ttt-prod docs/charter-season/bouquet-staging.md). */
15
15
  export const BOUQUET_STAGE_1_LIVE = false;
16
16
  /** Bouquet stage 2 — artisan earnings views. */
17
17
  export const BOUQUET_STAGE_2_LIVE = false;
@@ -1 +1 @@
1
- {"version":3,"file":"release-flags.js","sourceRoot":"","sources":["../../src/constants/release-flags.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,wEAAwE;AACxE,6EAA6E;AAC7E,6DAA6D;AAC7D,6EAA6E;AAC7E,gEAAgE;AAChE,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,4EAA4E;AAC5E,4EAA4E;AAE5E,wEAAwE;AACxE,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,CAAC;AAExC,iFAAiF;AACjF,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC;AAE1C,gDAAgD;AAChD,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC;AAE1C,iDAAiD;AACjD,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC;AAE1C,8DAA8D;AAC9D,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC;AAE1C;gFACgF;AAChF,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,CAAC","sourcesContent":["// Charter-season release flags — one boolean per flip deliverable, default\n// false. Flipped ONLY in code: change the constant → publish ttt-core →\n// install (root + functions) → deploy IS the release, exactly like APP_MODE.\n// Never a console toggle. Server-side gating in callables is\n// `flag || caller is admin` so admins can live-test a hidden feature in prod\n// before its release moment; UI hiding alone is never the gate.\n//\n// The admin Ready-for-Launch tab renders a READ-ONLY panel of these values,\n// and the public phase page renders live/coming per deliverable from the same\n// constants — the flags that gate the features ARE the display data source,\n// so neither surface can drift. See ttt-prod docs/charter-season/README.md.\n\n/** Theme Studio save & share (docs/charter-season/theme-sharing.md). */\nexport const THEME_SHARING_LIVE = false;\n\n/** Bouquet stage 1 — buy, give, see (docs/charter-season/bouquet-staging.md). */\nexport const BOUQUET_STAGE_1_LIVE = false;\n\n/** Bouquet stage 2 — artisan earnings views. */\nexport const BOUQUET_STAGE_2_LIVE = false;\n\n/** Bouquet stage 3 — payouts (counsel-gated). */\nexport const BOUQUET_STAGE_3_LIVE = false;\n\n/** Bouquet stage 4 — Garden + Greenhouse display surfaces. */\nexport const BOUQUET_STAGE_4_LIVE = false;\n\n/** Bill the Understudy's flip upgrade (new lines / visual refresh). Display-only\n * flag — nothing server-side to gate; exists so the phase page stays honest. */\nexport const BILL_UPGRADE_LIVE = false;\n"]}
1
+ {"version":3,"file":"release-flags.js","sourceRoot":"","sources":["../../src/constants/release-flags.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,wEAAwE;AACxE,6EAA6E;AAC7E,6DAA6D;AAC7D,6EAA6E;AAC7E,gEAAgE;AAChE,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,4EAA4E;AAC5E,4EAA4E;AAE5E,iFAAiF;AACjF,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,CAAC;AAExC,0FAA0F;AAC1F,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC;AAE1C,gDAAgD;AAChD,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC;AAE1C,iDAAiD;AACjD,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC;AAE1C,8DAA8D;AAC9D,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC;AAE1C;gFACgF;AAChF,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,CAAC","sourcesContent":["// Charter-season release flags — one boolean per flip deliverable, default\n// false. Flipped ONLY in code: change the constant → publish ttt-core →\n// install (root + functions) → deploy IS the release, exactly like APP_MODE.\n// Never a console toggle. Server-side gating in callables is\n// `flag || caller is admin` so admins can live-test a hidden feature in prod\n// before its release moment; UI hiding alone is never the gate.\n//\n// The admin Ready-for-Launch tab renders a READ-ONLY panel of these values,\n// and the public phase page renders live/coming per deliverable from the same\n// constants — the flags that gate the features ARE the display data source,\n// so neither surface can drift. See ttt-prod docs/charter-season/README.md.\n\n/** Theme Studio save & share (ttt-prod docs/charter-season/theme-sharing.md). */\nexport const THEME_SHARING_LIVE = false;\n\n/** Bouquet stage 1 — buy, give, see (ttt-prod docs/charter-season/bouquet-staging.md). */\nexport const BOUQUET_STAGE_1_LIVE = false;\n\n/** Bouquet stage 2 — artisan earnings views. */\nexport const BOUQUET_STAGE_2_LIVE = false;\n\n/** Bouquet stage 3 — payouts (counsel-gated). */\nexport const BOUQUET_STAGE_3_LIVE = false;\n\n/** Bouquet stage 4 — Garden + Greenhouse display surfaces. */\nexport const BOUQUET_STAGE_4_LIVE = false;\n\n/** Bill the Understudy's flip upgrade (new lines / visual refresh). Display-only\n * flag — nothing server-side to gate; exists so the phase page stays honest. */\nexport const BILL_UPGRADE_LIVE = false;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"chat-sync.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/chat-sync.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;iBAW1C,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAIxF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;iBAUlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE,eAAO,MAAM,4BAA4B;;;;;;;;iBAKvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAGlF,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiB9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAGhE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmBlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAGxE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;iBAclC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAKxE,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;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GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAGxE,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;iBAclC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAKxE,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiCvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAgBlF,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAsB5C,CAAC;AACH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAK5F,eAAO,MAAM,2CAA2C;;;;;;;;;;;;;;iBAQtD,CAAC;AACH,MAAM,MAAM,qCAAqC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2CAA2C,CAAC,CAAC"}
@@ -1,6 +1,7 @@
1
1
  // Chat realtime SYNC / projection / command Firestore schemas (chat-edge-rebuild P1).
2
- // Frozen field lists come from IMPLEMENTATION_MATRIX.md "Chat sync / projection /
3
- // commands (Firestore side)". All of these collections are Admin-SDK-only
2
+ // The chat sync / projection / command (Firestore-side) field lists are FROZEN
3
+ // here this file is their single source; the durable design owner is ttt-prod
4
+ // docs/design/chat-realtime-system.md. All of these collections are Admin-SDK-only
4
5
  // (`allow read, write: if false`). Per the TTT timestamp convention every time
5
6
  // field is epoch-ms `number`; the SINGLE exception is the native-TTL `expireAt`,
6
7
  // which is a real Firestore `Timestamp` (modeled as `unknown` so the drift-check
@@ -1 +1 @@
1
- {"version":3,"file":"chat-sync.js","sourceRoot":"","sources":["../../src/doc-schemas/chat-sync.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,kFAAkF;AAClF,0EAA0E;AAC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zC,CAAC,CAAC","sourcesContent":["// Chat realtime SYNC / projection / command Firestore schemas (chat-edge-rebuild P1).\n// Frozen field lists come from IMPLEMENTATION_MATRIX.md \"Chat sync / projection /\n// commands (Firestore side)\". All of these collections are Admin-SDK-only\n// (`allow read, write: if false`). Per the TTT timestamp convention every time\n// field is epoch-ms `number`; the SINGLE exception is the native-TTL `expireAt`,\n// which is a real Firestore `Timestamp` (modeled as `unknown` so the drift-check\n// does not false-flag a Timestamp object against `z.number()`).\n\nimport { z } from 'zod';\n\n/** Native-TTL field — a real Firestore Timestamp (NOT epoch-ms). Absent until the terminal that sets TTL. */\nconst expireAtField = z.unknown().optional();\n\n// ── chatChannelAuthProjections/{authPairKey} ────────────────────────────────\n// Per-(user, channel) authorization FACT. Absent ⇒ removed/deny (fail-closed).\nexport const ChatChannelAuthProjectionSchema = z.object({\n channelRefScope: z.enum(['channel', 'invite']),\n workProjectId: z.string().nullable(),\n guildChatChannelId: z.string().nullable(),\n guildInviteId: z.string().nullable(),\n uid: z.string(),\n channelKey: z.string(),\n channelAuthState: z.enum(['authorized', 'removed']),\n channelAuthVersion: z.number(),\n inputFingerprint: z.string(),\n updatedAt: z.number(),\n});\nexport type ChatChannelAuthProjection = z.infer<typeof ChatChannelAuthProjectionSchema>;\n\n// ── chatScopeDegraded/{scopeKey} (+ causes/{causeId}) ───────────────────────\n// Exists IFF unresolvedCauseCount > 0. Grant mints fail closed while it exists.\nexport const ChatScopeDegradedSchema = z.object({\n scopeKey: z.string(),\n scopeKind: z.enum(['channel', 'memberInWork']),\n // channel scope carries the channelRef tuple; memberInWork carries {uid, workProjectId}.\n workProjectId: z.string().nullable(),\n guildChatChannelId: z.string().nullable(),\n guildInviteId: z.string().nullable(),\n uid: z.string().nullable(),\n unresolvedCauseCount: z.number(),\n updatedAt: z.number(),\n});\nexport type ChatScopeDegraded = z.infer<typeof ChatScopeDegradedSchema>;\n\nexport const ChatScopeDegradedCauseSchema = z.object({\n causeId: z.string(),\n kind: z.enum(['syncEvent', 'fanoutJob']),\n ref: z.string(),\n deadLetteredAt: z.number(),\n});\nexport type ChatScopeDegradedCause = z.infer<typeof ChatScopeDegradedCauseSchema>;\n\n// ── chatSyncEvents/{eventId} ────────────────────────────────────────────────\nexport const ChatSyncEventSchema = z.object({\n eventId: z.string(),\n targetDo: z.string(),\n kind: z.enum(['channelAuth', 'accountAccess', 'config', 'attachmentFlip', 'serverMessage']),\n version: z.number(),\n payload: z.record(z.string(), z.unknown()).nullable(),\n tombstone: z.boolean().optional(),\n payloadHash: z.string(),\n status: z.enum(['pending', 'delivered', 'deadLetter']),\n attemptCount: z.number(),\n nextAttemptAt: z.number(),\n lastError: z.string().nullable(),\n createdAt: z.number(),\n deliveredResult: z.record(z.string(), z.unknown()).nullable(),\n deliveredAt: z.number().nullable(),\n deadLetteredAt: z.number().nullable(),\n expireAt: expireAtField,\n});\nexport type ChatSyncEvent = z.infer<typeof ChatSyncEventSchema>;\n\n// ── chatSyncFanoutJobs/{jobId} ──────────────────────────────────────────────\nexport const ChatSyncFanoutJobSchema = z.object({\n jobId: z.string(),\n selectorKind: z.enum(['channelMembers', 'workChannelsForUser', 'policyEditAffectedUsers']),\n selectorArgs: z.object({\n workProjectId: z.string().optional(),\n channelKey: z.string().optional(),\n uid: z.string().optional(),\n }),\n causeVersion: z.number(),\n cursor: z.object({ pageIndex: z.number(), lastDocId: z.string().nullable() }),\n revision: z.number(),\n status: z.enum(['pending', 'complete', 'deadLetter']),\n attemptCount: z.number(),\n nextAttemptAt: z.number(),\n lastError: z.string().nullable(),\n createdAt: z.number(),\n completedAt: z.number().nullable(),\n deadLetteredAt: z.number().nullable(),\n expireAt: expireAtField,\n});\nexport type ChatSyncFanoutJob = z.infer<typeof ChatSyncFanoutJobSchema>;\n\n// ── chatMessageOutbox/{commandId} ───────────────────────────────────────────\nexport const ChatMessageOutboxSchema = z.object({\n commandId: z.string(),\n kind: z.enum(['userMsg', 'systemMsg', 'attachmentPlaceholder']),\n threadRef: z.string(),\n payload: z.record(z.string(), z.unknown()),\n payloadVersion: z.number(),\n status: z.enum(['pending', 'applied', 'deadLetter']),\n attemptCount: z.number(),\n nextAttemptAt: z.number(),\n lastError: z.string().nullable(),\n createdAt: z.number(),\n appliedAt: z.number().nullable(),\n deadLetteredAt: z.number().nullable(),\n expireAt: expireAtField,\n});\nexport type ChatMessageOutbox = z.infer<typeof ChatMessageOutboxSchema>;\n\n// ── chatAdminActionCommands/{requestId} ─────────────────────────────────────\n// `requestId` IS the doc id + DO dedup key. `delivering` is NOT a lease (it sets\n// nextAttemptAt = now + DELIVERY_TIMEOUT). terminalFailureGeneration default 0.\nexport const ChatAdminActionCommandSchema = z.object({\n requestId: z.string(),\n actorUid: z.string(),\n actorMode: z.enum(['adminReview', 'adminOverride']),\n systemRole: z.enum(['admin', 'jrAdmin']),\n channelRef: z.record(z.string(), z.unknown()),\n messageSeq: z.number(),\n action: z.enum(['hide', 'delete']),\n caseId: z.string(),\n reason: z.string(),\n expectedMessageRevision: z.number(),\n // Ready-attachment media asset id(s) on the moderated message (block FIRST, then\n // DO tombstone — the attachment-redaction saga, round-10 blocker 9). Empty for a\n // text-only message. DERIVED SERVER-SIDE inside the moderation saga from the DO/message\n // context — NEVER client-supplied (the case-bound context read does not expose them).\n attachmentAssetIds: z.array(z.string()).default([]),\n payloadHash: z.string(),\n state: z.enum(['queued', 'delivering', 'applied', 'failed', 'deadLetter']),\n attemptCount: z.number(),\n nextAttemptAt: z.number(),\n lastError: z.string().nullable(),\n result: z.record(z.string(), z.unknown()).nullable(),\n doRevisionId: z.string().nullable(),\n // True once the redaction saga has blocked the attachment asset(s) for this command.\n attachmentBlocked: z.boolean().default(false),\n terminalFailureGeneration: z.number(),\n createdAt: z.number(),\n appliedAt: z.number().nullable(),\n failedAt: z.number().nullable(),\n deadLetteredAt: z.number().nullable(),\n reconciled: z.boolean(),\n reconciledAt: z.number().nullable(),\n expireAt: expireAtField,\n});\nexport type ChatAdminActionCommand = z.infer<typeof ChatAdminActionCommandSchema>;\n\n// ── chatHistoryAnonymizationJobs/{jobId} ────────────────────────────────────\n// Account-deletion history anonymization (Contract F; P8). Resumable + crash-safe:\n// the recorded source-manifest identity (key/hash/generation) + the three cursors\n// (scan/rewrite/delete) make every boundary restartable. jobId =\n// hash('chat-anonymize', channelDoId, epoch, anonymizedUid). `expireAt` (native TTL)\n// is set ONLY when the job reaches `done`.\n//\n// C-B1: the replacement generation is DO-OWNED — the Channel DO (single-threaded per\n// channel) allocates a DISTINCT monotonic generation per erasure off the epoch row and\n// rewrites against the CURRENT live manifest, so two erasures on one epoch chain instead\n// of colliding on a shared `anon-1` keyspace. These four fields are therefore RECORDED AT\n// SCAN (null until the DO reports/allocates them), not pinned at enqueue; if a concurrent\n// anonymization supersedes the source between scan and swap, the job resets to `scanning`\n// to re-derive against the new current manifest (keeping its own allocated generation).\nexport const ChatHistoryAnonymizationJobSchema = z.object({\n jobId: z.string(),\n channelDoId: z.string(),\n epoch: z.number(),\n anonymizedUid: z.string(),\n sourceManifestKey: z.string().nullable(),\n sourceManifestHash: z.string().nullable(),\n sourceGeneration: z.number().nullable(),\n replacementGeneration: z.number().nullable(),\n newManifestKey: z.string().nullable(),\n scanCursor: z.number(),\n rewriteCursor: z.number(),\n deleteCursor: z.number(),\n swappedAt: z.number().nullable(),\n state: z.enum(['scanning', 'rewriting', 'swapping', 'deleting', 'done', 'failed']),\n legalHoldPaused: z.boolean(),\n attemptCount: z.number(),\n nextAttemptAt: z.number(),\n lastError: z.string().nullable(),\n createdAt: z.number(),\n updatedAt: z.number(),\n expireAt: expireAtField,\n});\nexport type ChatHistoryAnonymizationJob = z.infer<typeof ChatHistoryAnonymizationJobSchema>;\n\n// ── chatHistoryAnonymizationJobs/{jobId}/affectedChunks/{chunkOrdinal} ───────\n// The non-contiguous affected-chunk set (round-16 finding 7) — a crash after the\n// manifest swap resumes deletion from these rows + `deleteCursor` without re-listing R2.\nexport const ChatHistoryAnonymizationAffectedChunkSchema = z.object({\n chunkOrdinal: z.number(),\n sourceChunkKey: z.string(),\n sourceSha256: z.string(),\n replacementChunkKey: z.string().nullable(),\n replacementSha256: z.string().nullable(),\n rewriteState: z.enum(['pending', 'done']),\n deleteState: z.enum(['pending', 'done']),\n});\nexport type ChatHistoryAnonymizationAffectedChunk = z.infer<typeof ChatHistoryAnonymizationAffectedChunkSchema>;\n"]}
1
+ {"version":3,"file":"chat-sync.js","sourceRoot":"","sources":["../../src/doc-schemas/chat-sync.ts"],"names":[],"mappings":"AAAA,sFAAsF;AACtF,+EAA+E;AAC/E,gFAAgF;AAChF,mFAAmF;AACnF,+EAA+E;AAC/E,iFAAiF;AACjF,iFAAiF;AACjF,gEAAgE;AAEhE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,6GAA6G;AAC7G,MAAM,aAAa,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC;AAE7C,+EAA+E;AAC/E,+EAA+E;AAC/E,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,MAAM,CAAC;IACtD,eAAe,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IAC9C,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACzC,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;IACf,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,gBAAgB,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;IACnD,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC9B,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC5B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;CACtB,CAAC,C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Ac,EAAE,CAAC,CAAC,MAAM,EAAE;IAC1B,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1C,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACxC,YAAY,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IACzC,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;CACzC,CAAC,CAAC","sourcesContent":["// Chat realtime SYNC / projection / command Firestore schemas (chat-edge-rebuild P1).\n// The chat sync / projection / command (Firestore-side) field lists are FROZEN\n// here — this file is their single source; the durable design owner is ttt-prod\n// docs/design/chat-realtime-system.md. All of these collections are Admin-SDK-only\n// (`allow read, write: if false`). Per the TTT timestamp convention every time\n// field is epoch-ms `number`; the SINGLE exception is the native-TTL `expireAt`,\n// which is a real Firestore `Timestamp` (modeled as `unknown` so the drift-check\n// does not false-flag a Timestamp object against `z.number()`).\n\nimport { z } from 'zod';\n\n/** Native-TTL field — a real Firestore Timestamp (NOT epoch-ms). Absent until the terminal that sets TTL. */\nconst expireAtField = z.unknown().optional();\n\n// ── chatChannelAuthProjections/{authPairKey} ────────────────────────────────\n// Per-(user, channel) authorization FACT. Absent ⇒ removed/deny (fail-closed).\nexport const ChatChannelAuthProjectionSchema = z.object({\n channelRefScope: z.enum(['channel', 'invite']),\n workProjectId: z.string().nullable(),\n guildChatChannelId: z.string().nullable(),\n guildInviteId: z.string().nullable(),\n uid: z.string(),\n channelKey: z.string(),\n channelAuthState: z.enum(['authorized', 'removed']),\n channelAuthVersion: z.number(),\n inputFingerprint: z.string(),\n updatedAt: z.number(),\n});\nexport type ChatChannelAuthProjection = z.infer<typeof ChatChannelAuthProjectionSchema>;\n\n// ── chatScopeDegraded/{scopeKey} (+ causes/{causeId}) ───────────────────────\n// Exists IFF unresolvedCauseCount > 0. Grant mints fail closed while it exists.\nexport const ChatScopeDegradedSchema = z.object({\n scopeKey: z.string(),\n scopeKind: z.enum(['channel', 'memberInWork']),\n // channel scope carries the channelRef tuple; memberInWork carries {uid, workProjectId}.\n workProjectId: z.string().nullable(),\n guildChatChannelId: z.string().nullable(),\n guildInviteId: z.string().nullable(),\n uid: z.string().nullable(),\n unresolvedCauseCount: z.number(),\n updatedAt: z.number(),\n});\nexport type ChatScopeDegraded = z.infer<typeof ChatScopeDegradedSchema>;\n\nexport const ChatScopeDegradedCauseSchema = z.object({\n causeId: z.string(),\n kind: z.enum(['syncEvent', 'fanoutJob']),\n ref: z.string(),\n deadLetteredAt: z.number(),\n});\nexport type ChatScopeDegradedCause = z.infer<typeof ChatScopeDegradedCauseSchema>;\n\n// ── chatSyncEvents/{eventId} ────────────────────────────────────────────────\nexport const ChatSyncEventSchema = z.object({\n eventId: z.string(),\n targetDo: z.string(),\n kind: z.enum(['channelAuth', 'accountAccess', 'config', 'attachmentFlip', 'serverMessage']),\n version: z.number(),\n payload: z.record(z.string(), z.unknown()).nullable(),\n tombstone: z.boolean().optional(),\n payloadHash: z.string(),\n status: z.enum(['pending', 'delivered', 'deadLetter']),\n attemptCount: z.number(),\n nextAttemptAt: z.number(),\n lastError: z.string().nullable(),\n createdAt: z.number(),\n deliveredResult: z.record(z.string(), z.unknown()).nullable(),\n deliveredAt: z.number().nullable(),\n deadLetteredAt: z.number().nullable(),\n expireAt: expireAtField,\n});\nexport type ChatSyncEvent = z.infer<typeof ChatSyncEventSchema>;\n\n// ── chatSyncFanoutJobs/{jobId} ──────────────────────────────────────────────\nexport const ChatSyncFanoutJobSchema = z.object({\n jobId: z.string(),\n selectorKind: z.enum(['channelMembers', 'workChannelsForUser', 'policyEditAffectedUsers']),\n selectorArgs: z.object({\n workProjectId: z.string().optional(),\n channelKey: z.string().optional(),\n uid: z.string().optional(),\n }),\n causeVersion: z.number(),\n cursor: z.object({ pageIndex: z.number(), lastDocId: z.string().nullable() }),\n revision: z.number(),\n status: z.enum(['pending', 'complete', 'deadLetter']),\n attemptCount: z.number(),\n nextAttemptAt: z.number(),\n lastError: z.string().nullable(),\n createdAt: z.number(),\n completedAt: z.number().nullable(),\n deadLetteredAt: z.number().nullable(),\n expireAt: expireAtField,\n});\nexport type ChatSyncFanoutJob = z.infer<typeof ChatSyncFanoutJobSchema>;\n\n// ── chatMessageOutbox/{commandId} ───────────────────────────────────────────\nexport const ChatMessageOutboxSchema = z.object({\n commandId: z.string(),\n kind: z.enum(['userMsg', 'systemMsg', 'attachmentPlaceholder']),\n threadRef: z.string(),\n payload: z.record(z.string(), z.unknown()),\n payloadVersion: z.number(),\n status: z.enum(['pending', 'applied', 'deadLetter']),\n attemptCount: z.number(),\n nextAttemptAt: z.number(),\n lastError: z.string().nullable(),\n createdAt: z.number(),\n appliedAt: z.number().nullable(),\n deadLetteredAt: z.number().nullable(),\n expireAt: expireAtField,\n});\nexport type ChatMessageOutbox = z.infer<typeof ChatMessageOutboxSchema>;\n\n// ── chatAdminActionCommands/{requestId} ─────────────────────────────────────\n// `requestId` IS the doc id + DO dedup key. `delivering` is NOT a lease (it sets\n// nextAttemptAt = now + DELIVERY_TIMEOUT). terminalFailureGeneration default 0.\nexport const ChatAdminActionCommandSchema = z.object({\n requestId: z.string(),\n actorUid: z.string(),\n actorMode: z.enum(['adminReview', 'adminOverride']),\n systemRole: z.enum(['admin', 'jrAdmin']),\n channelRef: z.record(z.string(), z.unknown()),\n messageSeq: z.number(),\n action: z.enum(['hide', 'delete']),\n caseId: z.string(),\n reason: z.string(),\n expectedMessageRevision: z.number(),\n // Ready-attachment media asset id(s) on the moderated message (block FIRST, then\n // DO tombstone — the attachment-redaction saga, round-10 blocker 9). Empty for a\n // text-only message. DERIVED SERVER-SIDE inside the moderation saga from the DO/message\n // context — NEVER client-supplied (the case-bound context read does not expose them).\n attachmentAssetIds: z.array(z.string()).default([]),\n payloadHash: z.string(),\n state: z.enum(['queued', 'delivering', 'applied', 'failed', 'deadLetter']),\n attemptCount: z.number(),\n nextAttemptAt: z.number(),\n lastError: z.string().nullable(),\n result: z.record(z.string(), z.unknown()).nullable(),\n doRevisionId: z.string().nullable(),\n // True once the redaction saga has blocked the attachment asset(s) for this command.\n attachmentBlocked: z.boolean().default(false),\n terminalFailureGeneration: z.number(),\n createdAt: z.number(),\n appliedAt: z.number().nullable(),\n failedAt: z.number().nullable(),\n deadLetteredAt: z.number().nullable(),\n reconciled: z.boolean(),\n reconciledAt: z.number().nullable(),\n expireAt: expireAtField,\n});\nexport type ChatAdminActionCommand = z.infer<typeof ChatAdminActionCommandSchema>;\n\n// ── chatHistoryAnonymizationJobs/{jobId} ────────────────────────────────────\n// Account-deletion history anonymization (Contract F; P8). Resumable + crash-safe:\n// the recorded source-manifest identity (key/hash/generation) + the three cursors\n// (scan/rewrite/delete) make every boundary restartable. jobId =\n// hash('chat-anonymize', channelDoId, epoch, anonymizedUid). `expireAt` (native TTL)\n// is set ONLY when the job reaches `done`.\n//\n// C-B1: the replacement generation is DO-OWNED — the Channel DO (single-threaded per\n// channel) allocates a DISTINCT monotonic generation per erasure off the epoch row and\n// rewrites against the CURRENT live manifest, so two erasures on one epoch chain instead\n// of colliding on a shared `anon-1` keyspace. These four fields are therefore RECORDED AT\n// SCAN (null until the DO reports/allocates them), not pinned at enqueue; if a concurrent\n// anonymization supersedes the source between scan and swap, the job resets to `scanning`\n// to re-derive against the new current manifest (keeping its own allocated generation).\nexport const ChatHistoryAnonymizationJobSchema = z.object({\n jobId: z.string(),\n channelDoId: z.string(),\n epoch: z.number(),\n anonymizedUid: z.string(),\n sourceManifestKey: z.string().nullable(),\n sourceManifestHash: z.string().nullable(),\n sourceGeneration: z.number().nullable(),\n replacementGeneration: z.number().nullable(),\n newManifestKey: z.string().nullable(),\n scanCursor: z.number(),\n rewriteCursor: z.number(),\n deleteCursor: z.number(),\n swappedAt: z.number().nullable(),\n state: z.enum(['scanning', 'rewriting', 'swapping', 'deleting', 'done', 'failed']),\n legalHoldPaused: z.boolean(),\n attemptCount: z.number(),\n nextAttemptAt: z.number(),\n lastError: z.string().nullable(),\n createdAt: z.number(),\n updatedAt: z.number(),\n expireAt: expireAtField,\n});\nexport type ChatHistoryAnonymizationJob = z.infer<typeof ChatHistoryAnonymizationJobSchema>;\n\n// ── chatHistoryAnonymizationJobs/{jobId}/affectedChunks/{chunkOrdinal} ───────\n// The non-contiguous affected-chunk set (round-16 finding 7) — a crash after the\n// manifest swap resumes deletion from these rows + `deleteCursor` without re-listing R2.\nexport const ChatHistoryAnonymizationAffectedChunkSchema = z.object({\n chunkOrdinal: z.number(),\n sourceChunkKey: z.string(),\n sourceSha256: z.string(),\n replacementChunkKey: z.string().nullable(),\n replacementSha256: z.string().nullable(),\n rewriteState: z.enum(['pending', 'done']),\n deleteState: z.enum(['pending', 'done']),\n});\nexport type ChatHistoryAnonymizationAffectedChunk = z.infer<typeof ChatHistoryAnonymizationAffectedChunkSchema>;\n"]}
@@ -3,7 +3,11 @@ export declare const CommissionAttachmentSchema: z.ZodObject<{
3
3
  pendingMediaId: z.ZodOptional<z.ZodString>;
4
4
  name: z.ZodString;
5
5
  mediaAssetId: z.ZodString;
6
- type: z.ZodString;
6
+ type: z.ZodEnum<{
7
+ video: "video";
8
+ image: "image";
9
+ audio: "audio";
10
+ }>;
7
11
  size: z.ZodNumber;
8
12
  }, z.core.$strip>;
9
13
  export type CommissionAttachment = z.infer<typeof CommissionAttachmentSchema>;
@@ -15,7 +19,11 @@ export declare const FullCommissionListingSchema: z.ZodObject<{
15
19
  pendingMediaId: z.ZodOptional<z.ZodString>;
16
20
  name: z.ZodString;
17
21
  mediaAssetId: z.ZodString;
18
- type: z.ZodString;
22
+ type: z.ZodEnum<{
23
+ video: "video";
24
+ image: "image";
25
+ audio: "audio";
26
+ }>;
19
27
  size: z.ZodNumber;
20
28
  }, z.core.$strip>>;
21
29
  requiredTradeProfessions: z.ZodArray<z.ZodString>;
@@ -107,12 +115,9 @@ export declare const AuditionSchema: z.ZodObject<{
107
115
  title: z.ZodString;
108
116
  description: z.ZodString;
109
117
  videoAssetId: z.ZodString;
110
- mediaType: z.ZodOptional<z.ZodEnum<{
118
+ mediaType: z.ZodEnum<{
111
119
  video: "video";
112
- image: "image";
113
- audio: "audio";
114
- other: "other";
115
- }>>;
120
+ }>;
116
121
  openTill: z.ZodNumber;
117
122
  createdOn: z.ZodNumber;
118
123
  createdBy: z.ZodObject<{
@@ -149,11 +154,9 @@ export declare const AuditionEntrySchema: z.ZodObject<{
149
154
  auditionId: z.ZodString;
150
155
  workProjectId: z.ZodOptional<z.ZodString>;
151
156
  videoAssetId: z.ZodString;
152
- mediaType: z.ZodOptional<z.ZodEnum<{
157
+ mediaType: z.ZodEnum<{
153
158
  video: "video";
154
- image: "image";
155
- other: "other";
156
- }>>;
159
+ }>;
157
160
  createdBy: z.ZodObject<{
158
161
  uid: z.ZodString;
159
162
  }, z.core.$strip>;
@@ -1 +1 @@
1
- {"version":3,"file":"commissions.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/commissions.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,eAAO,MAAM,0BAA0B;;;;;;iBAOrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAyBtC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;iBAkBnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAS1E,eAAO,MAAM,wCAAwC;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAMn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C,CAAC;AAS1E,eAAO,MAAM,wCAAwC;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAMnD,CAAC;AACH,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wCAAwC,CAAC,CAAC;AAE1G,eAAO,MAAM,kBAAkB;;;;EAAoE,CAAC;AACpG,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA8CzB,CAAC;AACH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;iBAmB9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,sBAAsB;;;;;;iBAIjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
@@ -3,13 +3,17 @@
3
3
  // auditionVotes doc. Types inferred via z.infer.
4
4
  import { z } from 'zod';
5
5
  import { CommissionProposalStatusSchema } from '../schemas/commissions.js';
6
+ import { ContentMediaKindSchema } from './media-assets.js';
6
7
  const userRefSchema = z.object({ uid: z.string() });
7
8
  export const CommissionAttachmentSchema = z.object({
8
9
  pendingMediaId: z.string().optional(),
9
10
  name: z.string(),
10
11
  mediaAssetId: z.string(),
11
- // Original type is `'image' | 'video' | 'audio' | 'other' | string`, which TS widens to string.
12
- type: z.string(),
12
+ // The stored content kind (image/video/audio). Set once by the upload pipeline
13
+ // (getSimplifiedMediaType) and written by the commissionListingMedia publication adapter
14
+ // as z.enum(['image','video','audio']); derived here from the ONE canonical stored-kind
15
+ // union (ARCH-102), never a widened `string`.
16
+ type: ContentMediaKindSchema,
13
17
  size: z.number(),
14
18
  });
15
19
  export const FullCommissionListingSchema = z.object({
@@ -78,7 +82,11 @@ export const AuditionSchema = z.object({
78
82
  title: z.string(),
79
83
  description: z.string(),
80
84
  videoAssetId: z.string(),
81
- mediaType: z.enum(['video', 'image', 'audio', 'other']).optional(),
85
+ // Auditions are VIDEO ONLY (DJ ruling). Paired with the required videoAssetId (both
86
+ // always present — the MEDIA-101 shape, not a required-asset/optional-kind mismatch),
87
+ // derived from the ONE canonical stored-kind union narrowed to video — never an inline
88
+ // re-declared union (ARCH-102).
89
+ mediaType: ContentMediaKindSchema.extract(['video']),
82
90
  openTill: z.number(),
83
91
  createdOn: z.number(),
84
92
  createdBy: userRefSchema,
@@ -120,7 +128,9 @@ export const AuditionEntrySchema = z.object({
120
128
  auditionId: z.string(),
121
129
  workProjectId: z.string().optional(),
122
130
  videoAssetId: z.string(),
123
- mediaType: z.enum(['video', 'image', 'other']).optional(),
131
+ // Audition entries are VIDEO ONLY (DJ ruling) — same video-only pairing as the audition
132
+ // prompt above; derived from the canonical stored-kind union narrowed to video.
133
+ mediaType: ContentMediaKindSchema.extract(['video']),
124
134
  createdBy: userRefSchema,
125
135
  createdAt: z.number(),
126
136
  votes: z.number(),
@@ -1 +1 @@
1
- {"version":3,"file":"commissions.js","sourceRoot":"","sources":["../../src/doc-schemas/commissions.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,qFAAqF;AACrF,iDAAiD;AAEjD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAE3E,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAEpD,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ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e,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACvC,iFAAiF;IACjF,kDAAkD;IAClD,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE;CACpB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,uBAAuB,EAAE,CAAC,CAAC,MAAM,EAAE;IACnC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,2BAA2B,EAAE,aAAa;CAC3C,CAAC,CAAC","sourcesContent":["// Commission + Audition Firestore document SCHEMAS — commissionListings/{id} and its\n// commissionProposals, auditionBoard/{id} and its auditionEntries, plus the per-user\n// auditionVotes doc. Types inferred via z.infer.\n\nimport { z } from 'zod';\nimport { CommissionProposalStatusSchema } from '../schemas/commissions.js';\n\nconst userRefSchema = z.object({ uid: z.string() });\n\nexport const CommissionAttachmentSchema = z.object({\n pendingMediaId: z.string().optional(),\n name: z.string(),\n mediaAssetId: z.string(),\n // Original type is `'image' | 'video' | 'audio' | 'other' | string`, which TS widens to string.\n type: z.string(),\n size: z.number(),\n});\nexport type CommissionAttachment = z.infer<typeof CommissionAttachmentSchema>;\n\nexport const FullCommissionListingSchema = z.object({\n commissionListingId: z.string(),\n title: z.string(),\n description: z.string(),\n commissionAttachment: CommissionAttachmentSchema.optional(),\n requiredTradeProfessions: z.array(z.string()),\n stakeSharesOffered: z.number(),\n createdAt: z.number(),\n createdBy: userRefSchema,\n // Work reference only — title/description are NOT snapshotted (Display Identity Invariant:\n // resolve at render from publicWorkProjects by id, fallback label if the work is gone).\n // `type` (Tales/Tunes/Television) is an immutable classification, not display text, and IS\n // consumed by a commission-board type filter/index, so it stays — mirroring the\n // GuildInviteConversation `workProject: { workProjectId, type }` precedent.\n workProjectAssociatedWith: z.object({\n workProjectId: z.string(),\n type: z.string(),\n }),\n status: z.enum(['open', 'closed']),\n savedProposalArtisans: z.array(z.string()),\n shortId: z.string().optional(),\n shortUrl: z.string().optional(),\n // Admin moderation hide (reversible). When true the listing is suppressed from\n // the commission board; restored by clearing it.\n hidden: z.boolean(),\n});\nexport type FullCommissionListing = z.infer<typeof FullCommissionListingSchema>;\n\nexport const CommissionProposalSchema = z.object({\n commissionProposalId: z.string(),\n commissionListingId: z.string(),\n workProjectId: z.string(),\n proposalText: z.string(),\n proposalFileAssetId: z.string().optional(),\n proposalFileType: z.string().optional(),\n createdBy: userRefSchema,\n createdOn: z.number(),\n status: CommissionProposalStatusSchema,\n guildInviteId: z.string().optional(),\n invitedOn: z.number().optional(),\n acceptedOn: z.number().optional(),\n rejectedAt: z.number().optional(),\n // [EUAS-006] Admin moderation hide (reversible) — matches the listing/audition/entry pattern. When\n // true the proposal's TEXT is suppressed from the board (tombstoned for ordinary viewers); restored\n // by clearing it. Optional so existing/seeded proposals don't need backfilling pre-launch.\n hidden: z.boolean().optional(),\n});\nexport type CommissionProposal = z.infer<typeof CommissionProposalSchema>;\n\n// Authoritative result of the createCommissionProposalText callable — the created item,\n// exactly as the transaction committed it; the client seeds its proposal caches from this\n// instead of refetching. Declared HERE (not schemas/commissions.ts) because it composes\n// CommissionProposalSchema and this module already imports schemas/commissions.js\n// (CommissionProposalStatusSchema) — the reverse runtime import would be a module cycle.\n// Re-exported on the ./schemas subpath via schemas/index.ts. Non-strict (server → client\n// result posture).\nexport const CreateCommissionProposalTextResultSchema = z.object({\n success: z.literal(true),\n commissionListingId: z.string().min(1),\n commissionProposalId: z.string().min(1),\n /** The proposal doc exactly as committed. */\n proposal: CommissionProposalSchema,\n});\nexport type CreateCommissionProposalTextResult = z.infer<typeof CreateCommissionProposalTextResultSchema>;\n\nexport const AuditionTypeSchema = z.enum(['platformAudition', 'sponsoredAudition', 'workAudition']);\nexport type AuditionType = z.infer<typeof AuditionTypeSchema>;\n\nexport const AuditionSchema = z.object({\n auditionId: z.string(),\n type: AuditionTypeSchema,\n title: z.string(),\n description: z.string(),\n videoAssetId: z.string(),\n mediaType: z.enum(['video', 'image', 'audio', 'other']).optional(),\n openTill: z.number(),\n createdOn: z.number(),\n createdBy: userRefSchema,\n workProjectId: z.string().optional(),\n // Curated vs open. 'open' (default when absent — existing auditions): anyone may post reply\n // entries AND vote. 'curated': the creating work posts the option entries itself (min 2, max 8,\n // each `isCreatorOption: true`) and users may ONLY vote — community reply entries are rejected.\n mode: z.enum(['open', 'curated']).optional(),\n // Curated atomic-reveal state (only meaningful when mode === 'curated'). The prompt + all N option\n // videos upload as ONE fixed batch; the audition stays non-votable + off the public board until the\n // WHOLE batch is live and every video passed moderation:\n // 'assembling' — batch still processing/moderating; not votable, not on the board (status stays\n // 'pendingReview'), only the creator sees a \"preparing…\" state.\n // 'ready' — all N+1 landed and approved; app flips status → 'open' and the audition reveals.\n // 'failed' — any video in the batch was rejected by moderation; the whole audition fails.\n // status stays non-open; only the creator sees it (on the project page) to Edit &\n // resubmit or Discard.\n // 'closed' — a curated audition that was closed (by its creator or an admin) after reveal;\n // terminal, kept for record. Distinct from the pre-reveal assembly states above.\n curatedAssemblyStatus: z.enum(['assembling', 'ready', 'failed', 'closed']).optional(),\n // The fixed number of creator option videos submitted at create-time (2..8). Used to know when the\n // whole batch has landed (all expected entries approved → reveal).\n expectedOptionCount: z.number().int().optional(),\n // Set when curatedAssemblyStatus === 'failed': which video was rejected, for the creator-only\n // failed-audition surface on the project page.\n curatedFailureReason: z.string().optional(),\n sponsoredAuditionAmountUSD: z.number().optional(),\n stakeSharesOffered: z.number().optional(),\n status: z.enum(['open', 'closed', 'pendingReview']),\n auditionEntryCount: z.number().optional(),\n shortId: z.string().optional(),\n shortUrl: z.string().optional(),\n // Admin moderation hide (reversible). When true the audition is suppressed from\n // the audition board; restored by clearing it.\n hidden: z.boolean(),\n});\nexport type Audition = z.infer<typeof AuditionSchema>;\n\nexport const AuditionEntrySchema = z.object({\n auditionEntryId: z.string(),\n auditionId: z.string(),\n workProjectId: z.string().optional(),\n videoAssetId: z.string(),\n mediaType: z.enum(['video', 'image', 'other']).optional(),\n createdBy: userRefSchema,\n createdAt: z.number(),\n votes: z.number(),\n shortId: z.string().optional(),\n shortUrl: z.string().optional(),\n // Curated-mode option: true when this entry is a work-authored voting option on a\n // `mode: 'curated'` audition (posted by the creating work at creation), not a community reply.\n isCreatorOption: z.boolean().optional(),\n // Admin moderation hide (reversible). When true the entry is suppressed from the\n // audition's entry list; restored by clearing it.\n hidden: z.boolean(),\n});\nexport type AuditionEntry = z.infer<typeof AuditionEntrySchema>;\n\nexport const UserAuditionVoteSchema = z.object({\n votedForAuditionEntryId: z.string(),\n votedOn: z.number(),\n auditionEntryArtisanCreator: userRefSchema,\n});\nexport type UserAuditionVote = z.infer<typeof UserAuditionVoteSchema>;\n"]}
1
+ {"version":3,"file":"commissions.js","sourceRoot":"","sources":["../../src/doc-schemas/commissions.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,qFAAqF;AACrF,iDAAiD;AAEjD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,MAAM,aAAa,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AAEpD,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IACjD,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,+EAA+E;IAC/E,yFAAyF;IACzF,wFAAwF;IACxF,8CAA8C;IAC9C,IAAI,EAAE,sBAAsB;IAC5B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;CACjB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,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CAAC,MAAM,EAAE;IACnB,2BAA2B,EAAE,aAAa;CAC3C,CAAC,CAAC","sourcesContent":["// Commission + Audition Firestore document SCHEMAS — commissionListings/{id} and its\n// commissionProposals, auditionBoard/{id} and its auditionEntries, plus the per-user\n// auditionVotes doc. Types inferred via z.infer.\n\nimport { z } from 'zod';\nimport { CommissionProposalStatusSchema } from '../schemas/commissions.js';\nimport { ContentMediaKindSchema } from './media-assets.js';\n\nconst userRefSchema = z.object({ uid: z.string() });\n\nexport const CommissionAttachmentSchema = z.object({\n pendingMediaId: z.string().optional(),\n name: z.string(),\n mediaAssetId: z.string(),\n // The stored content kind (image/video/audio). Set once by the upload pipeline\n // (getSimplifiedMediaType) and written by the commissionListingMedia publication adapter\n // as z.enum(['image','video','audio']); derived here from the ONE canonical stored-kind\n // union (ARCH-102), never a widened `string`.\n type: ContentMediaKindSchema,\n size: z.number(),\n});\nexport type CommissionAttachment = z.infer<typeof CommissionAttachmentSchema>;\n\nexport const FullCommissionListingSchema = z.object({\n commissionListingId: z.string(),\n title: z.string(),\n description: z.string(),\n commissionAttachment: CommissionAttachmentSchema.optional(),\n requiredTradeProfessions: z.array(z.string()),\n stakeSharesOffered: z.number(),\n createdAt: z.number(),\n createdBy: userRefSchema,\n // Work reference only — title/description are NOT snapshotted (Display Identity Invariant:\n // resolve at render from publicWorkProjects by id, fallback label if the work is gone).\n // `type` (Tales/Tunes/Television) is an immutable classification, not display text, and IS\n // consumed by a commission-board type filter/index, so it stays — mirroring the\n // GuildInviteConversation `workProject: { workProjectId, type }` precedent.\n workProjectAssociatedWith: z.object({\n workProjectId: z.string(),\n type: z.string(),\n }),\n status: z.enum(['open', 'closed']),\n savedProposalArtisans: z.array(z.string()),\n shortId: z.string().optional(),\n shortUrl: z.string().optional(),\n // Admin moderation hide (reversible). When true the listing is suppressed from\n // the commission board; restored by clearing it.\n hidden: z.boolean(),\n});\nexport type FullCommissionListing = z.infer<typeof FullCommissionListingSchema>;\n\nexport const CommissionProposalSchema = z.object({\n commissionProposalId: z.string(),\n commissionListingId: z.string(),\n workProjectId: z.string(),\n proposalText: z.string(),\n proposalFileAssetId: z.string().optional(),\n proposalFileType: z.string().optional(),\n createdBy: userRefSchema,\n createdOn: z.number(),\n status: CommissionProposalStatusSchema,\n guildInviteId: z.string().optional(),\n invitedOn: z.number().optional(),\n acceptedOn: z.number().optional(),\n rejectedAt: z.number().optional(),\n // [EUAS-006] Admin moderation hide (reversible) — matches the listing/audition/entry pattern. When\n // true the proposal's TEXT is suppressed from the board (tombstoned for ordinary viewers); restored\n // by clearing it. Optional so existing/seeded proposals don't need backfilling pre-launch.\n hidden: z.boolean().optional(),\n});\nexport type CommissionProposal = z.infer<typeof CommissionProposalSchema>;\n\n// Authoritative result of the createCommissionProposalText callable — the created item,\n// exactly as the transaction committed it; the client seeds its proposal caches from this\n// instead of refetching. Declared HERE (not schemas/commissions.ts) because it composes\n// CommissionProposalSchema and this module already imports schemas/commissions.js\n// (CommissionProposalStatusSchema) — the reverse runtime import would be a module cycle.\n// Re-exported on the ./schemas subpath via schemas/index.ts. Non-strict (server → client\n// result posture).\nexport const CreateCommissionProposalTextResultSchema = z.object({\n success: z.literal(true),\n commissionListingId: z.string().min(1),\n commissionProposalId: z.string().min(1),\n /** The proposal doc exactly as committed. */\n proposal: CommissionProposalSchema,\n});\nexport type CreateCommissionProposalTextResult = z.infer<typeof CreateCommissionProposalTextResultSchema>;\n\nexport const AuditionTypeSchema = z.enum(['platformAudition', 'sponsoredAudition', 'workAudition']);\nexport type AuditionType = z.infer<typeof AuditionTypeSchema>;\n\nexport const AuditionSchema = z.object({\n auditionId: z.string(),\n type: AuditionTypeSchema,\n title: z.string(),\n description: z.string(),\n videoAssetId: z.string(),\n // Auditions are VIDEO ONLY (DJ ruling). Paired with the required videoAssetId (both\n // always present — the MEDIA-101 shape, not a required-asset/optional-kind mismatch),\n // derived from the ONE canonical stored-kind union narrowed to video — never an inline\n // re-declared union (ARCH-102).\n mediaType: ContentMediaKindSchema.extract(['video']),\n openTill: z.number(),\n createdOn: z.number(),\n createdBy: userRefSchema,\n workProjectId: z.string().optional(),\n // Curated vs open. 'open' (default when absent — existing auditions): anyone may post reply\n // entries AND vote. 'curated': the creating work posts the option entries itself (min 2, max 8,\n // each `isCreatorOption: true`) and users may ONLY vote — community reply entries are rejected.\n mode: z.enum(['open', 'curated']).optional(),\n // Curated atomic-reveal state (only meaningful when mode === 'curated'). The prompt + all N option\n // videos upload as ONE fixed batch; the audition stays non-votable + off the public board until the\n // WHOLE batch is live and every video passed moderation:\n // 'assembling' — batch still processing/moderating; not votable, not on the board (status stays\n // 'pendingReview'), only the creator sees a \"preparing…\" state.\n // 'ready' — all N+1 landed and approved; app flips status → 'open' and the audition reveals.\n // 'failed' — any video in the batch was rejected by moderation; the whole audition fails.\n // status stays non-open; only the creator sees it (on the project page) to Edit &\n // resubmit or Discard.\n // 'closed' — a curated audition that was closed (by its creator or an admin) after reveal;\n // terminal, kept for record. Distinct from the pre-reveal assembly states above.\n curatedAssemblyStatus: z.enum(['assembling', 'ready', 'failed', 'closed']).optional(),\n // The fixed number of creator option videos submitted at create-time (2..8). Used to know when the\n // whole batch has landed (all expected entries approved → reveal).\n expectedOptionCount: z.number().int().optional(),\n // Set when curatedAssemblyStatus === 'failed': which video was rejected, for the creator-only\n // failed-audition surface on the project page.\n curatedFailureReason: z.string().optional(),\n sponsoredAuditionAmountUSD: z.number().optional(),\n stakeSharesOffered: z.number().optional(),\n status: z.enum(['open', 'closed', 'pendingReview']),\n auditionEntryCount: z.number().optional(),\n shortId: z.string().optional(),\n shortUrl: z.string().optional(),\n // Admin moderation hide (reversible). When true the audition is suppressed from\n // the audition board; restored by clearing it.\n hidden: z.boolean(),\n});\nexport type Audition = z.infer<typeof AuditionSchema>;\n\nexport const AuditionEntrySchema = z.object({\n auditionEntryId: z.string(),\n auditionId: z.string(),\n workProjectId: z.string().optional(),\n videoAssetId: z.string(),\n // Audition entries are VIDEO ONLY (DJ ruling) — same video-only pairing as the audition\n // prompt above; derived from the canonical stored-kind union narrowed to video.\n mediaType: ContentMediaKindSchema.extract(['video']),\n createdBy: userRefSchema,\n createdAt: z.number(),\n votes: z.number(),\n shortId: z.string().optional(),\n shortUrl: z.string().optional(),\n // Curated-mode option: true when this entry is a work-authored voting option on a\n // `mode: 'curated'` audition (posted by the creating work at creation), not a community reply.\n isCreatorOption: z.boolean().optional(),\n // Admin moderation hide (reversible). When true the entry is suppressed from the\n // audition's entry list; restored by clearing it.\n hidden: z.boolean(),\n});\nexport type AuditionEntry = z.infer<typeof AuditionEntrySchema>;\n\nexport const UserAuditionVoteSchema = z.object({\n votedForAuditionEntryId: z.string(),\n votedOn: z.number(),\n auditionEntryArtisanCreator: userRefSchema,\n});\nexport type UserAuditionVote = z.infer<typeof UserAuditionVoteSchema>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"media-activation-jobs.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/media-activation-jobs.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,8BAA8B;;;;;EAKzC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEtF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAkC1B,CAAC;AACZ,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
1
+ {"version":3,"file":"media-activation-jobs.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/media-activation-jobs.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,8BAA8B;;;;;EAKzC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEtF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAkC1B,CAAC;AACZ,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
@@ -4,8 +4,9 @@
4
4
  // immediately and re-driven by a scheduled recovery worker. Server-only
5
5
  // (`allow read, write: if false`); NO client access.
6
6
  //
7
- // See MEDIA_AUTHORITY_DO_DESIGN.md §9 (job), §10 (three-stage finalize),
8
- // §11 (publication adapters), §17 (reconcile).
7
+ // See ttt-prod docs/design/media-assets-and-protected-serving.md the design owner
8
+ // for this job, the three-stage finalize, the typed publication adapters, and the
9
+ // reconcile pass.
9
10
  //
10
11
  // jobId = hash('media-activation', assetId, authorityVersion) (edge-protocol-core
11
12
  // canonical hash family; collision-safe per the frozen ID rules).
@@ -33,7 +34,7 @@ export const MediaActivationJobSchema = z
33
34
  payloadHash: z.string().min(1),
34
35
  authorityPayload: MediaServingAuthorityRecordSchema,
35
36
  // Typed publication adapter. `publicationArgs` is forward-validated by the
36
- // per-kind adapter registry (§11, built in M2) — NEVER arbitrary Firestore
37
+ // per-kind adapter registry — NEVER arbitrary Firestore
37
38
  // writes; the job carries typed data, not serialized writes.
38
39
  publicationKind: MediaPublicationKindSchema,
39
40
  publicationArgs: z.unknown(),
@@ -1 +1 @@
1
- {"version":3,"file":"media-activation-jobs.js","sourceRoot":"","sources":["../../src/doc-schemas/media-activation-jobs.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,iFAAiF;AACjF,uEAAuE;AACvE,wEAAwE;AACxE,qDAAqD;AACrD,EAAE;AACF,y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AAC,OAAO,EAAE;IAE5B,MAAM,EAAE,8BAA8B;IACtC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE;IAC5C,aAAa,EAAE,wBAAwB;IACvC,SAAS,EAAE,qBAAqB,CAAC,QAAQ,EAAE;IAE3C,SAAS,EAAE,wBAAwB;IACnC,kBAAkB,EAAE,wBAAwB,CAAC,QAAQ,EAAE;IACvD,WAAW,EAAE,wBAAwB,CAAC,QAAQ,EAAE;IAChD,cAAc,EAAE,wBAAwB,CAAC,QAAQ,EAAE;IACnD,4EAA4E;IAC5E,0DAA0D;IAC1D,QAAQ,EAAE,wBAAwB,CAAC,QAAQ,EAAE;CAC9C,CAAC;KACD,MAAM,EAAE,CAAC","sourcesContent":["// mediaActivationJobs/{jobId} — the durable job that drives the three-stage\n// finalize (prepare → activate → publish) and its crash recovery. Created in the\n// SAME private prepare transaction as mediaAssets/{assetId}; attempted\n// immediately and re-driven by a scheduled recovery worker. Server-only\n// (`allow read, write: if false`); NO client access.\n//\n// See MEDIA_AUTHORITY_DO_DESIGN.md §9 (job), §10 (three-stage finalize),\n// §11 (publication adapters), §17 (reconcile).\n//\n// jobId = hash('media-activation', assetId, authorityVersion) (edge-protocol-core\n// canonical hash family; collision-safe per the frozen ID rules).\n\nimport { z } from 'zod';\nimport { StructuredErrorSchema } from '@ttt-productions/edge-protocol-core';\nimport { FileOriginSchema } from '../media/file-origin.js';\nimport { FirestoreTimestampSchema } from './firestore-primitives.js';\nimport {\n MediaPublicationKindSchema,\n MediaServingAuthorityRecordSchema,\n} from './media-assets.js';\n\nexport const MediaActivationJobStatusSchema = z.enum([\n 'pending', // call the signed activation endpoint, verify the ack, CAS → authorityApplied\n 'authorityApplied', // call the typed publication adapter, on success CAS → complete\n 'complete', // owner published; TTL eligible\n 'deadLetter', // retries exhausted — retained for operator replay; user sees publication-failed\n]);\nexport type MediaActivationJobStatus = z.infer<typeof MediaActivationJobStatusSchema>;\n\nexport const MediaActivationJobSchema = z\n .object({\n jobId: z.string().min(1),\n schemaVersion: z.number().int().positive(),\n\n assetId: z.string().min(1),\n pendingMediaId: z.string().min(1),\n fileOrigin: FileOriginSchema,\n\n // The exact serving record this job activates — the DO must ack this exact\n // version + payloadHash before publication may proceed.\n authorityVersion: z.number().int().nonnegative(),\n payloadHash: z.string().min(1),\n authorityPayload: MediaServingAuthorityRecordSchema,\n\n // Typed publication adapter. `publicationArgs` is forward-validated by the\n // per-kind adapter registry (§11, built in M2) — NEVER arbitrary Firestore\n // writes; the job carries typed data, not serialized writes.\n publicationKind: MediaPublicationKindSchema,\n publicationArgs: z.unknown(),\n\n status: MediaActivationJobStatusSchema,\n attemptCount: z.number().int().nonnegative(),\n nextAttemptAt: FirestoreTimestampSchema,\n lastError: StructuredErrorSchema.optional(),\n\n createdAt: FirestoreTimestampSchema,\n authorityAppliedAt: FirestoreTimestampSchema.optional(),\n completedAt: FirestoreTimestampSchema.optional(),\n deadLetteredAt: FirestoreTimestampSchema.optional(),\n // TTL set ONLY at `complete`; NEVER on pending/authorityApplied/deadLetter.\n // Replay clears terminal/TTL fields (frozen matrix rule).\n expireAt: FirestoreTimestampSchema.optional(),\n })\n .strict();\nexport type MediaActivationJob = z.infer<typeof MediaActivationJobSchema>;\n"]}
1
+ {"version":3,"file":"media-activation-jobs.js","sourceRoot":"","sources":["../../src/doc-schemas/media-activation-jobs.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,iFAAiF;AACjF,uEAAuE;AACvE,wEAAwE;AACxE,qDAAqD;AACrD,EAAE;AACF,oFAAoF;AACpF,kFAAkF;AAClF,kBAAkB;AAClB,EAAE;AACF,mFAAmF;AACnF,kEAAkE;AAElE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,wB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AE,wBAAwB,CAAC,QAAQ,EAAE;IACvD,WAAW,EAAE,wBAAwB,CAAC,QAAQ,EAAE;IAChD,cAAc,EAAE,wBAAwB,CAAC,QAAQ,EAAE;IACnD,4EAA4E;IAC5E,0DAA0D;IAC1D,QAAQ,EAAE,wBAAwB,CAAC,QAAQ,EAAE;CAC9C,CAAC;KACD,MAAM,EAAE,CAAC","sourcesContent":["// mediaActivationJobs/{jobId} — the durable job that drives the three-stage\n// finalize (prepare → activate → publish) and its crash recovery. Created in the\n// SAME private prepare transaction as mediaAssets/{assetId}; attempted\n// immediately and re-driven by a scheduled recovery worker. Server-only\n// (`allow read, write: if false`); NO client access.\n//\n// See ttt-prod docs/design/media-assets-and-protected-serving.md the design owner\n// for this job, the three-stage finalize, the typed publication adapters, and the\n// reconcile pass.\n//\n// jobId = hash('media-activation', assetId, authorityVersion) (edge-protocol-core\n// canonical hash family; collision-safe per the frozen ID rules).\n\nimport { z } from 'zod';\nimport { StructuredErrorSchema } from '@ttt-productions/edge-protocol-core';\nimport { FileOriginSchema } from '../media/file-origin.js';\nimport { FirestoreTimestampSchema } from './firestore-primitives.js';\nimport {\n MediaPublicationKindSchema,\n MediaServingAuthorityRecordSchema,\n} from './media-assets.js';\n\nexport const MediaActivationJobStatusSchema = z.enum([\n 'pending', // call the signed activation endpoint, verify the ack, CAS → authorityApplied\n 'authorityApplied', // call the typed publication adapter, on success CAS → complete\n 'complete', // owner published; TTL eligible\n 'deadLetter', // retries exhausted — retained for operator replay; user sees publication-failed\n]);\nexport type MediaActivationJobStatus = z.infer<typeof MediaActivationJobStatusSchema>;\n\nexport const MediaActivationJobSchema = z\n .object({\n jobId: z.string().min(1),\n schemaVersion: z.number().int().positive(),\n\n assetId: z.string().min(1),\n pendingMediaId: z.string().min(1),\n fileOrigin: FileOriginSchema,\n\n // The exact serving record this job activates — the DO must ack this exact\n // version + payloadHash before publication may proceed.\n authorityVersion: z.number().int().nonnegative(),\n payloadHash: z.string().min(1),\n authorityPayload: MediaServingAuthorityRecordSchema,\n\n // Typed publication adapter. `publicationArgs` is forward-validated by the\n // per-kind adapter registry — NEVER arbitrary Firestore\n // writes; the job carries typed data, not serialized writes.\n publicationKind: MediaPublicationKindSchema,\n publicationArgs: z.unknown(),\n\n status: MediaActivationJobStatusSchema,\n attemptCount: z.number().int().nonnegative(),\n nextAttemptAt: FirestoreTimestampSchema,\n lastError: StructuredErrorSchema.optional(),\n\n createdAt: FirestoreTimestampSchema,\n authorityAppliedAt: FirestoreTimestampSchema.optional(),\n completedAt: FirestoreTimestampSchema.optional(),\n deadLetteredAt: FirestoreTimestampSchema.optional(),\n // TTL set ONLY at `complete`; NEVER on pending/authorityApplied/deadLetter.\n // Replay clears terminal/TTL fields (frozen matrix rule).\n expireAt: FirestoreTimestampSchema.optional(),\n })\n .strict();\nexport type MediaActivationJob = z.infer<typeof MediaActivationJobSchema>;\n"]}
@@ -220,7 +220,7 @@ export declare const MediaServingScopeSchema: z.ZodDiscriminatedUnion<[z.ZodObje
220
220
  }, z.core.$strict>], "kind">;
221
221
  export type MediaServingScope = z.infer<typeof MediaServingScopeSchema>;
222
222
  /**
223
- * The typed owner adapter a publication goes through (§11). The activation job
223
+ * The typed owner adapter a publication goes through. The activation job
224
224
  * carries this kind; a server-side registry validates per-kind `publicationArgs`
225
225
  * and performs the idempotent owner write. Chat is the non-Firestore-owner
226
226
  * adapter (publishes via its durable attachmentFlip ack, not an owner txn).
@@ -241,7 +241,7 @@ export declare const MediaPublicationKindSchema: z.ZodEnum<{
241
241
  }>;
242
242
  export type MediaPublicationKind = z.infer<typeof MediaPublicationKindSchema>;
243
243
  /**
244
- * The normalized serving record (§7) — the SAME contract used to generate both
244
+ * The normalized serving record — the SAME contract used to generate both
245
245
  * the DO authority row and the KV cache payload (one function, so they can't
246
246
  * drift). The R2 object key stays deterministic (`mediaAssets/{assetId}/{key}`)
247
247
  * and is NOT persisted here. `payloadHash` is computed over the canonical
@@ -1 +1 @@
1
- {"version":3,"file":"media-assets.d.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H,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;EAkBrC,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E;;;;;;GAMG;AACH,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAiBnC,CAAC;AACZ,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAE5F,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAyDlB,CAAC;AACZ,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
@@ -113,7 +113,8 @@ export const MediaRetentionPolicySchema = z.enum([
113
113
  // media path (`servingStatus: 'hidden'`), so the gallery filters on servingStatus.
114
114
  export const RealmFileCanonStatusSchema = z.enum(['none', 'nonCanon', 'canon']);
115
115
  // ===== Serving authority (Durable Object) + publication gating =====
116
- // See MEDIA_AUTHORITY_DO_DESIGN.md §6–§9/§13 and media-assets-and-protected-serving.md.
116
+ // See ttt-prod docs/design/media-assets-and-protected-serving.md (the design owner
117
+ // for the Durable Object serving authority and publication gating).
117
118
  /** Whether the canonical serving record has been applied to the DO authority. */
118
119
  export const MediaAuthoritySyncStateSchema = z.enum(['pending', 'applied', 'deadLetter']);
119
120
  /** Whether the asset is referenced by a visible owner doc. Orthogonal to the
@@ -168,7 +169,7 @@ export const MediaServingScopeSchema = z.discriminatedUnion('kind', [
168
169
  }).strict(),
169
170
  ]);
170
171
  /**
171
- * The typed owner adapter a publication goes through (§11). The activation job
172
+ * The typed owner adapter a publication goes through. The activation job
172
173
  * carries this kind; a server-side registry validates per-kind `publicationArgs`
173
174
  * and performs the idempotent owner write. Chat is the non-Firestore-owner
174
175
  * adapter (publishes via its durable attachmentFlip ack, not an owner txn).
@@ -193,7 +194,7 @@ export const MediaPublicationKindSchema = z.enum([
193
194
  'adminSupportAttachment',
194
195
  ]);
195
196
  /**
196
- * The normalized serving record (§7) — the SAME contract used to generate both
197
+ * The normalized serving record — the SAME contract used to generate both
197
198
  * the DO authority row and the KV cache payload (one function, so they can't
198
199
  * drift). The R2 object key stays deterministic (`mediaAssets/{assetId}/{key}`)
199
200
  * and is NOT persisted here. `payloadHash` is computed over the canonical
@@ -243,7 +244,7 @@ export const MediaAssetSchema = z.object({
243
244
  // creation to 'none' and moved by the realm shared-files callables. Attribution
244
245
  // fields (who set canon, when) are added by that feature when it ships.
245
246
  realmFileCanonStatus: RealmFileCanonStatusSchema,
246
- // Serving authority + publication gating (§13). Additive/optional so assets
247
+ // Serving authority + publication gating. Additive/optional so assets
247
248
  // written before the authority build still parse: absent authorityVersion ⇒
248
249
  // 0/never-applied, absent publicationState ⇒ 'unpublished'. Every
249
250
  // serving-record mutation increments authorityVersion in an authoritative txn.