@ttt-productions/ttt-core 0.78.26 → 0.79.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/capabilities/capability-registry.d.ts +2 -2
- package/dist/capabilities/capability-registry.d.ts.map +1 -1
- package/dist/capabilities/capability-registry.js +5 -5
- package/dist/capabilities/capability-registry.js.map +1 -1
- package/dist/capabilities/messaging-surfaces.d.ts.map +1 -1
- package/dist/capabilities/messaging-surfaces.js +7 -3
- package/dist/capabilities/messaging-surfaces.js.map +1 -1
- package/dist/constants/app-mode.d.ts +9 -0
- package/dist/constants/app-mode.d.ts.map +1 -1
- package/dist/constants/app-mode.js +17 -0
- package/dist/constants/app-mode.js.map +1 -1
- package/dist/constants/business-content.d.ts +0 -2
- package/dist/constants/business-content.d.ts.map +1 -1
- package/dist/constants/business-content.js +0 -2
- package/dist/constants/business-content.js.map +1 -1
- package/dist/constants/conversation-files.d.ts +7 -0
- package/dist/constants/conversation-files.d.ts.map +1 -0
- package/dist/constants/conversation-files.js +14 -0
- package/dist/constants/conversation-files.js.map +1 -0
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/index.js +1 -0
- package/dist/constants/index.js.map +1 -1
- package/dist/doc-schemas/chat-sync.d.ts +0 -4
- package/dist/doc-schemas/chat-sync.d.ts.map +1 -1
- package/dist/doc-schemas/chat-sync.js +2 -9
- package/dist/doc-schemas/chat-sync.js.map +1 -1
- package/dist/doc-schemas/commissions.d.ts +2 -2
- package/dist/doc-schemas/media-activation-jobs.d.ts +3 -8
- package/dist/doc-schemas/media-activation-jobs.d.ts.map +1 -1
- package/dist/doc-schemas/media-assets.d.ts +22 -34
- package/dist/doc-schemas/media-assets.d.ts.map +1 -1
- package/dist/doc-schemas/media-assets.js +24 -21
- package/dist/doc-schemas/media-assets.js.map +1 -1
- package/dist/doc-schemas/messaging.d.ts +41 -19
- package/dist/doc-schemas/messaging.d.ts.map +1 -1
- package/dist/doc-schemas/messaging.js +64 -4
- package/dist/doc-schemas/messaging.js.map +1 -1
- package/dist/doc-schemas/moderation.d.ts +1 -1
- package/dist/doc-schemas/ncii/allegations.d.ts +21 -9
- package/dist/doc-schemas/ncii/allegations.d.ts.map +1 -1
- package/dist/doc-schemas/ncii/cases.d.ts +10 -4
- package/dist/doc-schemas/ncii/cases.d.ts.map +1 -1
- package/dist/doc-schemas/ncii/holds.d.ts +10 -4
- package/dist/doc-schemas/ncii/holds.d.ts.map +1 -1
- package/dist/doc-schemas/ncii/removal.d.ts +13 -7
- package/dist/doc-schemas/ncii/removal.d.ts.map +1 -1
- package/dist/doc-schemas/ncii/requests.d.ts +11 -5
- package/dist/doc-schemas/ncii/requests.d.ts.map +1 -1
- package/dist/doc-schemas/registry.d.ts +148 -119
- package/dist/doc-schemas/registry.d.ts.map +1 -1
- package/dist/doc-schemas/registry.js +5 -1
- package/dist/doc-schemas/registry.js.map +1 -1
- package/dist/doc-schemas/safety/case.d.ts +10 -4
- package/dist/doc-schemas/safety/case.d.ts.map +1 -1
- package/dist/doc-schemas/safety/case.js +4 -3
- package/dist/doc-schemas/safety/case.js.map +1 -1
- package/dist/doc-schemas/safety/evidence.d.ts +2 -3
- package/dist/doc-schemas/safety/evidence.d.ts.map +1 -1
- package/dist/doc-schemas/safety/foundation.d.ts +15 -8
- package/dist/doc-schemas/safety/foundation.d.ts.map +1 -1
- package/dist/doc-schemas/safety/foundation.js +32 -6
- package/dist/doc-schemas/safety/foundation.js.map +1 -1
- package/dist/doc-schemas/safety/holds.d.ts +1 -1
- package/dist/doc-schemas/safety/report.d.ts +25 -10
- package/dist/doc-schemas/safety/report.d.ts.map +1 -1
- package/dist/doc-schemas/safety/report.js +2 -1
- package/dist/doc-schemas/safety/report.js.map +1 -1
- package/dist/ids/chat-ids.d.ts +1 -2
- package/dist/ids/chat-ids.d.ts.map +1 -1
- package/dist/ids/chat-ids.js +1 -4
- package/dist/ids/chat-ids.js.map +1 -1
- package/dist/media/conversation-file-ref.d.ts +13 -0
- package/dist/media/conversation-file-ref.d.ts.map +1 -0
- package/dist/media/conversation-file-ref.js +37 -0
- package/dist/media/conversation-file-ref.js.map +1 -0
- package/dist/media/domain-events-admin.d.ts +1 -1
- package/dist/media/domain-events-social.d.ts +0 -7
- package/dist/media/domain-events-social.d.ts.map +1 -1
- package/dist/media/domain-events-social.js +2 -13
- package/dist/media/domain-events-social.js.map +1 -1
- package/dist/media/domain-events.d.ts +1 -7
- package/dist/media/domain-events.d.ts.map +1 -1
- package/dist/media/domain-events.js +1 -2
- package/dist/media/domain-events.js.map +1 -1
- package/dist/media/edge-serving-contract.d.ts +6 -11
- package/dist/media/edge-serving-contract.d.ts.map +1 -1
- package/dist/media/edge-serving-contract.js.map +1 -1
- package/dist/media/file-origin.d.ts +1 -1
- package/dist/media/file-origin.d.ts.map +1 -1
- package/dist/media/file-origin.js +6 -1
- package/dist/media/file-origin.js.map +1 -1
- package/dist/media/index.d.ts +1 -0
- package/dist/media/index.d.ts.map +1 -1
- package/dist/media/index.js +1 -0
- package/dist/media/index.js.map +1 -1
- package/dist/media/pending-media.d.ts +25 -79
- package/dist/media/pending-media.d.ts.map +1 -1
- package/dist/media/photodna-coverage.js +1 -1
- package/dist/media/photodna-coverage.js.map +1 -1
- package/dist/media/start-upload.d.ts +1 -1
- package/dist/media/target-info.d.ts +6 -26
- package/dist/media/target-info.d.ts.map +1 -1
- package/dist/media/target-info.js +9 -35
- package/dist/media/target-info.js.map +1 -1
- package/dist/media/ttt-media-specs.d.ts.map +1 -1
- package/dist/media/ttt-media-specs.js +8 -5
- package/dist/media/ttt-media-specs.js.map +1 -1
- package/dist/media/upload-tray-display.js +1 -1
- package/dist/media/upload-tray-display.js.map +1 -1
- package/dist/paths/collection-refs.d.ts +2 -0
- package/dist/paths/collection-refs.d.ts.map +1 -1
- package/dist/paths/collection-refs.js +4 -0
- package/dist/paths/collection-refs.js.map +1 -1
- package/dist/paths/collections.d.ts +1 -0
- package/dist/paths/collections.d.ts.map +1 -1
- package/dist/paths/collections.js +7 -0
- package/dist/paths/collections.js.map +1 -1
- package/dist/paths/path-builders.d.ts +2 -0
- package/dist/paths/path-builders.d.ts.map +1 -1
- package/dist/paths/path-builders.js +5 -0
- package/dist/paths/path-builders.js.map +1 -1
- package/dist/report/report-config-values.d.ts +3 -1
- package/dist/report/report-config-values.d.ts.map +1 -1
- package/dist/report/report-config-values.js +5 -1
- package/dist/report/report-config-values.js.map +1 -1
- package/dist/safety/ncii-intake-derivations.d.ts.map +1 -1
- package/dist/safety/ncii-intake-derivations.js +17 -5
- package/dist/safety/ncii-intake-derivations.js.map +1 -1
- package/dist/schemas/admin.d.ts +3 -0
- package/dist/schemas/admin.d.ts.map +1 -1
- package/dist/schemas/admin.js +5 -0
- package/dist/schemas/admin.js.map +1 -1
- package/dist/schemas/chat.js +3 -3
- package/dist/schemas/chat.js.map +1 -1
- package/dist/schemas/commissions.d.ts +1 -1
- package/dist/schemas/media.d.ts +0 -4
- package/dist/schemas/media.d.ts.map +1 -1
- package/dist/schemas/media.js +5 -10
- package/dist/schemas/media.js.map +1 -1
- package/dist/schemas/ncii.d.ts +3 -0
- package/dist/schemas/ncii.d.ts.map +1 -1
- package/dist/schemas/notification.d.ts +1 -0
- package/dist/schemas/notification.d.ts.map +1 -1
- package/dist/types/audit.d.ts +1 -1
- package/dist/types/audit.d.ts.map +1 -1
- package/dist/types/audit.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"foundation.d.ts","sourceRoot":"","sources":["../../../src/doc-schemas/safety/foundation.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"foundation.d.ts","sourceRoot":"","sources":["../../../src/doc-schemas/safety/foundation.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB;gFACgF;AAChF,eAAO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A+E;AAC/E,eAAO,MAAM,2BAA2B;;;;EAItC,CAAC;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAEhF;;;;;;;;0CAQ0C;AAC1C,eAAO,MAAM,wBAAwB;;;;;;;;EAQnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,0DAA0D;AAC1D,eAAO,MAAM,+BAA+B;;;;;EAK1C,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAOxF,eAAO,MAAM,yBAAyB;;;;;EAAkE,CAAC;AACzG,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E,eAAO,MAAM,wBAAwB;;;;;EAKnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;kBAMhC,CAAC;AACZ,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEtF;;;;;0CAK0C;AAC1C,eAAO,MAAM,8BAA8B;;;;EAAwC,CAAC;AACpF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC"}
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
// doc-schemas` subpath.
|
|
17
17
|
import { z } from 'zod';
|
|
18
18
|
import { MAX_SAFETY_RESOLUTION_SUMMARY_LENGTH, MAX_SAFETY_ADMIN_NOTE_LENGTH, } from '../../constants/business.js';
|
|
19
|
+
import { ConversationFileRefSchema } from '../../media/conversation-file-ref.js';
|
|
19
20
|
// ===========================================================================
|
|
20
21
|
// A1 — Report reasons + reportable item types
|
|
21
22
|
// ===========================================================================
|
|
@@ -60,6 +61,12 @@ export const ReportableItemTypeSchema = z.enum([
|
|
|
60
61
|
// server-side; user↔admin support threads are NOT reportable (an admin is already a
|
|
61
62
|
// participant in every thread — DJ ruling 2026-07-13).
|
|
62
63
|
'admin-work-message',
|
|
64
|
+
// A single file in a conversation's flat Conversation Files list (guild-invite or
|
|
65
|
+
// admin-support scope). Replaces reporting a chat-message attachment: files are no
|
|
66
|
+
// longer carried by a message, so the report targets the FILE, whose `conversationFile`
|
|
67
|
+
// TargetLocatorV1 carries the conversation ref + file id + mediaAssetId. Guild CHANNELS
|
|
68
|
+
// have no Conversation Files, so no channel-scoped variant exists.
|
|
69
|
+
'conversation-file',
|
|
63
70
|
'hall-library-item',
|
|
64
71
|
// [EUAS-017] a single Hall sub-item (a Tale chapter / Tune track / Television episode). The
|
|
65
72
|
// `hallItem` TargetLocatorV1 already carries an optional `subItemId`; the report UI passes the
|
|
@@ -96,6 +103,10 @@ export const CONTENT_ACTION_PANEL_ITEM_TYPES = [
|
|
|
96
103
|
'craft-skill',
|
|
97
104
|
// Work-party admin correspondence message — single-doc hidden flip (2026-07-13).
|
|
98
105
|
'admin-work-message',
|
|
106
|
+
// Conversation File — the media-backed file record, actioned exactly like `work-asset`
|
|
107
|
+
// (the other shared-file surface): the action targets the file + its mediaAsset, never
|
|
108
|
+
// a chat message.
|
|
109
|
+
'conversation-file',
|
|
99
110
|
];
|
|
100
111
|
// ===========================================================================
|
|
101
112
|
// A11 — Target locator (the ONE typed locator used by allegations, temp holds,
|
|
@@ -118,10 +129,22 @@ export const TargetLocatorV1Schema = z.discriminatedUnion('kind', [
|
|
|
118
129
|
z.object({ kind: z.literal('audition'), auditionId: z.string().min(1) }).strict(),
|
|
119
130
|
z.object({ kind: z.literal('auditionEntry'), auditionId: z.string().min(1), auditionEntryId: z.string().min(1) }).strict(),
|
|
120
131
|
z.object({ kind: z.literal('guildInviteMessage'), channelId: z.string().min(1), messageId: z.string().min(1) }).strict(),
|
|
121
|
-
|
|
122
|
-
//
|
|
123
|
-
//
|
|
124
|
-
//
|
|
132
|
+
// A file in a conversation's flat Conversation Files list. Replaces the removed
|
|
133
|
+
// `chatAttachment` locator: a file is no longer embedded in, sequenced with, or
|
|
134
|
+
// mutated through a chat message, so it is located by its CONVERSATION + file id,
|
|
135
|
+
// never by a channel/message coordinate. `conversation` is the canonical
|
|
136
|
+
// `ConversationFileRef` (exactly two scopes — guildInvite / adminSupport), so a
|
|
137
|
+
// guild CHANNEL conversation file is structurally inexpressible here: guild
|
|
138
|
+
// channels have no Conversation Files. `mediaAssetId` is carried so the removal
|
|
139
|
+
// saga can hold/retire the bytes without a second resolve.
|
|
140
|
+
z.object({
|
|
141
|
+
kind: z.literal('conversationFile'),
|
|
142
|
+
conversation: ConversationFileRefSchema,
|
|
143
|
+
conversationFileId: z.string().min(1),
|
|
144
|
+
mediaAssetId: z.string().min(1),
|
|
145
|
+
}).strict(),
|
|
146
|
+
// [H-04 V1] Plain guild chat message (text-only or Worker-unresolved). Chat is
|
|
147
|
+
// text-only, so this is the ONLY guild-channel message locator.
|
|
125
148
|
z.object({ kind: z.literal('guildChatMessage'), channelId: z.string().min(1), messageId: z.string().min(1) }).strict(),
|
|
126
149
|
// A work-party admin correspondence message — a Firestore doc at
|
|
127
150
|
// pendingAdminDispatches/{adminDispatchId}/conversationMessages/{messageId} (unlike the
|
|
@@ -147,7 +170,8 @@ export const TargetLocatorKindSchema = z.enum([
|
|
|
147
170
|
'audition',
|
|
148
171
|
'auditionEntry',
|
|
149
172
|
'guildInviteMessage',
|
|
150
|
-
|
|
173
|
+
// A Conversation File (guild-invite / admin-support scope) — replaced `chatAttachment`.
|
|
174
|
+
'conversationFile',
|
|
151
175
|
// [H-04 V1] Plain guild chat message locator (text-only / Worker-unresolved protected report).
|
|
152
176
|
'guildChatMessage',
|
|
153
177
|
// Work-party admin correspondence message (Firestore conversationMessages doc).
|
|
@@ -419,7 +443,9 @@ export const NciiTargetSurfaceSchema = z.enum([
|
|
|
419
443
|
'original',
|
|
420
444
|
'hallCopy',
|
|
421
445
|
'profileMedia',
|
|
422
|
-
'chatAttachment
|
|
446
|
+
// A conversation's Conversation File copy — replaced the removed `chatAttachment`
|
|
447
|
+
// surface (chat messages no longer carry media).
|
|
448
|
+
'conversationFile',
|
|
423
449
|
'variant',
|
|
424
450
|
'cacheServing',
|
|
425
451
|
'exactHashMatch',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"foundation.js","sourceRoot":"","sources":["../../../src/doc-schemas/safety/foundation.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,EAAE;AACF,8EAA8E;AAC9E,0EAA0E;AAC1E,2EAA2E;AAC3E,4EAA4E;AAC5E,0EAA0E;AAC1E,gFAAgF;AAChF,2DAA2D;AAC3D,uDAAuD;AACvD,kEAAkE;AAClE,EAAE;AACF,6EAA6E;AAC7E,yEAAyE;AACzE,4EAA4E;AAC5E,wBAAwB;AAExB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,oCAAoC,EACpC,4BAA4B,GAC7B,MAAM,6BAA6B,CAAC;AAErC,8EAA8E;AAC9E,8CAA8C;AAC9C,8EAA8E;AAE9E;gFACgF;AAChF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,IAAI,CAAC;IACvC,MAAM;IACN,YAAY;IACZ,aAAa;IACb,qBAAqB;IACrB,gBAAgB;IAChB,WAAW;IACX,eAAe;IACf,uBAAuB;IACvB,sBAAsB,EAAE,oCAAoC;IAC5D,qCAAqC,EAAE,6BAA6B;IACpE,sCAAsC;IACtC,OAAO;CACR,CAAC,CAAC;AAGH,2EAA2E;AAC3E,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,sBAAsB;IACtB,qCAAqC;CACK,CAAC;AAE7C,gEAAgE;AAChE,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAA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AC9E,uEAAuE;AACvE,6EAA6E;AAC7E,8EAA8E;AAE9E,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,gBAAgB,CAAC,CAAC,CAAC;AAGzG,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,IAAI,CAAC;IAC7C,aAAa;IACb,aAAa;IACb,mBAAmB;IACnB,oBAAoB;CACrB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,MAAM,CAAC;IACrD,eAAe,EAAE,yBAAyB;IAC1C,cAAc,EAAE,wBAAwB;IACxC,iBAAiB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC/C,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC3C,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAC,MAAM,EAAE,CAAC;AAGZ;;;;;0CAK0C;AAC1C,MAAM,CAAC,MAAM,8BAA8B,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC","sourcesContent":["// Trust & Safety — shared foundation enums + the canonical target locator.\n//\n// This file is the SINGLE SOURCE for every enum and locator that crosses more\n// than one T&S cluster (report spine, case spine, holds, evidence, sagas,\n// NCMEC, NCII). Cluster document-schema files import their value sets from\n// HERE so two clusters can never define the same enum with drifting values.\n// Every value is transcribed verbatim from the frozen Trust & Safety spec\n// (Appendix A) — no invented values, no placeholders; the durable design owners\n// are ttt-prod docs/design/csam-detection-and-response.md,\n// docs/design/content-moderation-and-reporting.md, and\n// docs/design/nonconsensual-intimate-imagery-and-take-it-down.md.\n//\n// Cross-boundary: these types are consumed by both functions/src and src/ in\n// ttt-prod, so they live in ttt-core (the single source of truth for the\n// backend↔frontend boundary) and surface on the `@ttt-productions/ttt-core/\n// doc-schemas` subpath.\n\nimport { z } from 'zod';\nimport {\n MAX_SAFETY_RESOLUTION_SUMMARY_LENGTH,\n MAX_SAFETY_ADMIN_NOTE_LENGTH,\n} from '../../constants/business.js';\n\n// ===========================================================================\n// A1 — Report reasons + reportable item types\n// ===========================================================================\n\n/** The controlling report-reason taxonomy (fixes the client/server drift\n * TS-032). The two protected reasons fork into a childSafetyCase / nciiCase. */\nexport const ReportReasonSchema = z.enum([\n 'Spam',\n 'Harassment',\n 'Hate Speech',\n 'Violence or Threats',\n 'Sexual Content',\n 'Self-Harm',\n 'Impersonation',\n 'Intellectual Property',\n 'Child Safety Concern', // → protected fork: childSafetyCase\n 'Nonconsensual Intimate Image (NCII)', // → protected fork: nciiCase\n 'Not related to on-site entertainment',\n 'Other',\n]);\nexport type ReportReason = z.infer<typeof ReportReasonSchema>;\n\n/** The two reasons that take the mandatory in-process protected branch. */\nexport const PROTECTED_REPORT_REASONS = [\n 'Child Safety Concern',\n 'Nonconsensual Intimate Image (NCII)',\n] as const satisfies readonly ReportReason[];\n\n/** Which protected fork a protected-reason report committed. */\nexport const ProtectedForkSchema = z.enum(['childSafetyCase', 'nciiCase']);\nexport type ProtectedFork = z.infer<typeof ProtectedForkSchema>;\n\n/** EXACTLY the `reportableItems` keys in ttt-prod src/lib/report-config.ts. A\n * ttt-prod CI test asserts this enum and `reportableItems` stay in sync (the\n * sync test lives app-side because report-config.ts is app-side). */\nexport const ReportableItemTypeSchema = z.enum([\n 'username',\n 'craft-skill',\n 'commission-listing',\n 'commission-proposal',\n 'square-streetz-post',\n 'profile-picture',\n 'guild-invite-message',\n 'guild-chat-message',\n // A single message in a WORK-PARTY admin correspondence thread (pendingAdminDispatches\n // partyKind 'workProject' — the one multi-member chat surface transported through\n // Firestore `conversationMessages`). The resolver enforces the work-party kind\n // server-side; user↔admin support threads are NOT reportable (an admin is already a\n // participant in every thread — DJ ruling 2026-07-13).\n 'admin-work-message',\n 'hall-library-item',\n // [EUAS-017] a single Hall sub-item (a Tale chapter / Tune track / Television episode). The\n // `hallItem` TargetLocatorV1 already carries an optional `subItemId`; the report UI passes the\n // sub-item id + its parent hall item, and the resolver derives the canonical sub-item path\n // server-side. Admins can already hide a single sub-item (runSetHallSubItemHidden) — this makes the\n // matching user-facing report reachable.\n 'hall-library-sub-item',\n 'audition',\n 'audition-entry',\n 'work-project',\n 'work-asset',\n 'work-realm',\n]);\nexport type ReportableItemType = z.infer<typeof ReportableItemTypeSchema>;\n\n/** The DO-transported chat report types — no Firestore message doc / owner exists to\n * hold at intake (H-04 V1); the resolver goes through the signed chat-Worker context\n * read. `admin-work-message` is NOT here: its messages are Firestore docs. Derived\n * subset — compile-linked to the canonical enum, never a re-declared string set. */\nexport const CHAT_REPORT_ITEM_TYPES = [\n 'guild-chat-message',\n 'guild-invite-message',\n] as const satisfies readonly ReportableItemType[];\n\n/** Item types whose report work-view renders the content-action (moderate) panel —\n * the backend moderation cores accept these. Compile-linked subset of the enum. */\nexport const CONTENT_ACTION_PANEL_ITEM_TYPES = [\n 'square-streetz-post',\n 'audition',\n 'audition-entry',\n 'commission-listing',\n 'commission-proposal',\n 'work-asset',\n 'profile-picture',\n 'hall-library-item',\n 'hall-library-sub-item',\n 'craft-skill',\n // Work-party admin correspondence message — single-doc hidden flip (2026-07-13).\n 'admin-work-message',\n] as const satisfies readonly ReportableItemType[];\nexport type ContentActionPanelItemType = (typeof CONTENT_ACTION_PANEL_ITEM_TYPES)[number];\n\n// ===========================================================================\n// A11 — Target locator (the ONE typed locator used by allegations, temp holds,\n// removal targets, and the report resolver) + privacy-safe summary\n// ===========================================================================\n\n/** Discriminated locator — replaces every all-optional `contentRef`. Every\n * hideable surface in report-config.ts has a typed locator ([H-02]). */\nexport const TargetLocatorV1Schema = z.discriminatedUnion('kind', [\n z.object({ kind: z.literal('mediaAsset'), mediaAssetId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('hallItem'), hallItemId: z.string().min(1), subItemId: z.string().min(1).optional() }).strict(),\n z.object({ kind: z.literal('squarePost'), postId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('profileImage'), profileUid: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('username'), profileUid: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('craftSkill'), profileUid: z.string().min(1), craftSkillId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('commissionListing'), commissionListingId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('commissionProposal'), commissionListingId: z.string().min(1), commissionProposalId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('workProject'), workProjectId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('workAsset'), workProjectId: z.string().min(1), workAssetId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('workRealm'), workRealmId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('audition'), auditionId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('auditionEntry'), auditionId: z.string().min(1), auditionEntryId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('guildInviteMessage'), channelId: z.string().min(1), messageId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('chatAttachment'), channelId: z.string().min(1), messageId: z.string().min(1), attachmentId: z.string().min(1) }).strict(),\n // [H-04 V1] Plain guild chat message (text-only or Worker-unresolved). Distinct from\n // `chatAttachment` (which carries an actual attachment id) so a text-only protected chat\n // report has a clean, unambiguous locator without misusing the attachment variant.\n z.object({ kind: z.literal('guildChatMessage'), channelId: z.string().min(1), messageId: z.string().min(1) }).strict(),\n // A work-party admin correspondence message — a Firestore doc at\n // pendingAdminDispatches/{adminDispatchId}/conversationMessages/{messageId} (unlike the\n // DO-addressed guildChatMessage/guildInviteMessage locators, messageId here is a doc id,\n // not a numeric seq).\n z.object({ kind: z.literal('adminWorkMessage'), adminDispatchId: z.string().min(1), messageId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('url'), url: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('additionalText'), textRef: z.string().min(1) }).strict(),\n]);\nexport type TargetLocatorV1 = z.infer<typeof TargetLocatorV1Schema>;\n\n/** The set of locator discriminants — used wherever only the `kind` is needed. */\nexport const TargetLocatorKindSchema = z.enum([\n 'mediaAsset',\n 'hallItem',\n 'squarePost',\n 'profileImage',\n 'username',\n 'craftSkill',\n 'commissionListing',\n 'commissionProposal',\n 'workProject',\n 'workAsset',\n 'workRealm',\n 'audition',\n 'auditionEntry',\n 'guildInviteMessage',\n 'chatAttachment',\n // [H-04 V1] Plain guild chat message locator (text-only / Worker-unresolved protected report).\n 'guildChatMessage',\n // Work-party admin correspondence message (Firestore conversationMessages doc).\n 'adminWorkMessage',\n 'url',\n 'additionalText',\n]);\nexport type TargetLocatorKind = z.infer<typeof TargetLocatorKindSchema>;\n\n/** Privacy-safe summary ONLY — no narrative / PII; used on roots + public rows. */\nexport const TargetLocatorSummaryV1Schema = z.object({\n kind: TargetLocatorKindSchema,\n surfaceLabel: z.string(),\n hasResolvedTarget: z.boolean(),\n}).strict();\nexport type TargetLocatorSummaryV1 = z.infer<typeof TargetLocatorSummaryV1Schema>;\n\n// ===========================================================================\n// A9 — Reporting determination + NCMEC submission state\n// ===========================================================================\n\n/** Case-level reporting determination (Finding-H6). The ONLY carrier of \"no\n * NCMEC report required\" — `notRequired` was removed from NcmecSubmissionState. */\nexport const ReportDispositionSchema = z.enum([\n 'undetermined',\n 'reportRequired',\n 'notRequired',\n 'correctedNoApparentViolation',\n]);\nexport type ReportDisposition = z.infer<typeof ReportDispositionSchema>;\n\n/** Reason codes for the privileged setReportDisposition command (§A9). The first five are the\n * not-required / exception reasons (no NCMEC report ever arose, or a triggering signal was\n * corrected); the last two are the report-required reasons (a report IS legally required). The\n * disposition↔reason pairing is enforced by the ONE cross-field rule below (ARCH-102). */\nexport const ReportDispositionReasonCodeSchema = z.enum([\n 'outOfScopeNotCsea',\n 'basisInvalidatedFalseMatch',\n 'duplicateOfFiledReport',\n 'leDirectedNoReport',\n 'nonReportableSafetyConfirmed',\n // Report-required reasons — valid ONLY with disposition 'reportRequired'.\n 'apparentCsamConfirmed', // human review confirmed apparent CSAM\n 'hashMatchValidated', // validated hash match\n]);\nexport type ReportDispositionReasonCode = z.infer<typeof ReportDispositionReasonCodeSchema>;\n\n/** The reason codes that ASSERT a reporting obligation — legal ONLY with 'reportRequired'.\n * Compile-linked subset of the canonical reason enum. */\nexport const REPORT_REQUIRED_DISPOSITION_REASON_CODES = [\n 'apparentCsamConfirmed',\n 'hashMatchValidated',\n] as const satisfies readonly ReportDispositionReasonCode[];\n\n/** The not-required / exception reason codes — legal with every disposition that does NOT assert a\n * reporting obligation ('notRequired', 'correctedNoApparentViolation'). Compile-linked subset. */\nexport const NOT_REQUIRED_DISPOSITION_REASON_CODES = [\n 'outOfScopeNotCsea',\n 'basisInvalidatedFalseMatch',\n 'duplicateOfFiledReport',\n 'leDirectedNoReport',\n 'nonReportableSafetyConfirmed',\n] as const satisfies readonly ReportDispositionReasonCode[];\n\n/** The ONE cross-field pairing (§A9, ARCH-102): which reason codes each disposition permits.\n * Declared HERE once; both the setReportDisposition input (case.ts) and the SafetyDispositionAction\n * console command (admin.ts) apply `refineReportDispositionReasonCode` derived from this map rather\n * than re-declaring the pairing. 'undetermined' is the initial state, never an operator-settable\n * target, so it permits NO reason code (the operator command excludes it). Typed as an exhaustive\n * Record so a new disposition fails to compile until its permitted codes are declared. */\nexport const REPORT_DISPOSITION_ALLOWED_REASON_CODES: Record<\n ReportDisposition,\n readonly ReportDispositionReasonCode[]\n> = {\n undetermined: [],\n reportRequired: REPORT_REQUIRED_DISPOSITION_REASON_CODES,\n notRequired: NOT_REQUIRED_DISPOSITION_REASON_CODES,\n correctedNoApparentViolation: NOT_REQUIRED_DISPOSITION_REASON_CODES,\n};\n\n/** Shared cross-field refinement enforcing the disposition↔reason pairing above. Applied by BOTH\n * the setReportDisposition input schemas and the SafetyDispositionAction console command so the\n * rule lives in exactly one place. Reports the failure on the `dispositionReasonCode` path. */\nexport function refineReportDispositionReasonCode(\n value: { disposition: ReportDisposition; dispositionReasonCode: ReportDispositionReasonCode },\n ctx: z.RefinementCtx,\n): void {\n if (!REPORT_DISPOSITION_ALLOWED_REASON_CODES[value.disposition].includes(value.dispositionReasonCode)) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['dispositionReasonCode'],\n message: `Reason code '${value.dispositionReasonCode}' is not valid for disposition '${value.disposition}'.`,\n });\n }\n}\n\n/** Shared cross-field rule (§A9): disposition 'reportRequired' MUST carry at least one evidence ref —\n * a reporting obligation can only be asserted once the evidence has been revealed. Every OTHER\n * disposition ('notRequired', 'correctedNoApparentViolation', 'undetermined') MAY leave evidenceRefs\n * empty. Declared HERE once (ARCH-102) and applied — alongside refineReportDispositionReasonCode — by\n * BOTH the setReportDisposition input schemas (case.ts) and the SafetyStagedAction console command\n * (admin.ts), never re-declared. Reports the failure on the `evidenceRefs` path. */\nexport function refineReportDispositionEvidenceRefs(\n value: { disposition: ReportDisposition; evidenceRefs: readonly string[] },\n ctx: z.RefinementCtx,\n): void {\n if (value.disposition === 'reportRequired' && value.evidenceRefs.length === 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['evidenceRefs'],\n message:\n \"Disposition 'reportRequired' requires at least one evidence ref (evidence must have been revealed).\",\n });\n }\n}\n\n// ===========================================================================\n// [EUAS-008] Structured safety-case CLOSURE record — the operator's terminal\n// determination persisted when a CSAM / NCII case is closed via the guided\n// resolution flow (resolveAdminTask). Embedded on the NCII case (`closure`) and on\n// a child-safety `decisions/{id}` row (kind `caseClosed`) so both case types carry\n// the SAME structured outcome/summary/note + actor/timestamp — not just a status\n// flip. This does NOT replace the case lifecycle's own terminal status; it records\n// WHO closed it, WHY, and with what outcome.\n// ===========================================================================\n\n/** founded = a violation was substantiated; unfounded = no violation on review. */\nexport const SafetyCaseClosureOutcomeSchema = z.enum(['founded', 'unfounded']);\nexport type SafetyCaseClosureOutcome = z.infer<typeof SafetyCaseClosureOutcomeSchema>;\n\n/** The structured closure record written on a safety-case close. */\nexport const SafetyCaseClosureV1Schema = z.object({\n outcome: SafetyCaseClosureOutcomeSchema,\n resolutionSummary: z.string().min(1).max(MAX_SAFETY_RESOLUTION_SUMMARY_LENGTH),\n adminNote: z.string().max(MAX_SAFETY_ADMIN_NOTE_LENGTH).optional(),\n closedByUid: z.string().min(1),\n closedAt: z.number(),\n}).strict();\nexport type SafetyCaseClosureV1 = z.infer<typeof SafetyCaseClosureV1Schema>;\n\n/** NCMEC submission lifecycle — MANUAL-PORTAL model (§A9). NO `notRequired` (that is\n * ReportDisposition). There is no automated ispws API: a report-needed obligation sits in\n * `awaitingManualFiling` from enqueue until the operator files on the NCMEC portal and records the\n * confirmation (markNcmecPortalComplete → `completed`). Jobs are born `awaitingManualFiling`; the\n * case-list `ncmecStatus` projection uses the same value (no separate `queued` state). There is no\n * in-app retraction — corrections are portal-manual (correction-lifecycle decision). The old\n * API-drive states\n * (opening/open/uploading/addingFileDetails/finishing/retryableFailure/ambiguousResult/permanentFailure)\n * were removed with the live-API client. */\nexport const NcmecSubmissionStateSchema = z.enum([\n 'awaitingManualFiling',\n 'completed',\n]);\nexport type NcmecSubmissionState = z.infer<typeof NcmecSubmissionStateSchema>;\n\n// ===========================================================================\n// A3 — Safety-hold + resource-command vocabularies (the ONE destructive-guard\n// authority). The NCII/storage resource types live in THIS enum (H1 fix).\n// ===========================================================================\n\nexport const SafetyHoldResourceTypeSchema = z.enum([\n 'contentDoc',\n 'mediaAsset',\n 'account',\n 'chatMessageRange',\n 'channel',\n 'nciiTemporaryTarget',\n 'storageObject',\n 'reportEvidenceObject',\n]);\nexport type SafetyHoldResourceType = z.infer<typeof SafetyHoldResourceTypeSchema>;\n\n/** Lifecycle/retention regime governed by the A3 compatibility matrix. */\nexport const SafetyHoldClassSchema = z.enum([\n 'childSafety',\n 'nciiTemporary',\n 'legalRetention',\n 'preservationEvidence',\n // An OPEN ordinary (non-protected) content report places an account-level hold\n // (resourceType 'account', ownerUid = the reported user) so a user can't delete\n // their data out from under an unreviewed report (e.g. a DMCA/IP complaint, then\n // delete-to-clear-tracks). blocksDeletion + blocksAnonymization; released when the\n // report group's admin close-out resolves it. Durable (no expiresAt).\n 'ordinaryReport',\n]);\nexport type SafetyHoldClass = z.infer<typeof SafetyHoldClassSchema>;\n\n/** Resource-scoped destructive command kinds (A3). */\nexport const SafetyCommandKindSchema = z.enum([\n 'nciiRemoval',\n 'csamActiveByteRemoval',\n 'evidenceDisposition',\n]);\nexport type SafetyCommandKind = z.infer<typeof SafetyCommandKindSchema>;\n\n// ===========================================================================\n// Reviewer-capability matrix (§A11 [M4] + §A9). One solo operator holds all\n// at launch; every privileged command checks the SPECIFIC capability + reauth.\n// ===========================================================================\n\nexport const SafetyReviewerCapabilitySchema = z.enum([\n 'nciiRequestReviewer',\n 'nciiEvidenceReviewer',\n 'nciiAppealReviewer',\n 'childSafetyReviewer',\n 'legalDispositionAuthority',\n]);\nexport type SafetyReviewerCapability = z.infer<typeof SafetyReviewerCapabilitySchema>;\n\n// ===========================================================================\n// A7 — Registration-completion outcome (DOMAIN enum; replaces the unsafe\n// generic gRPC retryable/terminal code lists). Only a domain outcome feeds the\n// orphan-Auth deletion policy.\n// ===========================================================================\n\nexport const RegistrationCompletionOutcomeSchema = z.enum([\n 'completed',\n 'alreadyCompletedSameUid',\n 'retryableInfrastructureFailure',\n 'reauthenticationRequired',\n 'appCheckRetryRequired',\n 'nonceExpired',\n 'nonceUnknown',\n 'nonceConsumedDifferentUid',\n 'sessionHashMismatch',\n 'attestationSignatureInvalid',\n 'privateDataConflict',\n 'policyVersionRejected',\n]);\nexport type RegistrationCompletionOutcome = z.infer<typeof RegistrationCompletionOutcomeSchema>;\n\n// ===========================================================================\n// A11 — NCII / TAKE IT DOWN shared vocabularies (consumed by BOTH NCII clusters)\n// ===========================================================================\n\n/** Closed enum of required field codes — completeness + public missing-fields. */\nexport const TakeItDownFieldCodeSchema = z.enum([\n 'requesterName',\n 'contactEmail',\n 'contactPhone',\n 'requesterRole',\n 'electronicSignature',\n 'authorityBasis',\n 'authorityCertification',\n 'authorityEvidence',\n 'targetLocator',\n 'nonconsentStatement',\n 'supportingFacts',\n 'goodFaithCertification',\n]);\nexport type TakeItDownFieldCode = z.infer<typeof TakeItDownFieldCodeSchema>;\n\n/** Closed PUBLIC-SAFE reason codes — never reveal evidence/uploader/crossover. */\nexport const TakeItDownPublicReasonCodeSchema = z.enum([\n 'needMoreInformation',\n 'couldNotVerifyRequesterRole',\n 'couldNotLocateContent',\n 'outsideCoveredScope',\n 'duplicateOfExistingRequest',\n 'removedSuccessfully',\n 'underReview',\n 'closedSeeNotice',\n]);\nexport type TakeItDownPublicReasonCode = z.infer<typeof TakeItDownPublicReasonCodeSchema>;\n\n/** Validity-failure reason codes ([H2]). `incomplete` is a COMPLETENESS state,\n * NEVER a validity state. */\nexport const TakeItDownInvalidReasonCodeSchema = z.enum([\n 'missingSignature',\n 'missingLocator',\n 'missingNonconsentStatement',\n 'missingContactInformation',\n 'requesterNotDepictedPersonOrAuthorizedRepresentative',\n 'authorityNotEstablished',\n 'locatorNotResolvableAfterReasonableEffort',\n 'requestOutsideCoveredDepiction',\n 'duplicateSuperseded',\n 'fraudulentOrBadFaith',\n 'otherCounselApproved',\n]);\nexport type TakeItDownInvalidReasonCode = z.infer<typeof TakeItDownInvalidReasonCodeSchema>;\n\n/** Requester role (depicted person vs authorized representative). */\nexport const TakeItDownRequesterRoleSchema = z.enum(['depictedPerson', 'authorizedRepresentative']);\nexport type TakeItDownRequesterRole = z.infer<typeof TakeItDownRequesterRoleSchema>;\n\n/** Two-axis state: completeness vs validity (H2). */\nexport const TakeItDownCompletenessStatusSchema = z.enum(['incomplete', 'complete']);\nexport type TakeItDownCompletenessStatus = z.infer<typeof TakeItDownCompletenessStatusSchema>;\n\nexport const TakeItDownValidityStatusSchema = z.enum(['pending', 'valid', 'invalid', 'unableToLocate']);\nexport type TakeItDownValidityStatus = z.infer<typeof TakeItDownValidityStatusSchema>;\n\n/** The public no-login status-page status set (root + statusProjection). No\n * appeal model — no `appealedCorrected` (the appeal/reinstatement flow was\n * removed; protected reports have no uploader appeal/notice/reinstatement). */\nexport const TakeItDownPublicStatusSchema = z.enum([\n 'received',\n 'needsMoreInfo',\n 'validInProgress',\n 'completed',\n 'unableToLocate',\n 'invalidGeneralReason',\n]);\nexport type TakeItDownPublicStatus = z.infer<typeof TakeItDownPublicStatusSchema>;\n\n/** Request action types ([L1]). */\nexport const NciiActionTypeSchema = z.enum([\n 'intakeReceived',\n 'completenessDecided',\n 'validityDecided',\n 'tempHoldPlaced',\n 'tempHoldReleased',\n 'removalStarted',\n 'removalCompleted',\n 'hashBlockReversed',\n 'childSafetyCaseLinked',\n 'legalDispositionRecorded',\n]);\nexport type NciiActionType = z.infer<typeof NciiActionTypeSchema>;\n\nexport const NciiActionResultSchema = z.enum(['succeeded', 'failed', 'deferred', 'rejected']);\nexport type NciiActionResult = z.infer<typeof NciiActionResultSchema>;\n\n/** Honest derived completion ([H4]) — never 'completed' for a partial failure. */\nexport const NciiRemovalCompletionOutcomeSchema = z.enum([\n 'completed',\n 'completedWithApprovedException',\n 'unableToComplete',\n]);\nexport type NciiRemovalCompletionOutcome = z.infer<typeof NciiRemovalCompletionOutcomeSchema>;\n\nexport const NciiTargetSurfaceSchema = z.enum([\n 'original',\n 'hallCopy',\n 'profileMedia',\n 'chatAttachment',\n 'variant',\n 'cacheServing',\n 'exactHashMatch',\n]);\nexport type NciiTargetSurface = z.infer<typeof NciiTargetSurfaceSchema>;\n\nexport const NciiTargetOutcomeSchema = z.enum([\n 'pending',\n 'removed',\n 'tombstoned',\n 'verifiedGone',\n 'leftoverRetrying',\n 'unableToComplete',\n 'terminalException',\n]);\nexport type NciiTargetOutcome = z.infer<typeof NciiTargetOutcomeSchema>;\n\n/** CLOSED terminal-exception enum — a technical outage is NOT an exception. */\nexport const NciiTerminalExceptionSchema = z.enum([\n 'legallyPermittedRetention',\n 'contentNotPresentVerified',\n 'counselApprovedException',\n]);\nexport type NciiTerminalException = z.infer<typeof NciiTerminalExceptionSchema>;\n\n/** Internal operational case status ([H7]).\n *\n * [R12] close-lifecycle states: clicking **Close** (after the strict-closable gate passes)\n * applies the staged actions and moves the case to `processing` — it STAYS pinned/in-queue,\n * NEVER cleared on the click. The NCII removal worker flips the case to the terminal `closed`\n * ONLY on VERIFIED removal completion (clearing the pin via onSafetyCaseClosed). If the\n * removal saga exhausts its retries (dead-letter), the case moves to `failed` — kept pinned,\n * surfaced in the Safety Console failed-jobs view, with a Restart that re-arms the job. Both\n * are explicit values (never derived). */\nexport const NciiInternalStatusSchema = z.enum([\n 'open',\n 'removalInProgress',\n 'processing',\n 'failed',\n 'removed',\n 'rejected',\n 'closed',\n]);\nexport type NciiInternalStatus = z.infer<typeof NciiInternalStatusSchema>;\n\n/** Child-safety linkage status on an NCII case ([H7]). */\nexport const NciiChildSafetyLinkStatusSchema = z.enum([\n 'none',\n 'assessmentPending',\n 'linked',\n 'resolvedNoChildSafetyCase',\n]);\nexport type NciiChildSafetyLinkStatus = z.infer<typeof NciiChildSafetyLinkStatusSchema>;\n\n// ===========================================================================\n// A11 [F4] — child-safety crossover (possible-minor ≠ automatic CSAM).\n// Embedded on nciiCases. childSafetyCaseId lives HERE (one canonical place).\n// ===========================================================================\n\nexport const NciiMinorAssessmentSchema = z.enum(['adult', 'unknown', 'possibleMinor', 'confirmedMinor']);\nexport type NciiMinorAssessment = z.infer<typeof NciiMinorAssessmentSchema>;\n\nexport const NciiCsamAssessmentSchema = z.enum([\n 'notAssessed',\n 'notApparent',\n 'apparentViolation',\n 'validatedHashMatch',\n]);\nexport type NciiCsamAssessment = z.infer<typeof NciiCsamAssessmentSchema>;\n\nexport const NciiChildSafetyCrossoverSchema = z.object({\n minorAssessment: NciiMinorAssessmentSchema,\n csamAssessment: NciiCsamAssessmentSchema,\n childSafetyCaseId: z.string().min(1).optional(),\n assessedByUid: z.string().min(1).optional(),\n assessedAt: z.number().optional(),\n}).strict();\nexport type NciiChildSafetyCrossover = z.infer<typeof NciiChildSafetyCrossoverSchema>;\n\n/** [H-2] Per-leg lifecycle status for the possible-minor crossover side-effects (serving-deny,\n * PhotoDNA) persisted on the crossover child-safety case (see ChildSafetyCaseV1.crossoverLegs).\n * `pending` is the in-transaction initial marker the assessment writes before the post-commit leg\n * runs; the leg then flips it to `done` (succeeded) or `failed` (captureException'd, awaiting a\n * reconcile/replay). A leg is ABSENT (not `pending`) when it never applied — an external / no-media\n * target has no bytes to deny or scan. */\nexport const SafetyCrossoverLegStatusSchema = z.enum(['pending', 'done', 'failed']);\nexport type SafetyCrossoverLegStatus = z.infer<typeof SafetyCrossoverLegStatusSchema>;\n"]}
|
|
1
|
+
{"version":3,"file":"foundation.js","sourceRoot":"","sources":["../../../src/doc-schemas/safety/foundation.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,EAAE;AACF,8EAA8E;AAC9E,0EAA0E;AAC1E,2EAA2E;AAC3E,4EAA4E;AAC5E,0EAA0E;AAC1E,gFAAgF;AAChF,2DAA2D;AAC3D,uDAAuD;AACvD,kEAAkE;AAClE,EAAE;AACF,6EAA6E;AAC7E,yEAAyE;AACzE,4EAA4E;AAC5E,wBAAwB;AAExB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,oCAAoC,EACpC,4BAA4B,GAC7B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AAEjF,8EAA8E;AAC9E,8CAA8C;AAC9C,8EAA8E;AAE9E;gFACgF;AAChF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,IAAI,CAAC;IACvC,MAAM;IACN,YAAY;IACZ,aAAa;IACb,qBAAqB;IACrB,gBAAgB;IAChB,WAAW;IACX,eAAe;IACf,uBAAuB;IACvB,sBAAsB,EAAE,oCAAoC;IAC5D,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8B,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC","sourcesContent":["// Trust & Safety — shared foundation enums + the canonical target locator.\n//\n// This file is the SINGLE SOURCE for every enum and locator that crosses more\n// than one T&S cluster (report spine, case spine, holds, evidence, sagas,\n// NCMEC, NCII). Cluster document-schema files import their value sets from\n// HERE so two clusters can never define the same enum with drifting values.\n// Every value is transcribed verbatim from the frozen Trust & Safety spec\n// (Appendix A) — no invented values, no placeholders; the durable design owners\n// are ttt-prod docs/design/csam-detection-and-response.md,\n// docs/design/content-moderation-and-reporting.md, and\n// docs/design/nonconsensual-intimate-imagery-and-take-it-down.md.\n//\n// Cross-boundary: these types are consumed by both functions/src and src/ in\n// ttt-prod, so they live in ttt-core (the single source of truth for the\n// backend↔frontend boundary) and surface on the `@ttt-productions/ttt-core/\n// doc-schemas` subpath.\n\nimport { z } from 'zod';\nimport {\n MAX_SAFETY_RESOLUTION_SUMMARY_LENGTH,\n MAX_SAFETY_ADMIN_NOTE_LENGTH,\n} from '../../constants/business.js';\nimport { ConversationFileRefSchema } from '../../media/conversation-file-ref.js';\n\n// ===========================================================================\n// A1 — Report reasons + reportable item types\n// ===========================================================================\n\n/** The controlling report-reason taxonomy (fixes the client/server drift\n * TS-032). The two protected reasons fork into a childSafetyCase / nciiCase. */\nexport const ReportReasonSchema = z.enum([\n 'Spam',\n 'Harassment',\n 'Hate Speech',\n 'Violence or Threats',\n 'Sexual Content',\n 'Self-Harm',\n 'Impersonation',\n 'Intellectual Property',\n 'Child Safety Concern', // → protected fork: childSafetyCase\n 'Nonconsensual Intimate Image (NCII)', // → protected fork: nciiCase\n 'Not related to on-site entertainment',\n 'Other',\n]);\nexport type ReportReason = z.infer<typeof ReportReasonSchema>;\n\n/** The two reasons that take the mandatory in-process protected branch. */\nexport const PROTECTED_REPORT_REASONS = [\n 'Child Safety Concern',\n 'Nonconsensual Intimate Image (NCII)',\n] as const satisfies readonly ReportReason[];\n\n/** Which protected fork a protected-reason report committed. */\nexport const ProtectedForkSchema = z.enum(['childSafetyCase', 'nciiCase']);\nexport type ProtectedFork = z.infer<typeof ProtectedForkSchema>;\n\n/** EXACTLY the `reportableItems` keys in ttt-prod src/lib/report-config.ts. A\n * ttt-prod CI test asserts this enum and `reportableItems` stay in sync (the\n * sync test lives app-side because report-config.ts is app-side). */\nexport const ReportableItemTypeSchema = z.enum([\n 'username',\n 'craft-skill',\n 'commission-listing',\n 'commission-proposal',\n 'square-streetz-post',\n 'profile-picture',\n 'guild-invite-message',\n 'guild-chat-message',\n // A single message in a WORK-PARTY admin correspondence thread (pendingAdminDispatches\n // partyKind 'workProject' — the one multi-member chat surface transported through\n // Firestore `conversationMessages`). The resolver enforces the work-party kind\n // server-side; user↔admin support threads are NOT reportable (an admin is already a\n // participant in every thread — DJ ruling 2026-07-13).\n 'admin-work-message',\n // A single file in a conversation's flat Conversation Files list (guild-invite or\n // admin-support scope). Replaces reporting a chat-message attachment: files are no\n // longer carried by a message, so the report targets the FILE, whose `conversationFile`\n // TargetLocatorV1 carries the conversation ref + file id + mediaAssetId. Guild CHANNELS\n // have no Conversation Files, so no channel-scoped variant exists.\n 'conversation-file',\n 'hall-library-item',\n // [EUAS-017] a single Hall sub-item (a Tale chapter / Tune track / Television episode). The\n // `hallItem` TargetLocatorV1 already carries an optional `subItemId`; the report UI passes the\n // sub-item id + its parent hall item, and the resolver derives the canonical sub-item path\n // server-side. Admins can already hide a single sub-item (runSetHallSubItemHidden) — this makes the\n // matching user-facing report reachable.\n 'hall-library-sub-item',\n 'audition',\n 'audition-entry',\n 'work-project',\n 'work-asset',\n 'work-realm',\n]);\nexport type ReportableItemType = z.infer<typeof ReportableItemTypeSchema>;\n\n/** The DO-transported chat report types — no Firestore message doc / owner exists to\n * hold at intake (H-04 V1); the resolver goes through the signed chat-Worker context\n * read. `admin-work-message` is NOT here: its messages are Firestore docs. Derived\n * subset — compile-linked to the canonical enum, never a re-declared string set. */\nexport const CHAT_REPORT_ITEM_TYPES = [\n 'guild-chat-message',\n 'guild-invite-message',\n] as const satisfies readonly ReportableItemType[];\n\n/** Item types whose report work-view renders the content-action (moderate) panel —\n * the backend moderation cores accept these. Compile-linked subset of the enum. */\nexport const CONTENT_ACTION_PANEL_ITEM_TYPES = [\n 'square-streetz-post',\n 'audition',\n 'audition-entry',\n 'commission-listing',\n 'commission-proposal',\n 'work-asset',\n 'profile-picture',\n 'hall-library-item',\n 'hall-library-sub-item',\n 'craft-skill',\n // Work-party admin correspondence message — single-doc hidden flip (2026-07-13).\n 'admin-work-message',\n // Conversation File — the media-backed file record, actioned exactly like `work-asset`\n // (the other shared-file surface): the action targets the file + its mediaAsset, never\n // a chat message.\n 'conversation-file',\n] as const satisfies readonly ReportableItemType[];\nexport type ContentActionPanelItemType = (typeof CONTENT_ACTION_PANEL_ITEM_TYPES)[number];\n\n// ===========================================================================\n// A11 — Target locator (the ONE typed locator used by allegations, temp holds,\n// removal targets, and the report resolver) + privacy-safe summary\n// ===========================================================================\n\n/** Discriminated locator — replaces every all-optional `contentRef`. Every\n * hideable surface in report-config.ts has a typed locator ([H-02]). */\nexport const TargetLocatorV1Schema = z.discriminatedUnion('kind', [\n z.object({ kind: z.literal('mediaAsset'), mediaAssetId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('hallItem'), hallItemId: z.string().min(1), subItemId: z.string().min(1).optional() }).strict(),\n z.object({ kind: z.literal('squarePost'), postId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('profileImage'), profileUid: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('username'), profileUid: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('craftSkill'), profileUid: z.string().min(1), craftSkillId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('commissionListing'), commissionListingId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('commissionProposal'), commissionListingId: z.string().min(1), commissionProposalId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('workProject'), workProjectId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('workAsset'), workProjectId: z.string().min(1), workAssetId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('workRealm'), workRealmId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('audition'), auditionId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('auditionEntry'), auditionId: z.string().min(1), auditionEntryId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('guildInviteMessage'), channelId: z.string().min(1), messageId: z.string().min(1) }).strict(),\n // A file in a conversation's flat Conversation Files list. Replaces the removed\n // `chatAttachment` locator: a file is no longer embedded in, sequenced with, or\n // mutated through a chat message, so it is located by its CONVERSATION + file id,\n // never by a channel/message coordinate. `conversation` is the canonical\n // `ConversationFileRef` (exactly two scopes — guildInvite / adminSupport), so a\n // guild CHANNEL conversation file is structurally inexpressible here: guild\n // channels have no Conversation Files. `mediaAssetId` is carried so the removal\n // saga can hold/retire the bytes without a second resolve.\n z.object({\n kind: z.literal('conversationFile'),\n conversation: ConversationFileRefSchema,\n conversationFileId: z.string().min(1),\n mediaAssetId: z.string().min(1),\n }).strict(),\n // [H-04 V1] Plain guild chat message (text-only or Worker-unresolved). Chat is\n // text-only, so this is the ONLY guild-channel message locator.\n z.object({ kind: z.literal('guildChatMessage'), channelId: z.string().min(1), messageId: z.string().min(1) }).strict(),\n // A work-party admin correspondence message — a Firestore doc at\n // pendingAdminDispatches/{adminDispatchId}/conversationMessages/{messageId} (unlike the\n // DO-addressed guildChatMessage/guildInviteMessage locators, messageId here is a doc id,\n // not a numeric seq).\n z.object({ kind: z.literal('adminWorkMessage'), adminDispatchId: z.string().min(1), messageId: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('url'), url: z.string().min(1) }).strict(),\n z.object({ kind: z.literal('additionalText'), textRef: z.string().min(1) }).strict(),\n]);\nexport type TargetLocatorV1 = z.infer<typeof TargetLocatorV1Schema>;\n\n/** The set of locator discriminants — used wherever only the `kind` is needed. */\nexport const TargetLocatorKindSchema = z.enum([\n 'mediaAsset',\n 'hallItem',\n 'squarePost',\n 'profileImage',\n 'username',\n 'craftSkill',\n 'commissionListing',\n 'commissionProposal',\n 'workProject',\n 'workAsset',\n 'workRealm',\n 'audition',\n 'auditionEntry',\n 'guildInviteMessage',\n // A Conversation File (guild-invite / admin-support scope) — replaced `chatAttachment`.\n 'conversationFile',\n // [H-04 V1] Plain guild chat message locator (text-only / Worker-unresolved protected report).\n 'guildChatMessage',\n // Work-party admin correspondence message (Firestore conversationMessages doc).\n 'adminWorkMessage',\n 'url',\n 'additionalText',\n]);\nexport type TargetLocatorKind = z.infer<typeof TargetLocatorKindSchema>;\n\n/** Privacy-safe summary ONLY — no narrative / PII; used on roots + public rows. */\nexport const TargetLocatorSummaryV1Schema = z.object({\n kind: TargetLocatorKindSchema,\n surfaceLabel: z.string(),\n hasResolvedTarget: z.boolean(),\n}).strict();\nexport type TargetLocatorSummaryV1 = z.infer<typeof TargetLocatorSummaryV1Schema>;\n\n// ===========================================================================\n// A9 — Reporting determination + NCMEC submission state\n// ===========================================================================\n\n/** Case-level reporting determination (Finding-H6). The ONLY carrier of \"no\n * NCMEC report required\" — `notRequired` was removed from NcmecSubmissionState. */\nexport const ReportDispositionSchema = z.enum([\n 'undetermined',\n 'reportRequired',\n 'notRequired',\n 'correctedNoApparentViolation',\n]);\nexport type ReportDisposition = z.infer<typeof ReportDispositionSchema>;\n\n/** Reason codes for the privileged setReportDisposition command (§A9). The first five are the\n * not-required / exception reasons (no NCMEC report ever arose, or a triggering signal was\n * corrected); the last two are the report-required reasons (a report IS legally required). The\n * disposition↔reason pairing is enforced by the ONE cross-field rule below (ARCH-102). */\nexport const ReportDispositionReasonCodeSchema = z.enum([\n 'outOfScopeNotCsea',\n 'basisInvalidatedFalseMatch',\n 'duplicateOfFiledReport',\n 'leDirectedNoReport',\n 'nonReportableSafetyConfirmed',\n // Report-required reasons — valid ONLY with disposition 'reportRequired'.\n 'apparentCsamConfirmed', // human review confirmed apparent CSAM\n 'hashMatchValidated', // validated hash match\n]);\nexport type ReportDispositionReasonCode = z.infer<typeof ReportDispositionReasonCodeSchema>;\n\n/** The reason codes that ASSERT a reporting obligation — legal ONLY with 'reportRequired'.\n * Compile-linked subset of the canonical reason enum. */\nexport const REPORT_REQUIRED_DISPOSITION_REASON_CODES = [\n 'apparentCsamConfirmed',\n 'hashMatchValidated',\n] as const satisfies readonly ReportDispositionReasonCode[];\n\n/** The not-required / exception reason codes — legal with every disposition that does NOT assert a\n * reporting obligation ('notRequired', 'correctedNoApparentViolation'). Compile-linked subset. */\nexport const NOT_REQUIRED_DISPOSITION_REASON_CODES = [\n 'outOfScopeNotCsea',\n 'basisInvalidatedFalseMatch',\n 'duplicateOfFiledReport',\n 'leDirectedNoReport',\n 'nonReportableSafetyConfirmed',\n] as const satisfies readonly ReportDispositionReasonCode[];\n\n/** The ONE cross-field pairing (§A9, ARCH-102): which reason codes each disposition permits.\n * Declared HERE once; both the setReportDisposition input (case.ts) and the SafetyDispositionAction\n * console command (admin.ts) apply `refineReportDispositionReasonCode` derived from this map rather\n * than re-declaring the pairing. 'undetermined' is the initial state, never an operator-settable\n * target, so it permits NO reason code (the operator command excludes it). Typed as an exhaustive\n * Record so a new disposition fails to compile until its permitted codes are declared. */\nexport const REPORT_DISPOSITION_ALLOWED_REASON_CODES: Record<\n ReportDisposition,\n readonly ReportDispositionReasonCode[]\n> = {\n undetermined: [],\n reportRequired: REPORT_REQUIRED_DISPOSITION_REASON_CODES,\n notRequired: NOT_REQUIRED_DISPOSITION_REASON_CODES,\n correctedNoApparentViolation: NOT_REQUIRED_DISPOSITION_REASON_CODES,\n};\n\n/** Shared cross-field refinement enforcing the disposition↔reason pairing above. Applied by BOTH\n * the setReportDisposition input schemas and the SafetyDispositionAction console command so the\n * rule lives in exactly one place. Reports the failure on the `dispositionReasonCode` path. */\nexport function refineReportDispositionReasonCode(\n value: { disposition: ReportDisposition; dispositionReasonCode: ReportDispositionReasonCode },\n ctx: z.RefinementCtx,\n): void {\n if (!REPORT_DISPOSITION_ALLOWED_REASON_CODES[value.disposition].includes(value.dispositionReasonCode)) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['dispositionReasonCode'],\n message: `Reason code '${value.dispositionReasonCode}' is not valid for disposition '${value.disposition}'.`,\n });\n }\n}\n\n/** Shared cross-field rule (§A9): disposition 'reportRequired' MUST carry at least one evidence ref —\n * a reporting obligation can only be asserted once the evidence has been revealed. Every OTHER\n * disposition ('notRequired', 'correctedNoApparentViolation', 'undetermined') MAY leave evidenceRefs\n * empty. Declared HERE once (ARCH-102) and applied — alongside refineReportDispositionReasonCode — by\n * BOTH the setReportDisposition input schemas (case.ts) and the SafetyStagedAction console command\n * (admin.ts), never re-declared. Reports the failure on the `evidenceRefs` path. */\nexport function refineReportDispositionEvidenceRefs(\n value: { disposition: ReportDisposition; evidenceRefs: readonly string[] },\n ctx: z.RefinementCtx,\n): void {\n if (value.disposition === 'reportRequired' && value.evidenceRefs.length === 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: ['evidenceRefs'],\n message:\n \"Disposition 'reportRequired' requires at least one evidence ref (evidence must have been revealed).\",\n });\n }\n}\n\n// ===========================================================================\n// [EUAS-008] Structured safety-case CLOSURE record — the operator's terminal\n// determination persisted when a CSAM / NCII case is closed via the guided\n// resolution flow (resolveAdminTask). Embedded on the NCII case (`closure`) and on\n// a child-safety `decisions/{id}` row (kind `caseClosed`) so both case types carry\n// the SAME structured outcome/summary/note + actor/timestamp — not just a status\n// flip. This does NOT replace the case lifecycle's own terminal status; it records\n// WHO closed it, WHY, and with what outcome.\n// ===========================================================================\n\n/** founded = a violation was substantiated; unfounded = no violation on review. */\nexport const SafetyCaseClosureOutcomeSchema = z.enum(['founded', 'unfounded']);\nexport type SafetyCaseClosureOutcome = z.infer<typeof SafetyCaseClosureOutcomeSchema>;\n\n/** The structured closure record written on a safety-case close. */\nexport const SafetyCaseClosureV1Schema = z.object({\n outcome: SafetyCaseClosureOutcomeSchema,\n resolutionSummary: z.string().min(1).max(MAX_SAFETY_RESOLUTION_SUMMARY_LENGTH),\n adminNote: z.string().max(MAX_SAFETY_ADMIN_NOTE_LENGTH).optional(),\n closedByUid: z.string().min(1),\n closedAt: z.number(),\n}).strict();\nexport type SafetyCaseClosureV1 = z.infer<typeof SafetyCaseClosureV1Schema>;\n\n/** NCMEC submission lifecycle — MANUAL-PORTAL model (§A9). NO `notRequired` (that is\n * ReportDisposition). There is no automated ispws API: a report-needed obligation sits in\n * `awaitingManualFiling` from enqueue until the operator files on the NCMEC portal and records the\n * confirmation (markNcmecPortalComplete → `completed`). Jobs are born `awaitingManualFiling`; the\n * case-list `ncmecStatus` projection uses the same value (no separate `queued` state). There is no\n * in-app retraction — corrections are portal-manual (correction-lifecycle decision). The old\n * API-drive states\n * (opening/open/uploading/addingFileDetails/finishing/retryableFailure/ambiguousResult/permanentFailure)\n * were removed with the live-API client. */\nexport const NcmecSubmissionStateSchema = z.enum([\n 'awaitingManualFiling',\n 'completed',\n]);\nexport type NcmecSubmissionState = z.infer<typeof NcmecSubmissionStateSchema>;\n\n// ===========================================================================\n// A3 — Safety-hold + resource-command vocabularies (the ONE destructive-guard\n// authority). The NCII/storage resource types live in THIS enum (H1 fix).\n// ===========================================================================\n\nexport const SafetyHoldResourceTypeSchema = z.enum([\n 'contentDoc',\n 'mediaAsset',\n 'account',\n 'chatMessageRange',\n 'channel',\n 'nciiTemporaryTarget',\n 'storageObject',\n 'reportEvidenceObject',\n]);\nexport type SafetyHoldResourceType = z.infer<typeof SafetyHoldResourceTypeSchema>;\n\n/** Lifecycle/retention regime governed by the A3 compatibility matrix. */\nexport const SafetyHoldClassSchema = z.enum([\n 'childSafety',\n 'nciiTemporary',\n 'legalRetention',\n 'preservationEvidence',\n // An OPEN ordinary (non-protected) content report places an account-level hold\n // (resourceType 'account', ownerUid = the reported user) so a user can't delete\n // their data out from under an unreviewed report (e.g. a DMCA/IP complaint, then\n // delete-to-clear-tracks). blocksDeletion + blocksAnonymization; released when the\n // report group's admin close-out resolves it. Durable (no expiresAt).\n 'ordinaryReport',\n]);\nexport type SafetyHoldClass = z.infer<typeof SafetyHoldClassSchema>;\n\n/** Resource-scoped destructive command kinds (A3). */\nexport const SafetyCommandKindSchema = z.enum([\n 'nciiRemoval',\n 'csamActiveByteRemoval',\n 'evidenceDisposition',\n]);\nexport type SafetyCommandKind = z.infer<typeof SafetyCommandKindSchema>;\n\n// ===========================================================================\n// Reviewer-capability matrix (§A11 [M4] + §A9). One solo operator holds all\n// at launch; every privileged command checks the SPECIFIC capability + reauth.\n// ===========================================================================\n\nexport const SafetyReviewerCapabilitySchema = z.enum([\n 'nciiRequestReviewer',\n 'nciiEvidenceReviewer',\n 'nciiAppealReviewer',\n 'childSafetyReviewer',\n 'legalDispositionAuthority',\n]);\nexport type SafetyReviewerCapability = z.infer<typeof SafetyReviewerCapabilitySchema>;\n\n// ===========================================================================\n// A7 — Registration-completion outcome (DOMAIN enum; replaces the unsafe\n// generic gRPC retryable/terminal code lists). Only a domain outcome feeds the\n// orphan-Auth deletion policy.\n// ===========================================================================\n\nexport const RegistrationCompletionOutcomeSchema = z.enum([\n 'completed',\n 'alreadyCompletedSameUid',\n 'retryableInfrastructureFailure',\n 'reauthenticationRequired',\n 'appCheckRetryRequired',\n 'nonceExpired',\n 'nonceUnknown',\n 'nonceConsumedDifferentUid',\n 'sessionHashMismatch',\n 'attestationSignatureInvalid',\n 'privateDataConflict',\n 'policyVersionRejected',\n]);\nexport type RegistrationCompletionOutcome = z.infer<typeof RegistrationCompletionOutcomeSchema>;\n\n// ===========================================================================\n// A11 — NCII / TAKE IT DOWN shared vocabularies (consumed by BOTH NCII clusters)\n// ===========================================================================\n\n/** Closed enum of required field codes — completeness + public missing-fields. */\nexport const TakeItDownFieldCodeSchema = z.enum([\n 'requesterName',\n 'contactEmail',\n 'contactPhone',\n 'requesterRole',\n 'electronicSignature',\n 'authorityBasis',\n 'authorityCertification',\n 'authorityEvidence',\n 'targetLocator',\n 'nonconsentStatement',\n 'supportingFacts',\n 'goodFaithCertification',\n]);\nexport type TakeItDownFieldCode = z.infer<typeof TakeItDownFieldCodeSchema>;\n\n/** Closed PUBLIC-SAFE reason codes — never reveal evidence/uploader/crossover. */\nexport const TakeItDownPublicReasonCodeSchema = z.enum([\n 'needMoreInformation',\n 'couldNotVerifyRequesterRole',\n 'couldNotLocateContent',\n 'outsideCoveredScope',\n 'duplicateOfExistingRequest',\n 'removedSuccessfully',\n 'underReview',\n 'closedSeeNotice',\n]);\nexport type TakeItDownPublicReasonCode = z.infer<typeof TakeItDownPublicReasonCodeSchema>;\n\n/** Validity-failure reason codes ([H2]). `incomplete` is a COMPLETENESS state,\n * NEVER a validity state. */\nexport const TakeItDownInvalidReasonCodeSchema = z.enum([\n 'missingSignature',\n 'missingLocator',\n 'missingNonconsentStatement',\n 'missingContactInformation',\n 'requesterNotDepictedPersonOrAuthorizedRepresentative',\n 'authorityNotEstablished',\n 'locatorNotResolvableAfterReasonableEffort',\n 'requestOutsideCoveredDepiction',\n 'duplicateSuperseded',\n 'fraudulentOrBadFaith',\n 'otherCounselApproved',\n]);\nexport type TakeItDownInvalidReasonCode = z.infer<typeof TakeItDownInvalidReasonCodeSchema>;\n\n/** Requester role (depicted person vs authorized representative). */\nexport const TakeItDownRequesterRoleSchema = z.enum(['depictedPerson', 'authorizedRepresentative']);\nexport type TakeItDownRequesterRole = z.infer<typeof TakeItDownRequesterRoleSchema>;\n\n/** Two-axis state: completeness vs validity (H2). */\nexport const TakeItDownCompletenessStatusSchema = z.enum(['incomplete', 'complete']);\nexport type TakeItDownCompletenessStatus = z.infer<typeof TakeItDownCompletenessStatusSchema>;\n\nexport const TakeItDownValidityStatusSchema = z.enum(['pending', 'valid', 'invalid', 'unableToLocate']);\nexport type TakeItDownValidityStatus = z.infer<typeof TakeItDownValidityStatusSchema>;\n\n/** The public no-login status-page status set (root + statusProjection). No\n * appeal model — no `appealedCorrected` (the appeal/reinstatement flow was\n * removed; protected reports have no uploader appeal/notice/reinstatement). */\nexport const TakeItDownPublicStatusSchema = z.enum([\n 'received',\n 'needsMoreInfo',\n 'validInProgress',\n 'completed',\n 'unableToLocate',\n 'invalidGeneralReason',\n]);\nexport type TakeItDownPublicStatus = z.infer<typeof TakeItDownPublicStatusSchema>;\n\n/** Request action types ([L1]). */\nexport const NciiActionTypeSchema = z.enum([\n 'intakeReceived',\n 'completenessDecided',\n 'validityDecided',\n 'tempHoldPlaced',\n 'tempHoldReleased',\n 'removalStarted',\n 'removalCompleted',\n 'hashBlockReversed',\n 'childSafetyCaseLinked',\n 'legalDispositionRecorded',\n]);\nexport type NciiActionType = z.infer<typeof NciiActionTypeSchema>;\n\nexport const NciiActionResultSchema = z.enum(['succeeded', 'failed', 'deferred', 'rejected']);\nexport type NciiActionResult = z.infer<typeof NciiActionResultSchema>;\n\n/** Honest derived completion ([H4]) — never 'completed' for a partial failure. */\nexport const NciiRemovalCompletionOutcomeSchema = z.enum([\n 'completed',\n 'completedWithApprovedException',\n 'unableToComplete',\n]);\nexport type NciiRemovalCompletionOutcome = z.infer<typeof NciiRemovalCompletionOutcomeSchema>;\n\nexport const NciiTargetSurfaceSchema = z.enum([\n 'original',\n 'hallCopy',\n 'profileMedia',\n // A conversation's Conversation File copy — replaced the removed `chatAttachment`\n // surface (chat messages no longer carry media).\n 'conversationFile',\n 'variant',\n 'cacheServing',\n 'exactHashMatch',\n]);\nexport type NciiTargetSurface = z.infer<typeof NciiTargetSurfaceSchema>;\n\nexport const NciiTargetOutcomeSchema = z.enum([\n 'pending',\n 'removed',\n 'tombstoned',\n 'verifiedGone',\n 'leftoverRetrying',\n 'unableToComplete',\n 'terminalException',\n]);\nexport type NciiTargetOutcome = z.infer<typeof NciiTargetOutcomeSchema>;\n\n/** CLOSED terminal-exception enum — a technical outage is NOT an exception. */\nexport const NciiTerminalExceptionSchema = z.enum([\n 'legallyPermittedRetention',\n 'contentNotPresentVerified',\n 'counselApprovedException',\n]);\nexport type NciiTerminalException = z.infer<typeof NciiTerminalExceptionSchema>;\n\n/** Internal operational case status ([H7]).\n *\n * [R12] close-lifecycle states: clicking **Close** (after the strict-closable gate passes)\n * applies the staged actions and moves the case to `processing` — it STAYS pinned/in-queue,\n * NEVER cleared on the click. The NCII removal worker flips the case to the terminal `closed`\n * ONLY on VERIFIED removal completion (clearing the pin via onSafetyCaseClosed). If the\n * removal saga exhausts its retries (dead-letter), the case moves to `failed` — kept pinned,\n * surfaced in the Safety Console failed-jobs view, with a Restart that re-arms the job. Both\n * are explicit values (never derived). */\nexport const NciiInternalStatusSchema = z.enum([\n 'open',\n 'removalInProgress',\n 'processing',\n 'failed',\n 'removed',\n 'rejected',\n 'closed',\n]);\nexport type NciiInternalStatus = z.infer<typeof NciiInternalStatusSchema>;\n\n/** Child-safety linkage status on an NCII case ([H7]). */\nexport const NciiChildSafetyLinkStatusSchema = z.enum([\n 'none',\n 'assessmentPending',\n 'linked',\n 'resolvedNoChildSafetyCase',\n]);\nexport type NciiChildSafetyLinkStatus = z.infer<typeof NciiChildSafetyLinkStatusSchema>;\n\n// ===========================================================================\n// A11 [F4] — child-safety crossover (possible-minor ≠ automatic CSAM).\n// Embedded on nciiCases. childSafetyCaseId lives HERE (one canonical place).\n// ===========================================================================\n\nexport const NciiMinorAssessmentSchema = z.enum(['adult', 'unknown', 'possibleMinor', 'confirmedMinor']);\nexport type NciiMinorAssessment = z.infer<typeof NciiMinorAssessmentSchema>;\n\nexport const NciiCsamAssessmentSchema = z.enum([\n 'notAssessed',\n 'notApparent',\n 'apparentViolation',\n 'validatedHashMatch',\n]);\nexport type NciiCsamAssessment = z.infer<typeof NciiCsamAssessmentSchema>;\n\nexport const NciiChildSafetyCrossoverSchema = z.object({\n minorAssessment: NciiMinorAssessmentSchema,\n csamAssessment: NciiCsamAssessmentSchema,\n childSafetyCaseId: z.string().min(1).optional(),\n assessedByUid: z.string().min(1).optional(),\n assessedAt: z.number().optional(),\n}).strict();\nexport type NciiChildSafetyCrossover = z.infer<typeof NciiChildSafetyCrossoverSchema>;\n\n/** [H-2] Per-leg lifecycle status for the possible-minor crossover side-effects (serving-deny,\n * PhotoDNA) persisted on the crossover child-safety case (see ChildSafetyCaseV1.crossoverLegs).\n * `pending` is the in-transaction initial marker the assessment writes before the post-commit leg\n * runs; the leg then flips it to `done` (succeeded) or `failed` (captureException'd, awaiting a\n * reconcile/replay). A leg is ABSENT (not `pending`) when it never applied — an external / no-media\n * target has no bytes to deny or scan. */\nexport const SafetyCrossoverLegStatusSchema = z.enum(['pending', 'done', 'failed']);\nexport type SafetyCrossoverLegStatus = z.infer<typeof SafetyCrossoverLegStatusSchema>;\n"]}
|
|
@@ -109,7 +109,7 @@ export declare const SafetyResourceCommandV1Schema: z.ZodObject<{
|
|
|
109
109
|
workAsset: "workAsset";
|
|
110
110
|
auditionEntry: "auditionEntry";
|
|
111
111
|
guildInviteMessage: "guildInviteMessage";
|
|
112
|
-
|
|
112
|
+
conversationFile: "conversationFile";
|
|
113
113
|
guildChatMessage: "guildChatMessage";
|
|
114
114
|
adminWorkMessage: "adminWorkMessage";
|
|
115
115
|
url: "url";
|
|
@@ -26,6 +26,7 @@ export declare const ResolvedReportTargetV1Schema: z.ZodObject<{
|
|
|
26
26
|
"guild-invite-message": "guild-invite-message";
|
|
27
27
|
"guild-chat-message": "guild-chat-message";
|
|
28
28
|
"admin-work-message": "admin-work-message";
|
|
29
|
+
"conversation-file": "conversation-file";
|
|
29
30
|
"hall-library-item": "hall-library-item";
|
|
30
31
|
"hall-library-sub-item": "hall-library-sub-item";
|
|
31
32
|
audition: "audition";
|
|
@@ -42,7 +43,6 @@ export declare const ResolvedReportTargetV1Schema: z.ZodObject<{
|
|
|
42
43
|
mediaAssetId: z.ZodOptional<z.ZodString>;
|
|
43
44
|
channelId: z.ZodOptional<z.ZodString>;
|
|
44
45
|
messageId: z.ZodOptional<z.ZodString>;
|
|
45
|
-
attachmentId: z.ZodOptional<z.ZodString>;
|
|
46
46
|
locator: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
47
47
|
kind: z.ZodLiteral<"mediaAsset">;
|
|
48
48
|
mediaAssetId: z.ZodString;
|
|
@@ -92,10 +92,16 @@ export declare const ResolvedReportTargetV1Schema: z.ZodObject<{
|
|
|
92
92
|
channelId: z.ZodString;
|
|
93
93
|
messageId: z.ZodString;
|
|
94
94
|
}, z.core.$strict>, z.ZodObject<{
|
|
95
|
-
kind: z.ZodLiteral<"
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
95
|
+
kind: z.ZodLiteral<"conversationFile">;
|
|
96
|
+
conversation: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
97
|
+
kind: z.ZodLiteral<"guildInvite">;
|
|
98
|
+
guildInviteId: z.ZodString;
|
|
99
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
100
|
+
kind: z.ZodLiteral<"adminSupport">;
|
|
101
|
+
adminDispatchId: z.ZodString;
|
|
102
|
+
}, z.core.$strict>], "kind">;
|
|
103
|
+
conversationFileId: z.ZodString;
|
|
104
|
+
mediaAssetId: z.ZodString;
|
|
99
105
|
}, z.core.$strict>, z.ZodObject<{
|
|
100
106
|
kind: z.ZodLiteral<"guildChatMessage">;
|
|
101
107
|
channelId: z.ZodString;
|
|
@@ -128,6 +134,7 @@ export declare const ReportTargetSnapshotV1Schema: z.ZodObject<{
|
|
|
128
134
|
"guild-invite-message": "guild-invite-message";
|
|
129
135
|
"guild-chat-message": "guild-chat-message";
|
|
130
136
|
"admin-work-message": "admin-work-message";
|
|
137
|
+
"conversation-file": "conversation-file";
|
|
131
138
|
"hall-library-item": "hall-library-item";
|
|
132
139
|
"hall-library-sub-item": "hall-library-sub-item";
|
|
133
140
|
audition: "audition";
|
|
@@ -200,6 +207,7 @@ export declare const ProtectedReportRootV1Schema: z.ZodObject<{
|
|
|
200
207
|
"guild-invite-message": "guild-invite-message";
|
|
201
208
|
"guild-chat-message": "guild-chat-message";
|
|
202
209
|
"admin-work-message": "admin-work-message";
|
|
210
|
+
"conversation-file": "conversation-file";
|
|
203
211
|
"hall-library-item": "hall-library-item";
|
|
204
212
|
"hall-library-sub-item": "hall-library-sub-item";
|
|
205
213
|
audition: "audition";
|
|
@@ -216,7 +224,6 @@ export declare const ProtectedReportRootV1Schema: z.ZodObject<{
|
|
|
216
224
|
mediaAssetId: z.ZodOptional<z.ZodString>;
|
|
217
225
|
channelId: z.ZodOptional<z.ZodString>;
|
|
218
226
|
messageId: z.ZodOptional<z.ZodString>;
|
|
219
|
-
attachmentId: z.ZodOptional<z.ZodString>;
|
|
220
227
|
locator: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
221
228
|
kind: z.ZodLiteral<"mediaAsset">;
|
|
222
229
|
mediaAssetId: z.ZodString;
|
|
@@ -266,10 +273,16 @@ export declare const ProtectedReportRootV1Schema: z.ZodObject<{
|
|
|
266
273
|
channelId: z.ZodString;
|
|
267
274
|
messageId: z.ZodString;
|
|
268
275
|
}, z.core.$strict>, z.ZodObject<{
|
|
269
|
-
kind: z.ZodLiteral<"
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
276
|
+
kind: z.ZodLiteral<"conversationFile">;
|
|
277
|
+
conversation: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
278
|
+
kind: z.ZodLiteral<"guildInvite">;
|
|
279
|
+
guildInviteId: z.ZodString;
|
|
280
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
281
|
+
kind: z.ZodLiteral<"adminSupport">;
|
|
282
|
+
adminDispatchId: z.ZodString;
|
|
283
|
+
}, z.core.$strict>], "kind">;
|
|
284
|
+
conversationFileId: z.ZodString;
|
|
285
|
+
mediaAssetId: z.ZodString;
|
|
273
286
|
}, z.core.$strict>, z.ZodObject<{
|
|
274
287
|
kind: z.ZodLiteral<"guildChatMessage">;
|
|
275
288
|
channelId: z.ZodString;
|
|
@@ -318,6 +331,7 @@ export declare const ReportPublicProjectionV1Schema: z.ZodObject<{
|
|
|
318
331
|
"guild-invite-message": "guild-invite-message";
|
|
319
332
|
"guild-chat-message": "guild-chat-message";
|
|
320
333
|
"admin-work-message": "admin-work-message";
|
|
334
|
+
"conversation-file": "conversation-file";
|
|
321
335
|
"hall-library-item": "hall-library-item";
|
|
322
336
|
"hall-library-sub-item": "hall-library-sub-item";
|
|
323
337
|
audition: "audition";
|
|
@@ -367,6 +381,7 @@ export declare const ReportGroupV1Schema: z.ZodObject<{
|
|
|
367
381
|
"guild-invite-message": "guild-invite-message";
|
|
368
382
|
"guild-chat-message": "guild-chat-message";
|
|
369
383
|
"admin-work-message": "admin-work-message";
|
|
384
|
+
"conversation-file": "conversation-file";
|
|
370
385
|
"hall-library-item": "hall-library-item";
|
|
371
386
|
"hall-library-sub-item": "hall-library-sub-item";
|
|
372
387
|
audition: "audition";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../../src/doc-schemas/safety/report.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAmBxB;;;;;;;;;;;wDAWwD;AACxD,eAAO,MAAM,4BAA4B,OAAO,CAAC;AAMjD;sFACsF;AACtF,eAAO,MAAM,4BAA4B
|
|
1
|
+
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../../src/doc-schemas/safety/report.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAmBxB;;;;;;;;;;;wDAWwD;AACxD,eAAO,MAAM,4BAA4B,OAAO,CAAC;AAMjD;sFACsF;AACtF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAgB9B,CAAC;AACZ,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAMlF;wBACwB;AACxB,eA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54
54
|
channelId: z.string().optional(),
|
|
55
55
|
messageId: z.string().optional(),
|
|
56
|
-
attachmentId:
|
|
56
|
+
// (There is no `attachmentId` mirror: chat carries no media, and a Conversation File is
|
|
57
|
+
// identified by its `conversationFile` locator + the `mediaAssetId` field above.)
|
|
57
58
|
locator: TargetLocatorV1Schema, // the §A11 discriminated locator for downstream hold/removal
|
|
58
59
|
resolvedAt: z.number(),
|
|
59
60
|
}).strict();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report.js","sourceRoot":"","sources":["../../../src/doc-schemas/safety/report.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,EAAE;AACF,sFAAsF;AACtF,mFAAmF;AACnF,iFAAiF;AACjF,yEAAyE;AACzE,mDAAmD;AACnD,EAAE;AACF,qFAAqF;AACrF,4DAA4D;AAC5D,EAAE;AACF,sEAAsE;AACtE,yFAAyF;AACzF,4EAA4E;AAC5E,0FAA0F;AAC1F,oDAAoD;AAEpD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,2BAA2B,EAC3B,+BAA+B,GAChC,MAAM,6BAA6B,CAAC;AAErC,8EAA8E;AAC9E,8EAA8E;AAC9E,+EAA+E;AAC/E,6EAA6E;AAC7E,iCAAiC;AACjC,8EAA8E;AAE9E;;;;;;;;;;;wDAWwD;AACxD,MAAM,CAAC,MAAM,4BAA4B,GAAG,IAAI,CAAC;AAEjD,8EAA8E;AAC9E,uDAAuD;AACvD,8EAA8E;AAE9E;sFACsF;AACtF,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IACnD,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3B,QAAQ,EAAE,wBAAwB;IAClC,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAA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AkB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC9B,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,YAAY,EAAE,kBAAkB;IAChC,iGAAiG;IACjG,mGAAmG;IACnG,oGAAoG;IACpG,oGAAoG;IACpG,qGAAqG;IACrG,6DAA6D;IAC7D,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;CAC7E,CAAC,CAAC,MAAM,EAAE,CAAC;AAGZ,8EAA8E;AAC9E,2EAA2E;AAC3E,2EAA2E;AAC3E,oFAAoF;AACpF,EAAE;AACF,sFAAsF;AACtF,gFAAgF;AAChF,wFAAwF;AACxF,4FAA4F;AAC5F,4FAA4F;AAC5F,4FAA4F;AAC5F,yFAAyF;AACzF,yFAAyF;AACzF,0FAA0F;AAC1F,2FAA2F;AAC3F,EAAE;AACF,0FAA0F;AAC1F,4FAA4F;AAC5F,0FAA0F;AAC1F,mFAAmF;AACnF,EAAE;AACF,4CAA4C;AAC5C,qFAAqF;AACrF,8EAA8E","sourcesContent":["// Trust & Safety — the report spine (Appendix A §A1, Finding-H1).\n//\n// The canonical report-target contract produced by the server `resolveReportTarget()`\n// resolver plus the protected report root + public projection. Every shape here is\n// transcribed verbatim from the frozen Trust & Safety spec (Appendix A §A1) — no\n// invented values, no placeholders; the durable design owner is ttt-prod\n// docs/design/content-moderation-and-reporting.md.\n//\n// SHARED enums + the target locator come from ./foundation.js (the single source for\n// every cross-cluster enum); they are NEVER redefined here.\n//\n// Collection bindings (../registry.ts): `contentReports/{reportId}` →\n// `ProtectedReportRootV1Schema`, `contentReports/{reportId}/publicProjection/{reportId}`\n// → `ReportPublicProjectionV1Schema`, and `activeReportGroups/{groupKey}` →\n// `ReportGroupV1Schema`. These REPLACED the legacy loose-string report/group schemas; the\n// report DOC shape now lives entirely in this file.\n\nimport { z } from 'zod';\nimport {\n ReportReasonSchema,\n ReportableItemTypeSchema,\n ProtectedForkSchema,\n TargetLocatorV1Schema,\n} from './foundation.js';\nimport {\n MAX_REPORT_NARRATIVE_LENGTH,\n MAX_REPORT_SNAPSHOT_TEXT_LENGTH,\n} from '../../constants/business.js';\n\n// ===========================================================================\n// Canonical-key version token. The key formulas are DEFINED below as comments\n// (deterministic IDs are documented, never computed in this schema layer); the\n// server resolver/writer computes them. Bump this token if any formula input\n// set or hashing scheme changes.\n// ===========================================================================\n\n/** Version token folded into every canonical key formula below.\n *\n * v2 (pre-launch, no migration): two coordinated formula-input changes ride this\n * single bump —\n * (1) `canonicalTargetKey` composition is now INJECTIVE: each field is\n * length-prefixed (`len:value`) before joining, so no pair of adjacent\n * attacker-controlled fields (chat `canonicalParentPath` + `canonicalItemId`)\n * can produce a colliding preimage across different (channel, message) pairs.\n * (2) `revision` is derived from CONTENT-relevant state only (the content-edit\n * stamp `updatedAt`, falling back to `createdAt`) — NEVER the Firestore write\n * clock (`updateTime`). Counter writes (likes/votes/follows) no longer fragment\n * report groups or defeat per-reporter dedupe. */\nexport const REPORT_CANONICAL_KEY_VERSION = 'v2';\n\n// ===========================================================================\n// A1 — Server resolver result (ResolvedReportTargetV1)\n// ===========================================================================\n\n/** The server resolver result. The client `reportedItemId`/`reportedUserId` are\n * hints only; every field here is re-derived server-side at the reported revision. */\nexport const ResolvedReportTargetV1Schema = z.object({\n schemaVersion: z.literal(1),\n itemType: ReportableItemTypeSchema,\n canonicalParentPath: z.string(), // server-derived parent doc path\n canonicalItemId: z.string(), // server-derived item id (NEVER the client hint)\n revision: z.number(), // reported content revision — derived from the content-edit stamp\n // (updatedAt, falling back to createdAt), NEVER the write clock (updateTime)\n ownerUid: z.string(), // server-derived owner/sender uid (NOT client-supplied)\n ownerBlockKey: z.string(), // derived owner block key\n mediaAssetId: z.string().optional(), // typed per surface\n channelId: z.string().optional(),\n messageId: z.string().optional(),\n attachmentId: z.string().optional(),\n locator: TargetLocatorV1Schema, // the §A11 discriminated locator for downstream hold/removal\n resolvedAt: z.number(),\n}).strict();\nexport type ResolvedReportTargetV1 = z.infer<typeof ResolvedReportTargetV1Schema>;\n\n// ===========================================================================\n// A1 — Sanitized frozen snapshot (ReportTargetSnapshotV1)\n// ===========================================================================\n\n/** The sanitized frozen snapshot captured at resolve time — no reporter identity,\n * no PII; immutable. */\nexport const ReportTargetSnapshotV1Schema = z.object({\n schemaVersion: z.literal(1),\n itemType: ReportableItemTypeSchema,\n canonicalItemId: z.string(),\n revision: z.number(),\n contentSummaryRef: z.string(), // pointer to a sanitized content snapshot (restricted)\n contentHashes: z.array(z.string()).max(16).optional(),\n // [H-11/EUAS-013/R14] The sanitized REPORTED CONTENT captured at report time, so an author can't edit\n // the violating text/media out before review and have the operator see only the cleaned live doc\n // (edit-to-evade). `capturedText` = the bounded reported text/title/description (NO PII);\n // `capturedMediaAssetIds` = the reported media asset ids. Frozen + immutable like the rest.\n capturedText: z.string().max(MAX_REPORT_SNAPSHOT_TEXT_LENGTH).optional(),\n capturedMediaAssetIds: z.array(z.string()).max(32).optional(),\n capturedAt: z.number(),\n}).strict();\nexport type ReportTargetSnapshotV1 = z.infer<typeof ReportTargetSnapshotV1Schema>;\n\n// ===========================================================================\n// A1 — Segregated reporter narrative (NarrativeRecordV1)\n// ===========================================================================\n\n/** The reporter's free-text narrative — segregated reporter PII. Lives in a\n * restricted subcollection (`contentReports/{reportId}/private/narrative`),\n * admin-read-only, client-write-forbidden; NEVER inlined on the report root or\n * the public projection. The frozen target snapshot is stored alongside it at\n * `contentReports/{reportId}/private/snapshot` (ReportTargetSnapshotV1). */\nexport const NarrativeRecordV1Schema = z.object({\n schemaVersion: z.literal(1),\n reportId: z.string().min(1),\n reporterUid: z.string().min(1), // stored so account-erasure can scrub the narrative\n text: z.string().min(1).max(MAX_REPORT_NARRATIVE_LENGTH),\n createdAt: z.number(),\n}).strict();\nexport type NarrativeRecordV1 = z.infer<typeof NarrativeRecordV1Schema>;\n\n// ===========================================================================\n// A1 — Protected report root (ProtectedReportRootV1)\n// ===========================================================================\n\n/** Cluster-local lifecycle status of the protected report root. */\nexport const ProtectedReportRootStatusSchema = z.enum([\n 'pending_review',\n 'grouped',\n 'actioned',\n 'dismissed',\n]);\nexport type ProtectedReportRootStatus = z.infer<typeof ProtectedReportRootStatusSchema>;\n\n/** The protected report root (restricted — reporter identity + narrative segregated).\n * FUTURE shape of the EXISTING `contentReports/{reportId}` collection (rebinding\n * deferred to the app leg). `protectedFork` is set ONLY by the protected branch\n * (Phase 1 step 2a). */\nexport const ProtectedReportRootV1Schema = z.object({\n schemaVersion: z.literal(1),\n reportId: z.string().min(1), // = sha256(lp(version) + lp(reporterUid) + lp(canonicalTargetKey)) — see injective formulas below\n reporterUid: z.string().min(1),\n reason: ReportReasonSchema,\n resolvedTarget: ResolvedReportTargetV1Schema,\n snapshotRef: z.string(), // → ReportTargetSnapshotV1\n canonicalTargetKey: z.string(), // see formula below\n narrativeRef: z.string().optional(),\n protectedFork: ProtectedForkSchema.optional(), // set ONLY by the protected branch (Phase 1 step 2a)\n status: ProtectedReportRootStatusSchema,\n createdAt: z.number(),\n updatedAt: z.number(),\n}).strict();\nexport type ProtectedReportRootV1 = z.infer<typeof ProtectedReportRootV1Schema>;\n\n// ===========================================================================\n// A1 — Public projection (ReportPublicProjectionV1)\n// ===========================================================================\n\n/** Public projection — no reporter identity / narrative. */\nexport const ReportPublicProjectionV1Schema = z.object({\n schemaVersion: z.literal(1),\n reportId: z.string().min(1),\n itemType: ReportableItemTypeSchema,\n reason: ReportReasonSchema,\n status: ProtectedReportRootStatusSchema,\n createdAt: z.number(),\n}).strict();\nexport type ReportPublicProjectionV1 = z.infer<typeof ReportPublicProjectionV1Schema>;\n\n// ===========================================================================\n// A1 — Report group (ReportGroupV1) — dedup/count group keyed by canonicalTargetKey\n// ===========================================================================\n\n/** The dedup/count group for all reports of the same target+revision. The group key\n * IS the `canonicalTargetKey` (== reportGroupKey). NO trusted client owner field — the\n * owner lives on the restricted ProtectedReportRootV1 (resolvedTarget.ownerUid), never\n * here. An app-side trigger maintains the counts; this is the public-ish group surface\n * the admin browse + admin-task queue read. Bound to `activeReportGroups/{groupKey}`. */\nexport const ReportGroupV1Schema = z.object({\n schemaVersion: z.literal(1),\n groupKey: z.string().min(1), // = canonicalTargetKey\n itemType: ReportableItemTypeSchema,\n totalReports: z.number(),\n highestReasonScore: z.number(),\n lastReportAt: z.number(),\n latestReason: ReportReasonSchema,\n // [R12] close-lifecycle states. An ordinary report's admin close (hide/remove/restore) moves the\n // group to `processing` and STAYS in the queue — it is NEVER cleared on the click. The group flips\n // to the terminal `resolved` ONLY when the edge serving-deny (hide/remove) or block-clear (restore)\n // VERIFIES. If the content-serving-sync saga exhausts its retries (dead-letter), the group moves to\n // `failed` — kept in the queue, surfaced in the Safety Console failed-jobs view, with a Restart that\n // re-arms the job. Both are explicit values (never derived).\n status: z.enum(['pending', 'reviewing', 'processing', 'failed', 'resolved']),\n}).strict();\nexport type ReportGroupV1 = z.infer<typeof ReportGroupV1Schema>;\n\n// ===========================================================================\n// Canonical keys (DEFINED — not inline prose). Computed server-side by the\n// resolver/writer; documented here, NOT computed in this schema layer. The\n// `version` token in each formula is `REPORT_CANONICAL_KEY_VERSION` above (now v2).\n//\n// canonicalTargetKey = sha256( lp(version) + lp(itemType) + lp(canonicalParentPath)\n// + lp(canonicalItemId) + lp(String(revision)) )\n// // v2: INJECTIVE composition. lp(s) length-prefixes each field\n// // as `<byteLength>:<s>` (or hash each field separately) so no ':'\n// // ambiguity can straddle two adjacent attacker-controlled fields.\n// // The old `[...].join(':')` was collision-prone for chat targets,\n// // whose canonicalParentPath + canonicalItemId are BOTH client-\n// // derived strings (synthetic:chat:<channelRef> / <messageId>).\n// // `revision` is the CONTENT revision (content-edit stamp, never\n// // the Firestore write clock) — see REPORT_CANONICAL_KEY_VERSION.\n//\n// reportId = sha256( lp(version) + lp(reporterUid) + lp(canonicalTargetKey) )\n// // deterministic dup-key: one report per reporter+target+revision.\n// // This determinism is what makes the protected branch's retry a\n// // no-op on the already-committed hold (Phase 1 step 2a).\n//\n// reportGroupKey = canonicalTargetKey\n// // grouping key: all reporters of the same target+revision.\n// ===========================================================================\n"]}
|
|
1
|
+
{"version":3,"file":"report.js","sourceRoot":"","sources":["../../../src/doc-schemas/safety/report.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,EAAE;AACF,sFAAsF;AACtF,mFAAmF;AACnF,iFAAiF;AACjF,yEAAyE;AACzE,mDAAmD;AACnD,EAAE;AACF,qFAAqF;AACrF,4DAA4D;AAC5D,EAAE;AACF,sEAAsE;AACtE,yFAAyF;AACzF,4EAA4E;AAC5E,0FAA0F;AAC1F,oDAAoD;AAEpD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,2BAA2B,EAC3B,+BAA+B,GAChC,MAAM,6BAA6B,CAAC;AAErC,8EAA8E;AAC9E,8EAA8E;AAC9E,+EAA+E;AAC/E,6EAA6E;AAC7E,iCAAiC;AACjC,8EAA8E;AAE9E;;;;;;;;;;;wDAWwD;AACxD,MAAM,CAAC,MAAM,4BAA4B,GAAG,IAAI,CAAC;AAEjD,8EAA8E;AAC9E,uDAAuD;AACvD,8EAA8E;AAE9E;sFACsF;AACtF,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IACnD,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3B,QAAQ,EAAE,wBAAwB;IAClC,mBAAmB,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,iCAAiC;IAClE,eAAe,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,iDAAiD;IAC9E,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,kEAAkE;IAClE,6EAA6E;IACnG,QAAQ,EAAE,CAAC,CAAC,MAAM,E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AAC,IAAI,CAAC,CAAC,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;CAC7E,CAAC,CAAC,MAAM,EAAE,CAAC;AAGZ,8EAA8E;AAC9E,2EAA2E;AAC3E,2EAA2E;AAC3E,oFAAoF;AACpF,EAAE;AACF,sFAAsF;AACtF,gFAAgF;AAChF,wFAAwF;AACxF,4FAA4F;AAC5F,4FAA4F;AAC5F,4FAA4F;AAC5F,yFAAyF;AACzF,yFAAyF;AACzF,0FAA0F;AAC1F,2FAA2F;AAC3F,EAAE;AACF,0FAA0F;AAC1F,4FAA4F;AAC5F,0FAA0F;AAC1F,mFAAmF;AACnF,EAAE;AACF,4CAA4C;AAC5C,qFAAqF;AACrF,8EAA8E","sourcesContent":["// Trust & Safety — the report spine (Appendix A §A1, Finding-H1).\n//\n// The canonical report-target contract produced by the server `resolveReportTarget()`\n// resolver plus the protected report root + public projection. Every shape here is\n// transcribed verbatim from the frozen Trust & Safety spec (Appendix A §A1) — no\n// invented values, no placeholders; the durable design owner is ttt-prod\n// docs/design/content-moderation-and-reporting.md.\n//\n// SHARED enums + the target locator come from ./foundation.js (the single source for\n// every cross-cluster enum); they are NEVER redefined here.\n//\n// Collection bindings (../registry.ts): `contentReports/{reportId}` →\n// `ProtectedReportRootV1Schema`, `contentReports/{reportId}/publicProjection/{reportId}`\n// → `ReportPublicProjectionV1Schema`, and `activeReportGroups/{groupKey}` →\n// `ReportGroupV1Schema`. These REPLACED the legacy loose-string report/group schemas; the\n// report DOC shape now lives entirely in this file.\n\nimport { z } from 'zod';\nimport {\n ReportReasonSchema,\n ReportableItemTypeSchema,\n ProtectedForkSchema,\n TargetLocatorV1Schema,\n} from './foundation.js';\nimport {\n MAX_REPORT_NARRATIVE_LENGTH,\n MAX_REPORT_SNAPSHOT_TEXT_LENGTH,\n} from '../../constants/business.js';\n\n// ===========================================================================\n// Canonical-key version token. The key formulas are DEFINED below as comments\n// (deterministic IDs are documented, never computed in this schema layer); the\n// server resolver/writer computes them. Bump this token if any formula input\n// set or hashing scheme changes.\n// ===========================================================================\n\n/** Version token folded into every canonical key formula below.\n *\n * v2 (pre-launch, no migration): two coordinated formula-input changes ride this\n * single bump —\n * (1) `canonicalTargetKey` composition is now INJECTIVE: each field is\n * length-prefixed (`len:value`) before joining, so no pair of adjacent\n * attacker-controlled fields (chat `canonicalParentPath` + `canonicalItemId`)\n * can produce a colliding preimage across different (channel, message) pairs.\n * (2) `revision` is derived from CONTENT-relevant state only (the content-edit\n * stamp `updatedAt`, falling back to `createdAt`) — NEVER the Firestore write\n * clock (`updateTime`). Counter writes (likes/votes/follows) no longer fragment\n * report groups or defeat per-reporter dedupe. */\nexport const REPORT_CANONICAL_KEY_VERSION = 'v2';\n\n// ===========================================================================\n// A1 — Server resolver result (ResolvedReportTargetV1)\n// ===========================================================================\n\n/** The server resolver result. The client `reportedItemId`/`reportedUserId` are\n * hints only; every field here is re-derived server-side at the reported revision. */\nexport const ResolvedReportTargetV1Schema = z.object({\n schemaVersion: z.literal(1),\n itemType: ReportableItemTypeSchema,\n canonicalParentPath: z.string(), // server-derived parent doc path\n canonicalItemId: z.string(), // server-derived item id (NEVER the client hint)\n revision: z.number(), // reported content revision — derived from the content-edit stamp\n // (updatedAt, falling back to createdAt), NEVER the write clock (updateTime)\n ownerUid: z.string(), // server-derived owner/sender uid (NOT client-supplied)\n ownerBlockKey: z.string(), // derived owner block key\n mediaAssetId: z.string().optional(), // typed per surface\n channelId: z.string().optional(),\n messageId: z.string().optional(),\n // (There is no `attachmentId` mirror: chat carries no media, and a Conversation File is\n // identified by its `conversationFile` locator + the `mediaAssetId` field above.)\n locator: TargetLocatorV1Schema, // the §A11 discriminated locator for downstream hold/removal\n resolvedAt: z.number(),\n}).strict();\nexport type ResolvedReportTargetV1 = z.infer<typeof ResolvedReportTargetV1Schema>;\n\n// ===========================================================================\n// A1 — Sanitized frozen snapshot (ReportTargetSnapshotV1)\n// ===========================================================================\n\n/** The sanitized frozen snapshot captured at resolve time — no reporter identity,\n * no PII; immutable. */\nexport const ReportTargetSnapshotV1Schema = z.object({\n schemaVersion: z.literal(1),\n itemType: ReportableItemTypeSchema,\n canonicalItemId: z.string(),\n revision: z.number(),\n contentSummaryRef: z.string(), // pointer to a sanitized content snapshot (restricted)\n contentHashes: z.array(z.string()).max(16).optional(),\n // [H-11/EUAS-013/R14] The sanitized REPORTED CONTENT captured at report time, so an author can't edit\n // the violating text/media out before review and have the operator see only the cleaned live doc\n // (edit-to-evade). `capturedText` = the bounded reported text/title/description (NO PII);\n // `capturedMediaAssetIds` = the reported media asset ids. Frozen + immutable like the rest.\n capturedText: z.string().max(MAX_REPORT_SNAPSHOT_TEXT_LENGTH).optional(),\n capturedMediaAssetIds: z.array(z.string()).max(32).optional(),\n capturedAt: z.number(),\n}).strict();\nexport type ReportTargetSnapshotV1 = z.infer<typeof ReportTargetSnapshotV1Schema>;\n\n// ===========================================================================\n// A1 — Segregated reporter narrative (NarrativeRecordV1)\n// ===========================================================================\n\n/** The reporter's free-text narrative — segregated reporter PII. Lives in a\n * restricted subcollection (`contentReports/{reportId}/private/narrative`),\n * admin-read-only, client-write-forbidden; NEVER inlined on the report root or\n * the public projection. The frozen target snapshot is stored alongside it at\n * `contentReports/{reportId}/private/snapshot` (ReportTargetSnapshotV1). */\nexport const NarrativeRecordV1Schema = z.object({\n schemaVersion: z.literal(1),\n reportId: z.string().min(1),\n reporterUid: z.string().min(1), // stored so account-erasure can scrub the narrative\n text: z.string().min(1).max(MAX_REPORT_NARRATIVE_LENGTH),\n createdAt: z.number(),\n}).strict();\nexport type NarrativeRecordV1 = z.infer<typeof NarrativeRecordV1Schema>;\n\n// ===========================================================================\n// A1 — Protected report root (ProtectedReportRootV1)\n// ===========================================================================\n\n/** Cluster-local lifecycle status of the protected report root. */\nexport const ProtectedReportRootStatusSchema = z.enum([\n 'pending_review',\n 'grouped',\n 'actioned',\n 'dismissed',\n]);\nexport type ProtectedReportRootStatus = z.infer<typeof ProtectedReportRootStatusSchema>;\n\n/** The protected report root (restricted — reporter identity + narrative segregated).\n * FUTURE shape of the EXISTING `contentReports/{reportId}` collection (rebinding\n * deferred to the app leg). `protectedFork` is set ONLY by the protected branch\n * (Phase 1 step 2a). */\nexport const ProtectedReportRootV1Schema = z.object({\n schemaVersion: z.literal(1),\n reportId: z.string().min(1), // = sha256(lp(version) + lp(reporterUid) + lp(canonicalTargetKey)) — see injective formulas below\n reporterUid: z.string().min(1),\n reason: ReportReasonSchema,\n resolvedTarget: ResolvedReportTargetV1Schema,\n snapshotRef: z.string(), // → ReportTargetSnapshotV1\n canonicalTargetKey: z.string(), // see formula below\n narrativeRef: z.string().optional(),\n protectedFork: ProtectedForkSchema.optional(), // set ONLY by the protected branch (Phase 1 step 2a)\n status: ProtectedReportRootStatusSchema,\n createdAt: z.number(),\n updatedAt: z.number(),\n}).strict();\nexport type ProtectedReportRootV1 = z.infer<typeof ProtectedReportRootV1Schema>;\n\n// ===========================================================================\n// A1 — Public projection (ReportPublicProjectionV1)\n// ===========================================================================\n\n/** Public projection — no reporter identity / narrative. */\nexport const ReportPublicProjectionV1Schema = z.object({\n schemaVersion: z.literal(1),\n reportId: z.string().min(1),\n itemType: ReportableItemTypeSchema,\n reason: ReportReasonSchema,\n status: ProtectedReportRootStatusSchema,\n createdAt: z.number(),\n}).strict();\nexport type ReportPublicProjectionV1 = z.infer<typeof ReportPublicProjectionV1Schema>;\n\n// ===========================================================================\n// A1 — Report group (ReportGroupV1) — dedup/count group keyed by canonicalTargetKey\n// ===========================================================================\n\n/** The dedup/count group for all reports of the same target+revision. The group key\n * IS the `canonicalTargetKey` (== reportGroupKey). NO trusted client owner field — the\n * owner lives on the restricted ProtectedReportRootV1 (resolvedTarget.ownerUid), never\n * here. An app-side trigger maintains the counts; this is the public-ish group surface\n * the admin browse + admin-task queue read. Bound to `activeReportGroups/{groupKey}`. */\nexport const ReportGroupV1Schema = z.object({\n schemaVersion: z.literal(1),\n groupKey: z.string().min(1), // = canonicalTargetKey\n itemType: ReportableItemTypeSchema,\n totalReports: z.number(),\n highestReasonScore: z.number(),\n lastReportAt: z.number(),\n latestReason: ReportReasonSchema,\n // [R12] close-lifecycle states. An ordinary report's admin close (hide/remove/restore) moves the\n // group to `processing` and STAYS in the queue — it is NEVER cleared on the click. The group flips\n // to the terminal `resolved` ONLY when the edge serving-deny (hide/remove) or block-clear (restore)\n // VERIFIES. If the content-serving-sync saga exhausts its retries (dead-letter), the group moves to\n // `failed` — kept in the queue, surfaced in the Safety Console failed-jobs view, with a Restart that\n // re-arms the job. Both are explicit values (never derived).\n status: z.enum(['pending', 'reviewing', 'processing', 'failed', 'resolved']),\n}).strict();\nexport type ReportGroupV1 = z.infer<typeof ReportGroupV1Schema>;\n\n// ===========================================================================\n// Canonical keys (DEFINED — not inline prose). Computed server-side by the\n// resolver/writer; documented here, NOT computed in this schema layer. The\n// `version` token in each formula is `REPORT_CANONICAL_KEY_VERSION` above (now v2).\n//\n// canonicalTargetKey = sha256( lp(version) + lp(itemType) + lp(canonicalParentPath)\n// + lp(canonicalItemId) + lp(String(revision)) )\n// // v2: INJECTIVE composition. lp(s) length-prefixes each field\n// // as `<byteLength>:<s>` (or hash each field separately) so no ':'\n// // ambiguity can straddle two adjacent attacker-controlled fields.\n// // The old `[...].join(':')` was collision-prone for chat targets,\n// // whose canonicalParentPath + canonicalItemId are BOTH client-\n// // derived strings (synthetic:chat:<channelRef> / <messageId>).\n// // `revision` is the CONTENT revision (content-edit stamp, never\n// // the Firestore write clock) — see REPORT_CANONICAL_KEY_VERSION.\n//\n// reportId = sha256( lp(version) + lp(reporterUid) + lp(canonicalTargetKey) )\n// // deterministic dup-key: one report per reporter+target+revision.\n// // This determinism is what makes the protected branch's retry a\n// // no-op on the already-committed hold (Phase 1 step 2a).\n//\n// reportGroupKey = canonicalTargetKey\n// // grouping key: all reporters of the same target+revision.\n// ===========================================================================\n"]}
|
package/dist/ids/chat-ids.d.ts
CHANGED
|
@@ -40,9 +40,8 @@ export declare function degradedCauseId(kind: 'syncEvent' | 'fanoutJob', ref: st
|
|
|
40
40
|
export declare function channelAuthEventId(channelKeyHash: string, uid: string, channelAuthVersion: number): Promise<string>;
|
|
41
41
|
export declare function accountAccessEventId(uid: string, accountAccessVersion: number, channelKeyHash: string): Promise<string>;
|
|
42
42
|
export declare function configEventId(channelKeyHash: string, configVersion: number): Promise<string>;
|
|
43
|
-
export declare function attachmentFlipEventId(pendingMediaId: string, terminalState: string): Promise<string>;
|
|
44
43
|
export declare function serverMessageEventId(threadRef: string, sourceDocId: string): Promise<string>;
|
|
45
|
-
/** `chatMessageOutbox` commandId for invite/system messages
|
|
44
|
+
/** `chatMessageOutbox` commandId for invite/system messages. */
|
|
46
45
|
export declare function serverMessageCommandId(threadRef: string, sourceDocId: string): Promise<string>;
|
|
47
46
|
export type SyncFanoutSelectorKind = 'channelMembers' | 'workChannelsForUser' | 'policyEditAffectedUsers';
|
|
48
47
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-ids.d.ts","sourceRoot":"","sources":["../../src/ids/chat-ids.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAcH;;;;;;GAMG;AACH,wBAAgB,IAAI,CAClB,SAAS,EAAE,MAAM,EACjB,GAAG,KAAK,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,GAClD,OAAO,CAAC,MAAM,CAAC,CAGjB;AAID,6EAA6E;AAC7E,MAAM,MAAM,UAAU,GAClB;IAAE,KAAK,EAAE,SAAS,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,kBAAkB,EAAE,MAAM,CAAA;CAAE,GACvE;IAAE,KAAK,EAAE,QAAQ,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/C,yGAAyG;AACzG,wBAAgB,UAAU,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAI3D;AAED,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yBAAyB,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAE7G;AAID,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAE7G"}
|
package/dist/ids/chat-ids.js
CHANGED
|
@@ -63,13 +63,10 @@ export function accountAccessEventId(uid, accountAccessVersion, channelKeyHash)
|
|
|
63
63
|
export function configEventId(channelKeyHash, configVersion) {
|
|
64
64
|
return hash('config', channelKeyHash, configVersion);
|
|
65
65
|
}
|
|
66
|
-
export function attachmentFlipEventId(pendingMediaId, terminalState) {
|
|
67
|
-
return hash('attachment-flip', pendingMediaId, terminalState);
|
|
68
|
-
}
|
|
69
66
|
export function serverMessageEventId(threadRef, sourceDocId) {
|
|
70
67
|
return hash('server-msg', threadRef, sourceDocId);
|
|
71
68
|
}
|
|
72
|
-
/** `chatMessageOutbox` commandId for invite/system messages
|
|
69
|
+
/** `chatMessageOutbox` commandId for invite/system messages. */
|
|
73
70
|
export function serverMessageCommandId(threadRef, sourceDocId) {
|
|
74
71
|
return hash('server-msg', threadRef, sourceDocId);
|
|
75
72
|
}
|