@ttt-productions/ttt-core 0.19.0 → 0.19.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/dist/doc-schemas/chat-sync.d.ts +2 -2
  2. package/dist/doc-schemas/index.d.ts +19 -0
  3. package/dist/doc-schemas/index.d.ts.map +1 -1
  4. package/dist/doc-schemas/index.js +21 -0
  5. package/dist/doc-schemas/index.js.map +1 -1
  6. package/dist/doc-schemas/media-activation-jobs.d.ts +6 -6
  7. package/dist/doc-schemas/media-assets.d.ts +168 -14
  8. package/dist/doc-schemas/media-assets.d.ts.map +1 -1
  9. package/dist/doc-schemas/media-assets.js +60 -0
  10. package/dist/doc-schemas/media-assets.js.map +1 -1
  11. package/dist/doc-schemas/moderation.d.ts +6 -6
  12. package/dist/doc-schemas/ncii/allegations.d.ts +84 -0
  13. package/dist/doc-schemas/ncii/allegations.d.ts.map +1 -0
  14. package/dist/doc-schemas/ncii/allegations.js +45 -0
  15. package/dist/doc-schemas/ncii/allegations.js.map +1 -0
  16. package/dist/doc-schemas/ncii/appeals.d.ts +121 -0
  17. package/dist/doc-schemas/ncii/appeals.d.ts.map +1 -0
  18. package/dist/doc-schemas/ncii/appeals.js +132 -0
  19. package/dist/doc-schemas/ncii/appeals.js.map +1 -0
  20. package/dist/doc-schemas/ncii/cases.d.ts +158 -0
  21. package/dist/doc-schemas/ncii/cases.d.ts.map +1 -0
  22. package/dist/doc-schemas/ncii/cases.js +132 -0
  23. package/dist/doc-schemas/ncii/cases.js.map +1 -0
  24. package/dist/doc-schemas/ncii/config.d.ts +131 -0
  25. package/dist/doc-schemas/ncii/config.d.ts.map +1 -0
  26. package/dist/doc-schemas/ncii/config.js +227 -0
  27. package/dist/doc-schemas/ncii/config.js.map +1 -0
  28. package/dist/doc-schemas/ncii/holds.d.ts +84 -0
  29. package/dist/doc-schemas/ncii/holds.d.ts.map +1 -0
  30. package/dist/doc-schemas/ncii/holds.js +63 -0
  31. package/dist/doc-schemas/ncii/holds.js.map +1 -0
  32. package/dist/doc-schemas/ncii/notices.d.ts +109 -0
  33. package/dist/doc-schemas/ncii/notices.d.ts.map +1 -0
  34. package/dist/doc-schemas/ncii/notices.js +114 -0
  35. package/dist/doc-schemas/ncii/notices.js.map +1 -0
  36. package/dist/doc-schemas/ncii/removal.d.ts +222 -0
  37. package/dist/doc-schemas/ncii/removal.d.ts.map +1 -0
  38. package/dist/doc-schemas/ncii/removal.js +130 -0
  39. package/dist/doc-schemas/ncii/removal.js.map +1 -0
  40. package/dist/doc-schemas/ncii/requests.d.ts +372 -0
  41. package/dist/doc-schemas/ncii/requests.d.ts.map +1 -0
  42. package/dist/doc-schemas/ncii/requests.js +287 -0
  43. package/dist/doc-schemas/ncii/requests.js.map +1 -0
  44. package/dist/doc-schemas/ncii/scan.d.ts +59 -0
  45. package/dist/doc-schemas/ncii/scan.d.ts.map +1 -0
  46. package/dist/doc-schemas/ncii/scan.js +105 -0
  47. package/dist/doc-schemas/ncii/scan.js.map +1 -0
  48. package/dist/doc-schemas/notification-ledger.d.ts +1 -1
  49. package/dist/doc-schemas/payments.d.ts +2 -2
  50. package/dist/doc-schemas/registry.d.ts +1929 -96
  51. package/dist/doc-schemas/registry.d.ts.map +1 -1
  52. package/dist/doc-schemas/registry.js +86 -0
  53. package/dist/doc-schemas/registry.js.map +1 -1
  54. package/dist/doc-schemas/report-docs.d.ts +3 -3
  55. package/dist/doc-schemas/safety/age.d.ts +178 -0
  56. package/dist/doc-schemas/safety/age.d.ts.map +1 -0
  57. package/dist/doc-schemas/safety/age.js +222 -0
  58. package/dist/doc-schemas/safety/age.js.map +1 -0
  59. package/dist/doc-schemas/safety/case-aliases.d.ts +97 -0
  60. package/dist/doc-schemas/safety/case-aliases.d.ts.map +1 -0
  61. package/dist/doc-schemas/safety/case-aliases.js +110 -0
  62. package/dist/doc-schemas/safety/case-aliases.js.map +1 -0
  63. package/dist/doc-schemas/safety/case.d.ts +542 -0
  64. package/dist/doc-schemas/safety/case.d.ts.map +1 -0
  65. package/dist/doc-schemas/safety/case.js +339 -0
  66. package/dist/doc-schemas/safety/case.js.map +1 -0
  67. package/dist/doc-schemas/safety/evidence.d.ts +346 -0
  68. package/dist/doc-schemas/safety/evidence.d.ts.map +1 -0
  69. package/dist/doc-schemas/safety/evidence.js +273 -0
  70. package/dist/doc-schemas/safety/evidence.js.map +1 -0
  71. package/dist/doc-schemas/safety/foundation.d.ts +425 -0
  72. package/dist/doc-schemas/safety/foundation.d.ts.map +1 -0
  73. package/dist/doc-schemas/safety/foundation.js +349 -0
  74. package/dist/doc-schemas/safety/foundation.js.map +1 -0
  75. package/dist/doc-schemas/safety/holds.d.ts +152 -0
  76. package/dist/doc-schemas/safety/holds.d.ts.map +1 -0
  77. package/dist/doc-schemas/safety/holds.js +142 -0
  78. package/dist/doc-schemas/safety/holds.js.map +1 -0
  79. package/dist/doc-schemas/safety/monitors.d.ts +77 -0
  80. package/dist/doc-schemas/safety/monitors.d.ts.map +1 -0
  81. package/dist/doc-schemas/safety/monitors.js +87 -0
  82. package/dist/doc-schemas/safety/monitors.js.map +1 -0
  83. package/dist/doc-schemas/safety/provenance.d.ts +70 -0
  84. package/dist/doc-schemas/safety/provenance.d.ts.map +1 -0
  85. package/dist/doc-schemas/safety/provenance.js +76 -0
  86. package/dist/doc-schemas/safety/provenance.js.map +1 -0
  87. package/dist/doc-schemas/safety/report.d.ts +256 -0
  88. package/dist/doc-schemas/safety/report.d.ts.map +1 -0
  89. package/dist/doc-schemas/safety/report.js +116 -0
  90. package/dist/doc-schemas/safety/report.js.map +1 -0
  91. package/dist/doc-schemas/safety/sagas.d.ts +154 -0
  92. package/dist/doc-schemas/safety/sagas.d.ts.map +1 -0
  93. package/dist/doc-schemas/safety/sagas.js +162 -0
  94. package/dist/doc-schemas/safety/sagas.js.map +1 -0
  95. package/dist/doc-schemas/social.d.ts +3 -3
  96. package/dist/doc-schemas/user.d.ts +15 -0
  97. package/dist/doc-schemas/user.d.ts.map +1 -1
  98. package/dist/doc-schemas/user.js +9 -0
  99. package/dist/doc-schemas/user.js.map +1 -1
  100. package/dist/doc-schemas/work-project.d.ts +1 -1
  101. package/dist/media/atoms.d.ts +2 -2
  102. package/dist/media/domain-events-admin.d.ts +1 -1
  103. package/dist/media/domain-events.d.ts +1 -1
  104. package/dist/media/file-origin.d.ts +1 -1
  105. package/dist/media/index.d.ts +1 -0
  106. package/dist/media/index.d.ts.map +1 -1
  107. package/dist/media/index.js +1 -0
  108. package/dist/media/index.js.map +1 -1
  109. package/dist/media/pending-media.d.ts +25 -25
  110. package/dist/media/photodna-coverage.d.ts +46 -0
  111. package/dist/media/photodna-coverage.d.ts.map +1 -0
  112. package/dist/media/photodna-coverage.js +74 -0
  113. package/dist/media/photodna-coverage.js.map +1 -0
  114. package/dist/media/start-upload.d.ts +1 -1
  115. package/dist/media/target-info.d.ts +1 -1
  116. package/dist/paths/collections.d.ts +58 -0
  117. package/dist/paths/collections.d.ts.map +1 -1
  118. package/dist/paths/collections.js +77 -0
  119. package/dist/paths/collections.js.map +1 -1
  120. package/dist/paths/path-builders.d.ts +57 -0
  121. package/dist/paths/path-builders.d.ts.map +1 -1
  122. package/dist/paths/path-builders.js +75 -0
  123. package/dist/paths/path-builders.js.map +1 -1
  124. package/dist/schemas/social.d.ts +2 -2
  125. package/dist/types/audit.d.ts +1 -1
  126. package/dist/types/audit.d.ts.map +1 -1
  127. package/dist/upload-variables/square-streetz-post-variables.d.ts +1 -1
  128. package/package.json +1 -1
@@ -0,0 +1,131 @@
1
+ import { z } from 'zod';
2
+ /** Blocked-hash retention policy — indefinite until an appeal reverses it. */
3
+ export declare const NciiBlockedHashRetentionPolicySchema: z.ZodLiteral<"indefiniteUntilReversed">;
4
+ export type NciiBlockedHashRetentionPolicy = z.infer<typeof NciiBlockedHashRetentionPolicySchema>;
5
+ /** `_config/nciiPolicy` = `NciiPolicyConfigV1` — the DJ-approved launch defaults.
6
+ * Counsel ratifies (`counselApproved`) at the pre-launch gate; uploads stay
7
+ * blocked until then. Any value missing/placeholder → the launch audit FAILS
8
+ * CLOSED. */
9
+ export declare const NciiPolicyConfigV1Schema: z.ZodObject<{
10
+ policyVersion: z.ZodLiteral<"ncii.2026-06-19.v1">;
11
+ appealWindowDays: z.ZodNumber;
12
+ requesterPiiRetentionDays: z.ZodNumber;
13
+ evidenceRetentionDays: z.ZodNumber;
14
+ statusTokenRetentionDays: z.ZodNumber;
15
+ blockedHashRetentionPolicy: z.ZodLiteral<"indefiniteUntilReversed">;
16
+ allowedEvidenceMimeTypes: z.ZodArray<z.ZodString>;
17
+ maxEvidenceFileBytes: z.ZodNumber;
18
+ maxEvidenceFilesPerRequest: z.ZodNumber;
19
+ maxEvidenceTotalBytesPerRequest: z.ZodNumber;
20
+ uploadReservationMinutes: z.ZodNumber;
21
+ abandonedUploadCleanupHours: z.ZodNumber;
22
+ publicRequestsPerIpPerHour: z.ZodNumber;
23
+ publicUploadsPerIpPerHour: z.ZodNumber;
24
+ requestsPerDevicePerDay: z.ZodNumber;
25
+ tempHoldInitialHours: z.ZodNumber;
26
+ tempHoldPendingValidityExtensionHours: z.ZodNumber;
27
+ tempHoldMaxTotalHours: z.ZodNumber;
28
+ incompleteInvalidReleaseDelayHours: z.ZodNumber;
29
+ statusTokenEntropyBits: z.ZodNumber;
30
+ statusTokenTtlDays: z.ZodNumber;
31
+ idempotencyWindowHours: z.ZodNumber;
32
+ uploaderRemovalAppealWindowDays: z.ZodNumber;
33
+ maxEvidenceDecodePixels: z.ZodNumber;
34
+ maxEvidenceImageDimension: z.ZodNumber;
35
+ maxEvidenceVideoFrames: z.ZodNumber;
36
+ maxEvidenceVideoDurationSec: z.ZodNumber;
37
+ evidenceParserTimeoutSec: z.ZodNumber;
38
+ evidenceScanCpuBudgetMs: z.ZodNumber;
39
+ evidenceScanMemoryBudgetMb: z.ZodNumber;
40
+ rejectArchiveAndPolyglotPayloads: z.ZodBoolean;
41
+ approvedBy: z.ZodLiteral<"operatorLaunchDefault">;
42
+ counselApproved: z.ZodBoolean;
43
+ }, z.core.$strict>;
44
+ export type NciiPolicyConfigV1 = z.infer<typeof NciiPolicyConfigV1Schema>;
45
+ /** The frozen launch default for `_config/nciiPolicy`. */
46
+ export declare const DEFAULT_NCII_POLICY_CONFIG_V1: NciiPolicyConfigV1;
47
+ /** The phishing-resistant second factor — password-only, SMS, and TOTP are NEVER
48
+ * sufficient for a privileged capability. */
49
+ export declare const PrivilegedReviewerSecondFactorSchema: z.ZodLiteral<"passkeyWebAuthn">;
50
+ export type PrivilegedReviewerSecondFactor = z.infer<typeof PrivilegedReviewerSecondFactorSchema>;
51
+ /** The capabilities that require the passkey assertion + an explicit typed
52
+ * confirmation (two-step reauth). */
53
+ export declare const PrivilegedTwoStepReauthCapabilitySchema: z.ZodEnum<{
54
+ evidenceReveal: "evidenceReveal";
55
+ ncmecCredentialUse: "ncmecCredentialUse";
56
+ reinstateContent: "reinstateContent";
57
+ reverseHashBlock: "reverseHashBlock";
58
+ legalDisposition: "legalDisposition";
59
+ falsePositiveCorrection: "falsePositiveCorrection";
60
+ ncmecManualFallback: "ncmecManualFallback";
61
+ }>;
62
+ export type PrivilegedTwoStepReauthCapability = z.infer<typeof PrivilegedTwoStepReauthCapabilitySchema>;
63
+ /** `_config/privilegedReviewerSecurity` = `PrivilegedReviewerSecurityProfileV1` —
64
+ * what "fresh reauth" actually means for any privileged-reviewer capability. */
65
+ export declare const PrivilegedReviewerSecurityProfileV1Schema: z.ZodObject<{
66
+ requiredSecondFactor: z.ZodLiteral<"passkeyWebAuthn">;
67
+ privilegedReauthTtlSeconds: z.ZodNumber;
68
+ privilegedSessionDeviceBound: z.ZodBoolean;
69
+ twoStepReauthCapabilities: z.ZodArray<z.ZodEnum<{
70
+ evidenceReveal: "evidenceReveal";
71
+ ncmecCredentialUse: "ncmecCredentialUse";
72
+ reinstateContent: "reinstateContent";
73
+ reverseHashBlock: "reverseHashBlock";
74
+ legalDisposition: "legalDisposition";
75
+ falsePositiveCorrection: "falsePositiveCorrection";
76
+ ncmecManualFallback: "ncmecManualFallback";
77
+ }>>;
78
+ recoveryCodeCount: z.ZodNumber;
79
+ recoveryCodeUse: z.ZodLiteral<"auditedHighSeverity+forcesReenroll+criticalAlarm">;
80
+ allowPrivilegedSessionRevocation: z.ZodBoolean;
81
+ everyInvocationAudited: z.ZodBoolean;
82
+ }, z.core.$strict>;
83
+ export type PrivilegedReviewerSecurityProfileV1 = z.infer<typeof PrivilegedReviewerSecurityProfileV1Schema>;
84
+ /** The frozen launch default for `_config/privilegedReviewerSecurity`. */
85
+ export declare const DEFAULT_PRIVILEGED_REVIEWER_SECURITY_PROFILE_V1: PrivilegedReviewerSecurityProfileV1;
86
+ /** Human-only steps blocked-pending-operator when the failsafe is active. */
87
+ export declare const OperatorBlockedPendingStepSchema: z.ZodEnum<{
88
+ ncmecFiling: "ncmecFiling";
89
+ appealReview: "appealReview";
90
+ reinstatementReview: "reinstatementReview";
91
+ leResponse: "leResponse";
92
+ }>;
93
+ export type OperatorBlockedPendingStep = z.infer<typeof OperatorBlockedPendingStepSchema>;
94
+ /** A registered backup-human slot: an enrolled passkey + the explicit privileged
95
+ * capabilities they hold + a counsel-confirmed training acknowledgement. EMPTY at
96
+ * launch (solo) — a documented slot to fill post-funding. */
97
+ export declare const OperatorBackupContactV1Schema: z.ZodObject<{
98
+ contactId: z.ZodString;
99
+ passkeyEnrolled: z.ZodLiteral<true>;
100
+ capabilities: z.ZodArray<z.ZodString>;
101
+ trainingAcknowledgedAt: z.ZodNumber;
102
+ counselConfirmed: z.ZodBoolean;
103
+ }, z.core.$strict>;
104
+ export type OperatorBackupContactV1 = z.infer<typeof OperatorBackupContactV1Schema>;
105
+ /** `_config/operatorContinuity` = `OperatorContinuityConfigV1` — the
106
+ * operator-availability continuity failsafe posture. */
107
+ export declare const OperatorContinuityConfigV1Schema: z.ZodObject<{
108
+ operatorHeartbeatHours: z.ZodNumber;
109
+ failsafeDisablesNewUploads: z.ZodBoolean;
110
+ failsafeHoldsAllInFlight: z.ZodBoolean;
111
+ blockedPendingOperatorSteps: z.ZodArray<z.ZodEnum<{
112
+ ncmecFiling: "ncmecFiling";
113
+ appealReview: "appealReview";
114
+ reinstatementReview: "reinstatementReview";
115
+ leResponse: "leResponse";
116
+ }>>;
117
+ recordDeadlineBreaches: z.ZodBoolean;
118
+ operatorBackupContacts: z.ZodArray<z.ZodObject<{
119
+ contactId: z.ZodString;
120
+ passkeyEnrolled: z.ZodLiteral<true>;
121
+ capabilities: z.ZodArray<z.ZodString>;
122
+ trainingAcknowledgedAt: z.ZodNumber;
123
+ counselConfirmed: z.ZodBoolean;
124
+ }, z.core.$strict>>;
125
+ approvedBy: z.ZodLiteral<"operatorLaunchDefault">;
126
+ counselApproved: z.ZodBoolean;
127
+ }, z.core.$strict>;
128
+ export type OperatorContinuityConfigV1 = z.infer<typeof OperatorContinuityConfigV1Schema>;
129
+ /** The frozen launch default for `_config/operatorContinuity`. */
130
+ export declare const DEFAULT_OPERATOR_CONTINUITY_CONFIG_V1: OperatorContinuityConfigV1;
131
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/doc-schemas/ncii/config.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB,8EAA8E;AAC9E,eAAO,MAAM,oCAAoC,yCAAuC,CAAC;AACzF,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAElG;;;aAGa;AACb,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAuC1B,CAAC;AACZ,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,0DAA0D;AAC1D,eAAO,MAAM,6BAA6B,EAAE,kBAkC3C,CAAC;AAYF;6CAC6C;AAC7C,eAAO,MAAM,oCAAoC,iCAA+B,CAAC;AACjF,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAElG;qCACqC;AACrC,eAAO,MAAM,uCAAuC;;;;;;;;EAQlD,CAAC;AACH,MAAM,MAAM,iCAAiC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uCAAuC,CAAC,CAAC;AAExG;gFACgF;AAChF,eAAO,MAAM,yCAAyC;;;;;;;;;;;;;;;;;kBAiB3C,CAAC;AACZ,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yCAAyC,CAAC,CAAC;AAE5G,0EAA0E;AAC1E,eAAO,MAAM,+CAA+C,EAAE,mCAiB7D,CAAC;AAWF,6EAA6E;AAC7E,eAAO,MAAM,gCAAgC;;;;;EAK3C,CAAC;AACH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAE1F;;6DAE6D;AAC7D,eAAO,MAAM,6BAA6B;;;;;;kBAO/B,CAAC;AACZ,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF;wDACwD;AACxD,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;kBAclC,CAAC;AACZ,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC;AAE1F,kEAAkE;AAClE,eAAO,MAAM,qCAAqC,EAAE,0BASnD,CAAC"}
@@ -0,0 +1,227 @@
1
+ // Trust & Safety — NCII config singletons (Appendix A §A11 [H6] / [H-17] / [H-18]).
2
+ //
3
+ // Three `_config` singleton documents:
4
+ // - `_config/nciiPolicy` → NciiPolicyConfigV1
5
+ // - `_config/privilegedReviewerSecurity` → PrivilegedReviewerSecurityProfileV1
6
+ // - `_config/operatorContinuity` → OperatorContinuityConfigV1
7
+ //
8
+ // These are VERSIONED launch defaults. Qualified counsel must approve them before
9
+ // uploads open and may increase, decrease, or otherwise modify them. Any change
10
+ // increments the policy version and triggers a retention/configuration review. The
11
+ // launch/config audit FAILS CLOSED if any value is missing or a placeholder;
12
+ // uploads stay BLOCKED until `counselApproved` flips true at the pre-launch counsel
13
+ // gate.
14
+ //
15
+ // Every value in the DEFAULT consts below is transcribed verbatim from
16
+ // docs/code_changes_needed/trust-and-safety/IMPLEMENTATION_PLAN.md Appendix A §A11
17
+ // [H6] / [H-17] / [H-18] — no invented values, no placeholders. The schemas pin
18
+ // each literal-defaulted field where the spec fixes a single literal value
19
+ // (`policyVersion`, `approvedBy`, `counselApproved`, the security-profile string
20
+ // literals, etc.) so a config write cannot silently drift from the frozen posture.
21
+ //
22
+ // Collection note: these are `_config` singleton docs; wiring collections.ts /
23
+ // path-builders.ts / registry.ts is deferred to the app leg.
24
+ import { z } from 'zod';
25
+ // ===========================================================================
26
+ // §A11 [H6] — NciiPolicyConfigV1 + DEFAULT_NCII_POLICY_CONFIG_V1
27
+ // `_config/nciiPolicy`
28
+ // ===========================================================================
29
+ /** Blocked-hash retention policy — indefinite until an appeal reverses it. */
30
+ export const NciiBlockedHashRetentionPolicySchema = z.literal('indefiniteUntilReversed');
31
+ /** `_config/nciiPolicy` = `NciiPolicyConfigV1` — the DJ-approved launch defaults.
32
+ * Counsel ratifies (`counselApproved`) at the pre-launch gate; uploads stay
33
+ * blocked until then. Any value missing/placeholder → the launch audit FAILS
34
+ * CLOSED. */
35
+ export const NciiPolicyConfigV1Schema = z.object({
36
+ policyVersion: z.literal('ncii.2026-06-19.v1'),
37
+ appealWindowDays: z.number(),
38
+ requesterPiiRetentionDays: z.number(),
39
+ evidenceRetentionDays: z.number(),
40
+ statusTokenRetentionDays: z.number(),
41
+ blockedHashRetentionPolicy: NciiBlockedHashRetentionPolicySchema,
42
+ allowedEvidenceMimeTypes: z.array(z.string().min(1)),
43
+ maxEvidenceFileBytes: z.number(),
44
+ maxEvidenceFilesPerRequest: z.number(),
45
+ maxEvidenceTotalBytesPerRequest: z.number(),
46
+ uploadReservationMinutes: z.number(),
47
+ abandonedUploadCleanupHours: z.number(),
48
+ publicRequestsPerIpPerHour: z.number(),
49
+ publicUploadsPerIpPerHour: z.number(),
50
+ requestsPerDevicePerDay: z.number(),
51
+ // [H1/M3] temp-hold + status/supplement token values:
52
+ tempHoldInitialHours: z.number(),
53
+ tempHoldPendingValidityExtensionHours: z.number(),
54
+ tempHoldMaxTotalHours: z.number(),
55
+ incompleteInvalidReleaseDelayHours: z.number(),
56
+ statusTokenEntropyBits: z.number(),
57
+ statusTokenTtlDays: z.number(),
58
+ // [H-07] dedup window for the deterministic initial-intake idempotency key
59
+ idempotencyWindowHours: z.number(),
60
+ // [H-09] per-appeal review SLA for NciiAppealV1.deadlineAt
61
+ uploaderRemovalAppealWindowDays: z.number(),
62
+ // [M-10] evidence parser-hardening budgets (attacker-controlled bytes):
63
+ maxEvidenceDecodePixels: z.number(),
64
+ maxEvidenceImageDimension: z.number(),
65
+ maxEvidenceVideoFrames: z.number(),
66
+ maxEvidenceVideoDurationSec: z.number(),
67
+ evidenceParserTimeoutSec: z.number(),
68
+ evidenceScanCpuBudgetMs: z.number(),
69
+ evidenceScanMemoryBudgetMb: z.number(),
70
+ rejectArchiveAndPolyglotPayloads: z.boolean(),
71
+ approvedBy: z.literal('operatorLaunchDefault'),
72
+ // counselApproved flips true at the pre-launch counsel gate; uploads stay blocked until then
73
+ counselApproved: z.boolean(),
74
+ }).strict();
75
+ /** The frozen launch default for `_config/nciiPolicy`. */
76
+ export const DEFAULT_NCII_POLICY_CONFIG_V1 = {
77
+ policyVersion: 'ncii.2026-06-19.v1',
78
+ appealWindowDays: 30,
79
+ requesterPiiRetentionDays: 90,
80
+ evidenceRetentionDays: 60,
81
+ statusTokenRetentionDays: 180,
82
+ blockedHashRetentionPolicy: 'indefiniteUntilReversed',
83
+ allowedEvidenceMimeTypes: ['image/jpeg', 'image/png', 'image/webp', 'image/gif', 'video/mp4', 'video/webm'],
84
+ maxEvidenceFileBytes: 26214400,
85
+ maxEvidenceFilesPerRequest: 5,
86
+ maxEvidenceTotalBytesPerRequest: 104857600,
87
+ uploadReservationMinutes: 30,
88
+ abandonedUploadCleanupHours: 24,
89
+ publicRequestsPerIpPerHour: 5,
90
+ publicUploadsPerIpPerHour: 10,
91
+ requestsPerDevicePerDay: 10,
92
+ tempHoldInitialHours: 72,
93
+ tempHoldPendingValidityExtensionHours: 48,
94
+ tempHoldMaxTotalHours: 336,
95
+ incompleteInvalidReleaseDelayHours: 24,
96
+ statusTokenEntropyBits: 256,
97
+ statusTokenTtlDays: 180,
98
+ idempotencyWindowHours: 72,
99
+ uploaderRemovalAppealWindowDays: 14,
100
+ maxEvidenceDecodePixels: 40000000,
101
+ maxEvidenceImageDimension: 12000,
102
+ maxEvidenceVideoFrames: 600,
103
+ maxEvidenceVideoDurationSec: 600,
104
+ evidenceParserTimeoutSec: 60,
105
+ evidenceScanCpuBudgetMs: 30000,
106
+ evidenceScanMemoryBudgetMb: 512,
107
+ rejectArchiveAndPolyglotPayloads: true,
108
+ approvedBy: 'operatorLaunchDefault',
109
+ counselApproved: false,
110
+ };
111
+ // ===========================================================================
112
+ // §A11 [H-17] — PrivilegedReviewerSecurityProfileV1 +
113
+ // DEFAULT_PRIVILEGED_REVIEWER_SECURITY_PROFILE_V1
114
+ // `_config/privilegedReviewerSecurity`
115
+ //
116
+ // "fresh reauth" / "two-step reauth" for ANY privileged-reviewer capability means
117
+ // a reauth that satisfies THIS profile — NEVER a bare password re-prompt. Enforced
118
+ // even though one solo operator holds every capability at launch.
119
+ // ===========================================================================
120
+ /** The phishing-resistant second factor — password-only, SMS, and TOTP are NEVER
121
+ * sufficient for a privileged capability. */
122
+ export const PrivilegedReviewerSecondFactorSchema = z.literal('passkeyWebAuthn');
123
+ /** The capabilities that require the passkey assertion + an explicit typed
124
+ * confirmation (two-step reauth). */
125
+ export const PrivilegedTwoStepReauthCapabilitySchema = z.enum([
126
+ 'evidenceReveal',
127
+ 'ncmecCredentialUse',
128
+ 'reinstateContent',
129
+ 'reverseHashBlock',
130
+ 'legalDisposition',
131
+ 'falsePositiveCorrection',
132
+ 'ncmecManualFallback',
133
+ ]);
134
+ /** `_config/privilegedReviewerSecurity` = `PrivilegedReviewerSecurityProfileV1` —
135
+ * what "fresh reauth" actually means for any privileged-reviewer capability. */
136
+ export const PrivilegedReviewerSecurityProfileV1Schema = z.object({
137
+ // phishing-resistant; password-only, SMS, and TOTP are NEVER sufficient for a privileged capability
138
+ requiredSecondFactor: PrivilegedReviewerSecondFactorSchema,
139
+ // a capability invocation needs a WebAuthn assertion at least this fresh; older → re-prompt
140
+ privilegedReauthTtlSeconds: z.number(),
141
+ // the privileged session is bound to the enrolled authenticator/device; separate from the ordinary app session
142
+ privilegedSessionDeviceBound: z.boolean(),
143
+ // these require the passkey assertion + an explicit typed confirmation
144
+ twoStepReauthCapabilities: z.array(PrivilegedTwoStepReauthCapabilitySchema),
145
+ // offline one-time break-glass codes, generated at enrollment, stored physically offline
146
+ recoveryCodeCount: z.number(),
147
+ // using one is logged, fires the external critical alarm, and forces enrolling a fresh passkey
148
+ recoveryCodeUse: z.literal('auditedHighSeverity+forcesReenroll+criticalAlarm'),
149
+ // lost-device: revoke ALL privileged sessions → forces re-enrollment before any capability works again
150
+ allowPrivilegedSessionRevocation: z.boolean(),
151
+ // each privileged-capability use writes an audit event (actor, capability, caseId, reauth method, before/after for evidence reads)
152
+ everyInvocationAudited: z.boolean(),
153
+ }).strict();
154
+ /** The frozen launch default for `_config/privilegedReviewerSecurity`. */
155
+ export const DEFAULT_PRIVILEGED_REVIEWER_SECURITY_PROFILE_V1 = {
156
+ requiredSecondFactor: 'passkeyWebAuthn',
157
+ privilegedReauthTtlSeconds: 300,
158
+ privilegedSessionDeviceBound: true,
159
+ twoStepReauthCapabilities: [
160
+ 'evidenceReveal',
161
+ 'ncmecCredentialUse',
162
+ 'reinstateContent',
163
+ 'reverseHashBlock',
164
+ 'legalDisposition',
165
+ 'falsePositiveCorrection',
166
+ 'ncmecManualFallback',
167
+ ],
168
+ recoveryCodeCount: 10,
169
+ recoveryCodeUse: 'auditedHighSeverity+forcesReenroll+criticalAlarm',
170
+ allowPrivilegedSessionRevocation: true,
171
+ everyInvocationAudited: true,
172
+ };
173
+ // ===========================================================================
174
+ // §A11 [H-18] — OperatorContinuityConfigV1 + DEFAULT_OPERATOR_CONTINUITY_CONFIG_V1
175
+ // `_config/operatorContinuity`
176
+ //
177
+ // The dead-man heartbeat requires the operator to check in within
178
+ // `operatorHeartbeatHours`; a missed heartbeat trips `operatorUnavailableFailsafe`,
179
+ // fail-safe by construction.
180
+ // ===========================================================================
181
+ /** Human-only steps blocked-pending-operator when the failsafe is active. */
182
+ export const OperatorBlockedPendingStepSchema = z.enum([
183
+ 'ncmecFiling',
184
+ 'appealReview',
185
+ 'reinstatementReview',
186
+ 'leResponse',
187
+ ]);
188
+ /** A registered backup-human slot: an enrolled passkey + the explicit privileged
189
+ * capabilities they hold + a counsel-confirmed training acknowledgement. EMPTY at
190
+ * launch (solo) — a documented slot to fill post-funding. */
191
+ export const OperatorBackupContactV1Schema = z.object({
192
+ contactId: z.string().min(1),
193
+ passkeyEnrolled: z.literal(true),
194
+ // the explicit matrix capabilities this backup holds (SafetyReviewerCapability values)
195
+ capabilities: z.array(z.string().min(1)),
196
+ trainingAcknowledgedAt: z.number(),
197
+ counselConfirmed: z.boolean(),
198
+ }).strict();
199
+ /** `_config/operatorContinuity` = `OperatorContinuityConfigV1` — the
200
+ * operator-availability continuity failsafe posture. */
201
+ export const OperatorContinuityConfigV1Schema = z.object({
202
+ // max time between operator check-ins before the failsafe trips
203
+ operatorHeartbeatHours: z.number(),
204
+ failsafeDisablesNewUploads: z.boolean(),
205
+ // content stays down, holds stay active, NO evidence release/TTL-reap while active
206
+ failsafeHoldsAllInFlight: z.boolean(),
207
+ blockedPendingOperatorSteps: z.array(OperatorBlockedPendingStepSchema),
208
+ // a passed deadline is logged with breachReason + preserved good-faith record, never silent
209
+ recordDeadlineBreaches: z.boolean(),
210
+ // EMPTY at launch (solo)
211
+ operatorBackupContacts: z.array(OperatorBackupContactV1Schema),
212
+ approvedBy: z.literal('operatorLaunchDefault'),
213
+ // counsel ratifies the continuity posture at the pre-launch gate
214
+ counselApproved: z.boolean(),
215
+ }).strict();
216
+ /** The frozen launch default for `_config/operatorContinuity`. */
217
+ export const DEFAULT_OPERATOR_CONTINUITY_CONFIG_V1 = {
218
+ operatorHeartbeatHours: 24,
219
+ failsafeDisablesNewUploads: true,
220
+ failsafeHoldsAllInFlight: true,
221
+ blockedPendingOperatorSteps: ['ncmecFiling', 'appealReview', 'reinstatementReview', 'leResponse'],
222
+ recordDeadlineBreaches: true,
223
+ operatorBackupContacts: [],
224
+ approvedBy: 'operatorLaunchDefault',
225
+ counselApproved: false,
226
+ };
227
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/doc-schemas/ncii/config.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,EAAE;AACF,uCAAuC;AACvC,6DAA6D;AAC7D,iFAAiF;AACjF,qEAAqE;AACrE,EAAE;AACF,kFAAkF;AAClF,gFAAgF;AAChF,mFAAmF;AACnF,6EAA6E;AAC7E,oFAAoF;AACpF,QAAQ;AACR,EAAE;AACF,uEAAuE;AACvE,mFAAmF;AACnF,gFAAgF;AAChF,2EAA2E;AAC3E,iFAAiF;AACjF,mFAAmF;AACnF,EAAE;AACF,+EAA+E;AAC/E,6DAA6D;AAE7D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,8EAA8E;AAC9E,iEAAiE;AACjE,uBAAuB;AACvB,8EAA8E;AAE9E,8EAA8E;AAC9E,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAC;AAGzF;;;aAGa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gC,GAAG,CAAC,CAAC,MAAM,CAAC;IACvD,gEAAgE;IAChE,sBAAsB,EAAE,CAAC,CAAC,MAAM,EAAE;IAClC,0BAA0B,EAAE,CAAC,CAAC,OAAO,EAAE;IACvC,mFAAmF;IACnF,wBAAwB,EAAE,CAAC,CAAC,OAAO,EAAE;IACrC,2BAA2B,EAAE,CAAC,CAAC,KAAK,CAAC,gCAAgC,CAAC;IACtE,4FAA4F;IAC5F,sBAAsB,EAAE,CAAC,CAAC,OAAO,EAAE;IACnC,yBAAyB;IACzB,sBAAsB,EAAE,CAAC,CAAC,KAAK,CAAC,6BAA6B,CAAC;IAC9D,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC,uBAAuB,CAAC;IAC9C,iEAAiE;IACjE,eAAe,EAAE,CAAC,CAAC,OAAO,EAAE;CAC7B,CAAC,CAAC,MAAM,EAAE,CAAC;AAGZ,kEAAkE;AAClE,MAAM,CAAC,MAAM,qCAAqC,GAA+B;IAC/E,sBAAsB,EAAE,EAAE;IAC1B,0BAA0B,EAAE,IAAI;IAChC,wBAAwB,EAAE,IAAI;IAC9B,2BAA2B,EAAE,CAAC,aAAa,EAAE,cAAc,EAAE,qBAAqB,EAAE,YAAY,CAAC;IACjG,sBAAsB,EAAE,IAAI;IAC5B,sBAAsB,EAAE,EAAE;IAC1B,UAAU,EAAE,uBAAuB;IACnC,eAAe,EAAE,KAAK;CACvB,CAAC"}
@@ -0,0 +1,84 @@
1
+ import { z } from 'zod';
2
+ /** Temp-hold lifecycle. CAS release runs through the A3 command (no silent TTL on
3
+ * an `active` ref). Extended while the request is valid/pending. */
4
+ export declare const NciiTemporaryHoldStatusSchema: z.ZodEnum<{
5
+ active: "active";
6
+ released: "released";
7
+ extended: "extended";
8
+ }>;
9
+ export type NciiTemporaryHoldStatus = z.infer<typeof NciiTemporaryHoldStatusSchema>;
10
+ /** `nciiTemporaryHolds/{holdId}` — NON-AUTHORITATIVE workflow/projection of the
11
+ * authoritative A3 hold (via `safetyHoldRefId`). Doc id `holdId` is a
12
+ * deterministic/assigned id (z.string().min(1)). */
13
+ export declare const NciiTemporaryHoldV1Schema: z.ZodObject<{
14
+ schemaVersion: z.ZodLiteral<1>;
15
+ holdId: z.ZodString;
16
+ requestId: z.ZodString;
17
+ caseId: z.ZodOptional<z.ZodString>;
18
+ resourceType: z.ZodLiteral<"nciiTemporaryTarget">;
19
+ safetyHoldRefId: z.ZodString;
20
+ target: z.ZodDiscriminatedUnion<[z.ZodObject<{
21
+ kind: z.ZodLiteral<"mediaAsset">;
22
+ mediaAssetId: z.ZodString;
23
+ }, z.core.$strict>, z.ZodObject<{
24
+ kind: z.ZodLiteral<"hallItem">;
25
+ hallItemId: z.ZodString;
26
+ subItemId: z.ZodOptional<z.ZodString>;
27
+ }, z.core.$strict>, z.ZodObject<{
28
+ kind: z.ZodLiteral<"squarePost">;
29
+ postId: z.ZodString;
30
+ }, z.core.$strict>, z.ZodObject<{
31
+ kind: z.ZodLiteral<"profileImage">;
32
+ profileUid: z.ZodString;
33
+ }, z.core.$strict>, z.ZodObject<{
34
+ kind: z.ZodLiteral<"username">;
35
+ profileUid: z.ZodString;
36
+ }, z.core.$strict>, z.ZodObject<{
37
+ kind: z.ZodLiteral<"craftSkill">;
38
+ profileUid: z.ZodString;
39
+ craftSkillId: z.ZodString;
40
+ }, z.core.$strict>, z.ZodObject<{
41
+ kind: z.ZodLiteral<"commissionListing">;
42
+ commissionListingId: z.ZodString;
43
+ }, z.core.$strict>, z.ZodObject<{
44
+ kind: z.ZodLiteral<"audition">;
45
+ auditionId: z.ZodString;
46
+ }, z.core.$strict>, z.ZodObject<{
47
+ kind: z.ZodLiteral<"auditionEntry">;
48
+ auditionId: z.ZodString;
49
+ auditionEntryId: z.ZodString;
50
+ }, z.core.$strict>, z.ZodObject<{
51
+ kind: z.ZodLiteral<"guildInviteMessage">;
52
+ channelId: z.ZodString;
53
+ messageId: z.ZodString;
54
+ }, z.core.$strict>, z.ZodObject<{
55
+ kind: z.ZodLiteral<"chatAttachment">;
56
+ channelId: z.ZodString;
57
+ messageId: z.ZodString;
58
+ attachmentId: z.ZodString;
59
+ }, z.core.$strict>, z.ZodObject<{
60
+ kind: z.ZodLiteral<"url">;
61
+ url: z.ZodString;
62
+ }, z.core.$strict>, z.ZodObject<{
63
+ kind: z.ZodLiteral<"additionalText">;
64
+ textRef: z.ZodString;
65
+ }, z.core.$strict>], "kind">;
66
+ rootLineageRef: z.ZodOptional<z.ZodString>;
67
+ contentHashes: z.ZodOptional<z.ZodArray<z.ZodString>>;
68
+ ownerUid: z.ZodOptional<z.ZodString>;
69
+ capturedRevision: z.ZodOptional<z.ZodNumber>;
70
+ capturedGeneration: z.ZodOptional<z.ZodString>;
71
+ snapshotRef: z.ZodString;
72
+ purpose: z.ZodLiteral<"nciiTemporaryPreservation">;
73
+ createdAt: z.ZodNumber;
74
+ expiresAt: z.ZodNumber;
75
+ status: z.ZodEnum<{
76
+ active: "active";
77
+ released: "released";
78
+ extended: "extended";
79
+ }>;
80
+ releasedAt: z.ZodOptional<z.ZodNumber>;
81
+ releaseReason: z.ZodOptional<z.ZodString>;
82
+ }, z.core.$strict>;
83
+ export type NciiTemporaryHoldV1 = z.infer<typeof NciiTemporaryHoldV1Schema>;
84
+ //# sourceMappingURL=holds.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"holds.d.ts","sourceRoot":"","sources":["../../../src/doc-schemas/ncii/holds.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAOxB;oEACoE;AACpE,eAAO,MAAM,6BAA6B;;;;EAA6C,CAAC;AACxF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF;;oDAEoD;AACpD,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAwB3B,CAAC;AACZ,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
@@ -0,0 +1,63 @@
1
+ // Trust & Safety — NCII temporary preservation holds (Appendix A §A11, the
2
+ // synchronous public-intake snapshot + temporary NCII hold [H3]).
3
+ //
4
+ // `nciiTemporaryHolds/{holdId}` — a TEMPORARY, minimize-retention preservation
5
+ // reference that BLOCKS destructive cleanup/replacement of a request target while
6
+ // a request is being processed. This is NOT the 1-yr CSAM hold: exact purpose,
7
+ // short expiry, extension rules for valid/pending, release rules for
8
+ // incomplete/invalid, hold-aware deletion.
9
+ //
10
+ // NON-AUTHORITATIVE PROJECTION [H1]: this row is a workflow/projection only.
11
+ // `assertNoBlockingSafetyHold` consults the §A3 `safetyHoldResources` aggregate
12
+ // via `safetyHoldRefId`'s ref — NEVER this row. Expiry/release goes through the
13
+ // A3 CAS release command (no silent TTL on an `active` ref).
14
+ //
15
+ // Every shape here is transcribed verbatim from docs/code_changes_needed/
16
+ // trust-and-safety/IMPLEMENTATION_PLAN.md Appendix A §A11 — no invented values,
17
+ // no placeholders.
18
+ //
19
+ // SHARED enums + the locator come from ../safety/foundation.js (the single source
20
+ // for every cross-cluster enum); they are NEVER redefined here. This cluster
21
+ // IMPORTS TargetLocatorV1Schema.
22
+ //
23
+ // Collection note: this cluster introduces a NEW Firestore collection; wiring
24
+ // collections.ts / path-builders.ts / registry.ts is deferred to the app leg (the
25
+ // orchestrator binds the schema + path builders there); the doc-id shape is
26
+ // documented on the schema below.
27
+ import { z } from 'zod';
28
+ import { TargetLocatorV1Schema } from '../safety/foundation.js';
29
+ // ===========================================================================
30
+ // §A11 [H3] — nciiTemporaryHolds/{holdId}
31
+ // ===========================================================================
32
+ /** Temp-hold lifecycle. CAS release runs through the A3 command (no silent TTL on
33
+ * an `active` ref). Extended while the request is valid/pending. */
34
+ export const NciiTemporaryHoldStatusSchema = z.enum(['active', 'extended', 'released']);
35
+ /** `nciiTemporaryHolds/{holdId}` — NON-AUTHORITATIVE workflow/projection of the
36
+ * authoritative A3 hold (via `safetyHoldRefId`). Doc id `holdId` is a
37
+ * deterministic/assigned id (z.string().min(1)). */
38
+ export const NciiTemporaryHoldV1Schema = z.object({
39
+ schemaVersion: z.literal(1),
40
+ holdId: z.string().min(1),
41
+ requestId: z.string().min(1),
42
+ caseId: z.string().min(1).optional(),
43
+ resourceType: z.literal('nciiTemporaryTarget'),
44
+ // [H1] pointer to the AUTHORITATIVE safetyHoldRefs entry — this row is a NON-AUTHORITATIVE projection
45
+ safetyHoldRefId: z.string().min(1),
46
+ // [H4] the discriminated locator — NOT an all-optional contentRef
47
+ target: TargetLocatorV1Schema,
48
+ rootLineageRef: z.string().min(1).optional(),
49
+ contentHashes: z.array(z.string().min(1)).max(16).optional(),
50
+ ownerUid: z.string().min(1).optional(),
51
+ capturedRevision: z.number().optional(),
52
+ capturedGeneration: z.string().min(1).optional(),
53
+ // pointer to the immutable request-target snapshot
54
+ snapshotRef: z.string().min(1),
55
+ purpose: z.literal('nciiTemporaryPreservation'),
56
+ createdAt: z.number(),
57
+ // short minimize-retention expiry; extended while request valid/pending
58
+ expiresAt: z.number(),
59
+ status: NciiTemporaryHoldStatusSchema,
60
+ releasedAt: z.number().optional(),
61
+ releaseReason: z.string().optional(),
62
+ }).strict();
63
+ //# sourceMappingURL=holds.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"holds.js","sourceRoot":"","sources":["../../../src/doc-schemas/ncii/holds.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,kEAAkE;AAClE,EAAE;AACF,+EAA+E;AAC/E,kFAAkF;AAClF,+EAA+E;AAC/E,qEAAqE;AACrE,2CAA2C;AAC3C,EAAE;AACF,6EAA6E;AAC7E,gFAAgF;AAChF,gFAAgF;AAChF,6DAA6D;AAC7D,EAAE;AACF,0EAA0E;AAC1E,gFAAgF;AAChF,mBAAmB;AACnB,EAAE;AACF,kFAAkF;AAClF,6EAA6E;AAC7E,iCAAiC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AC,QAAQ,EAAE;IACtC,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACvC,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAChD,mDAAmD;IACnD,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9B,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,2BAA2B,CAAC;IAC/C,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,wEAAwE;IACxE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,MAAM,EAAE,6BAA6B;IACrC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,aAAa,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACrC,CAAC,CAAC,MAAM,EAAE,CAAC"}
@@ -0,0 +1,109 @@
1
+ import { z } from 'zod';
2
+ /** Notice delivery channel. */
3
+ export declare const NciiUploaderNoticeChannelSchema: z.ZodEnum<{
4
+ email: "email";
5
+ inApp: "inApp";
6
+ }>;
7
+ export type NciiUploaderNoticeChannel = z.infer<typeof NciiUploaderNoticeChannelSchema>;
8
+ /** Who the notice is for, snapshotted at decision time (NEVER re-resolved). */
9
+ export declare const NciiUploaderNoticeRecipientSnapshotSchema: z.ZodObject<{
10
+ uid: z.ZodString;
11
+ deliveryAddressRef: z.ZodString;
12
+ capturedAt: z.ZodNumber;
13
+ }, z.core.$strict>;
14
+ export type NciiUploaderNoticeRecipientSnapshot = z.infer<typeof NciiUploaderNoticeRecipientSnapshotSchema>;
15
+ /** Durable retry/dead-letter delivery command on the notice. */
16
+ export declare const NciiUploaderNoticeCommandV1Schema: z.ZodObject<{
17
+ commandId: z.ZodString;
18
+ attemptCount: z.ZodNumber;
19
+ nextAttemptAt: z.ZodOptional<z.ZodNumber>;
20
+ leaseOwner: z.ZodOptional<z.ZodString>;
21
+ leaseExpiresAt: z.ZodOptional<z.ZodNumber>;
22
+ lastErrorCode: z.ZodOptional<z.ZodString>;
23
+ }, z.core.$strict>;
24
+ export type NciiUploaderNoticeCommandV1 = z.infer<typeof NciiUploaderNoticeCommandV1Schema>;
25
+ /** `nciiCases/{caseId}/uploaderNotices/{noticeId}` — durable uploader-notice
26
+ * delivery record (OWNED by the notices cluster). Doc id `noticeId` is
27
+ * deterministic:
28
+ * `sha256('ncii-uploader-notice-v1:' + caseId + ':' + recipientUid + ':' + removalGeneration)`. */
29
+ export declare const NciiUploaderNoticeV1Schema: z.ZodObject<{
30
+ schemaVersion: z.ZodLiteral<1>;
31
+ noticeId: z.ZodString;
32
+ caseId: z.ZodString;
33
+ requestIds: z.ZodArray<z.ZodString>;
34
+ removalGeneration: z.ZodNumber;
35
+ recipientSnapshot: z.ZodObject<{
36
+ uid: z.ZodString;
37
+ deliveryAddressRef: z.ZodString;
38
+ capturedAt: z.ZodNumber;
39
+ }, z.core.$strict>;
40
+ channel: z.ZodEnum<{
41
+ email: "email";
42
+ inApp: "inApp";
43
+ }>;
44
+ templateId: z.ZodString;
45
+ templateVersion: z.ZodNumber;
46
+ status: z.ZodEnum<{
47
+ pending: "pending";
48
+ sent: "sent";
49
+ delayed: "delayed";
50
+ suppressed: "suppressed";
51
+ notApplicable: "notApplicable";
52
+ }>;
53
+ suppressionReason: z.ZodOptional<z.ZodEnum<{
54
+ victimSafetyRisk: "victimSafetyRisk";
55
+ retaliationRisk: "retaliationRisk";
56
+ extortionRisk: "extortionRisk";
57
+ lawEnforcementRequest: "lawEnforcementRequest";
58
+ childSafetyInvestigation: "childSafetyInvestigation";
59
+ evidencePreservationRisk: "evidencePreservationRisk";
60
+ legalRestriction: "legalRestriction";
61
+ otherApproved: "otherApproved";
62
+ }>>;
63
+ rationaleRef: z.ZodOptional<z.ZodString>;
64
+ decidedByUid: z.ZodOptional<z.ZodString>;
65
+ delayedUntil: z.ZodOptional<z.ZodNumber>;
66
+ idempotencyKey: z.ZodString;
67
+ command: z.ZodObject<{
68
+ commandId: z.ZodString;
69
+ attemptCount: z.ZodNumber;
70
+ nextAttemptAt: z.ZodOptional<z.ZodNumber>;
71
+ leaseOwner: z.ZodOptional<z.ZodString>;
72
+ leaseExpiresAt: z.ZodOptional<z.ZodNumber>;
73
+ lastErrorCode: z.ZodOptional<z.ZodString>;
74
+ }, z.core.$strict>;
75
+ verifiedDeliveredAt: z.ZodOptional<z.ZodNumber>;
76
+ createdAt: z.ZodNumber;
77
+ updatedAt: z.ZodNumber;
78
+ }, z.core.$strict>;
79
+ export type NciiUploaderNoticeV1 = z.infer<typeof NciiUploaderNoticeV1Schema>;
80
+ /** Per-attempt delivery result. */
81
+ export declare const NciiUploaderNoticeAttemptResultSchema: z.ZodEnum<{
82
+ queued: "queued";
83
+ failed: "failed";
84
+ deferred: "deferred";
85
+ sent: "sent";
86
+ }>;
87
+ export type NciiUploaderNoticeAttemptResult = z.infer<typeof NciiUploaderNoticeAttemptResultSchema>;
88
+ /** `nciiCases/{caseId}/uploaderNotices/{noticeId}/attempts/{attemptId}` —
89
+ * IMMUTABLE append-only per-attempt ledger. Doc id `attemptId` is a
90
+ * deterministic/assigned id (z.string().min(1)). */
91
+ export declare const NciiUploaderNoticeAttemptV1Schema: z.ZodObject<{
92
+ schemaVersion: z.ZodLiteral<1>;
93
+ attemptId: z.ZodString;
94
+ at: z.ZodNumber;
95
+ channel: z.ZodEnum<{
96
+ email: "email";
97
+ inApp: "inApp";
98
+ }>;
99
+ result: z.ZodEnum<{
100
+ queued: "queued";
101
+ failed: "failed";
102
+ deferred: "deferred";
103
+ sent: "sent";
104
+ }>;
105
+ providerRef: z.ZodOptional<z.ZodString>;
106
+ errorCode: z.ZodOptional<z.ZodString>;
107
+ }, z.core.$strict>;
108
+ export type NciiUploaderNoticeAttemptV1 = z.infer<typeof NciiUploaderNoticeAttemptV1Schema>;
109
+ //# sourceMappingURL=notices.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notices.d.ts","sourceRoot":"","sources":["../../../src/doc-schemas/ncii/notices.ts"],"names":[],"mappings":"AAqCA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB,+BAA+B;AAC/B,eAAO,MAAM,+BAA+B;;;EAA6B,CAAC;AAC1E,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAExF,+EAA+E;AAC/E,eAAO,MAAM,yCAAyC;;;;kBAI3C,CAAC;AACZ,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yCAAyC,CAAC,CAAC;AAE5G,gEAAgE;AAChE,eAAO,MAAM,iCAAiC;;;;;;;kBAOnC,CAAC;AACZ,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAM5F;;;mGAGmG;AACnG,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA6B5B,CAAC;AACZ,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAO9E,mCAAmC;AACnC,eAAO,MAAM,qCAAqC;;;;;EAAmD,CAAC;AACtG,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qCAAqC,CAAC,CAAC;AAEpG;;oDAEoD;AACpD,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;kBAQnC,CAAC;AACZ,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC"}