@xnetjs/data 0.0.2 → 0.1.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.
Files changed (139) hide show
  1. package/README.md +112 -0
  2. package/dist/account-MWNCH4GJ.js +12 -0
  3. package/dist/account-ledger-R2GAFJL6.js +38 -0
  4. package/dist/auth/index.d.ts +420 -0
  5. package/dist/auth/index.js +102 -0
  6. package/dist/budget-NN7P35XP.js +12 -0
  7. package/dist/canvas-6WYBNH53.js +10 -0
  8. package/dist/channel-AT3LQF4A.js +12 -0
  9. package/dist/chat-message-DSVO72B3.js +10 -0
  10. package/dist/chunk-2ZNJWIQG.js +84 -0
  11. package/dist/chunk-3J3HILXO.js +46 -0
  12. package/dist/chunk-3RUDVTMH.js +5543 -0
  13. package/dist/chunk-4EYKGTSQ.js +49 -0
  14. package/dist/chunk-53F4PRNC.js +32 -0
  15. package/dist/chunk-5EXHNXPL.js +48 -0
  16. package/dist/{chunk-BQBPA5HS.js → chunk-5HC5NO57.js} +16 -2
  17. package/dist/chunk-6KLGA6IR.js +47 -0
  18. package/dist/chunk-6OMG4I7M.js +41 -0
  19. package/dist/chunk-7PDRDSFH.js +69 -0
  20. package/dist/chunk-BQLQSWKZ.js +232 -0
  21. package/dist/chunk-BY5O6LNC.js +380 -0
  22. package/dist/chunk-DCTRX6II.js +40 -0
  23. package/dist/{chunk-VYR5GPJP.js → chunk-DWEXKD6E.js} +9 -3
  24. package/dist/chunk-EBNMV2VO.js +896 -0
  25. package/dist/chunk-FVEACSKE.js +102 -0
  26. package/dist/chunk-GU6THOAB.js +45 -0
  27. package/dist/chunk-H4GA4BBK.js +75 -0
  28. package/dist/chunk-IJ44LR7N.js +76 -0
  29. package/dist/chunk-J4ANIXIV.js +402 -0
  30. package/dist/chunk-JDFNMFOZ.js +45 -0
  31. package/dist/chunk-K7DOZWWT.js +1811 -0
  32. package/dist/chunk-KQAT4XBL.js +49 -0
  33. package/dist/chunk-KQUALW4O.js +183 -0
  34. package/dist/chunk-LYSWLCOI.js +47 -0
  35. package/dist/chunk-MBTUO3ZL.js +65 -0
  36. package/dist/chunk-NI4FHG2K.js +52 -0
  37. package/dist/chunk-OCMSAKWV.js +78 -0
  38. package/dist/chunk-OGJCRNGE.js +57 -0
  39. package/dist/chunk-OPPHF3TF.js +143 -0
  40. package/dist/{chunk-IDMBCRUC.js → chunk-OSAWNZVM.js} +1 -1
  41. package/dist/chunk-PMUQACPY.js +33 -0
  42. package/dist/chunk-PNESGUH5.js +63 -0
  43. package/dist/chunk-Q3IEGH4B.js +51 -0
  44. package/dist/chunk-QJW5LDP4.js +52 -0
  45. package/dist/chunk-QWFTRZQT.js +142 -0
  46. package/dist/{chunk-SZC345Z2.js → chunk-RL64OJJ5.js} +1025 -1110
  47. package/dist/chunk-S5RP5RKY.js +416 -0
  48. package/dist/chunk-S6U6TCMN.js +722 -0
  49. package/dist/chunk-SVNGSZZA.js +69 -0
  50. package/dist/chunk-T5AZAOG5.js +54 -0
  51. package/dist/chunk-TCTZW4A6.js +42 -0
  52. package/dist/chunk-U64CW73O.js +109 -0
  53. package/dist/chunk-UDWKWTAX.js +6526 -0
  54. package/dist/chunk-UQM3G5A2.js +148 -0
  55. package/dist/chunk-VQ7JHB67.js +57 -0
  56. package/dist/chunk-W7EBL7ZU.js +73 -0
  57. package/dist/chunk-WEPK7SZF.js +65 -0
  58. package/dist/chunk-XHEA5UER.js +75 -0
  59. package/dist/chunk-XMSKJ5PV.js +66 -0
  60. package/dist/chunk-XROI44ZP.js +64 -0
  61. package/dist/chunk-Y3S5SRVM.js +45 -0
  62. package/dist/chunk-YEFKQYKA.js +43 -0
  63. package/dist/chunk-YSUIXD2Y.js +105 -0
  64. package/dist/chunk-ZCOFZY5M.js +70 -0
  65. package/dist/chunk-ZLU4Y3O2.js +50 -0
  66. package/dist/chunk-ZPZ7XDA6.js +54 -0
  67. package/dist/chunk-ZZ6TWKGS.js +40 -0
  68. package/dist/clone-C0Jhk2UN.d.ts +2205 -0
  69. package/dist/comment-QSWYAQVS.js +10 -0
  70. package/dist/crm-L5RYAAF3.js +68 -0
  71. package/dist/dashboard-JMKTTRA7.js +10 -0
  72. package/dist/database/index.d.ts +882 -0
  73. package/dist/database/index.js +523 -0
  74. package/dist/database-GIXSPZJW.js +10 -0
  75. package/dist/database-field-3EPAMZUR.js +10 -0
  76. package/dist/database-row-6Q6TRVE4.js +10 -0
  77. package/dist/database-select-option-BBBJFLLH.js +10 -0
  78. package/dist/database-view-5PLSOBI2.js +10 -0
  79. package/dist/experiment-DOVOZ34Y.js +10 -0
  80. package/dist/external-item-P2E5X7BZ.js +14 -0
  81. package/dist/external-reference-7BSFF6SA.js +8 -0
  82. package/dist/feed-2IXHHP6O.js +12 -0
  83. package/dist/feed-item-DPE6LN7I.js +12 -0
  84. package/dist/folder-6KM3KYD5.js +21 -0
  85. package/dist/game-5AK5XWBR.js +50 -0
  86. package/dist/grant-WTQSNT5A.js +8 -0
  87. package/dist/grant-expiration-cleaner-CY6BcmlR.d.ts +249 -0
  88. package/dist/import-batch-IXBJLQPJ.js +12 -0
  89. package/dist/inbox-state-E5NSVOGP.js +12 -0
  90. package/dist/index.d.ts +224 -4548
  91. package/dist/index.js +2252 -4754
  92. package/dist/map-RG5Y3CPC.js +10 -0
  93. package/dist/media-asset-QTCGLIZA.js +8 -0
  94. package/dist/memory-PNRTMBZO.js +12 -0
  95. package/dist/metric-65SVOX5C.js +10 -0
  96. package/dist/milestone-XEO6ZGDG.js +12 -0
  97. package/dist/moderation-FFHETMRB.js +30 -0
  98. package/dist/observation-2Y3QKUXM.js +10 -0
  99. package/dist/page-2V27JGKJ.js +10 -0
  100. package/dist/posting-GBOSZCMZ.js +12 -0
  101. package/dist/profile-BLLDWIDK.js +8 -0
  102. package/dist/project-CQL5LN26.js +10 -0
  103. package/dist/query-ast-C3m6kZYv.d.ts +226 -0
  104. package/dist/reaction-T2DTJBBV.js +10 -0
  105. package/dist/registry-DunPv__d.d.ts +99 -0
  106. package/dist/saved-view-4R2DBCL3.js +10 -0
  107. package/dist/schema/index.d.ts +6489 -0
  108. package/dist/schema/index.js +677 -0
  109. package/dist/schema-extension-LNRF2YRD.js +18 -0
  110. package/dist/space-IJU24PBH.js +42 -0
  111. package/dist/space-membership-DEUMM7NV.js +14 -0
  112. package/dist/store/index.d.ts +518 -0
  113. package/dist/store/index.js +135 -0
  114. package/dist/store-DtIDjk7c.d.ts +355 -0
  115. package/dist/sync/awareness.d.ts +69 -0
  116. package/dist/sync/awareness.js +20 -0
  117. package/dist/system-ILHCZOVO.js +38 -0
  118. package/dist/tag-SKCHM3U5.js +16 -0
  119. package/dist/task-7AOBP7WC.js +16 -0
  120. package/dist/task-view-NUGKELJP.js +10 -0
  121. package/dist/transaction-ZDSEGDIR.js +12 -0
  122. package/dist/transcription-PSCLDAGX.js +12 -0
  123. package/dist/types-S-BJAKyK.d.ts +1576 -0
  124. package/dist/updates.d.ts +44 -0
  125. package/dist/updates.js +16 -0
  126. package/dist/user-widget-RLY2N46A.js +8 -0
  127. package/dist/view-types-DSde-uT_.d.ts +316 -0
  128. package/package.json +32 -9
  129. package/dist/canvas-HSIKIQFK.js +0 -7
  130. package/dist/chunk-2L5ZUGG5.js +0 -53
  131. package/dist/chunk-4MTS5KAQ.js +0 -22
  132. package/dist/chunk-GZHARFKC.js +0 -25
  133. package/dist/chunk-WKIKJTI2.js +0 -45
  134. package/dist/comment-277JD7DV.js +0 -7
  135. package/dist/database-W3KEHLI3.js +0 -7
  136. package/dist/database-row-3O2QSNZN.js +0 -7
  137. package/dist/grant-QVZ454YC.js +0 -7
  138. package/dist/page-O4WTOIEO.js +0 -7
  139. package/dist/task-SEKAYJH7.js +0 -7
@@ -0,0 +1,722 @@
1
+ import {
2
+ checkbox,
3
+ created,
4
+ createdBy,
5
+ date,
6
+ defineSchema,
7
+ multiSelect,
8
+ number,
9
+ person,
10
+ relation,
11
+ select,
12
+ text,
13
+ updated,
14
+ url
15
+ } from "./chunk-EBNMV2VO.js";
16
+ import {
17
+ allow,
18
+ role
19
+ } from "./chunk-RL64OJJ5.js";
20
+
21
+ // src/schema/schemas/moderation.ts
22
+ var withOperators = (roles = []) => [
23
+ .../* @__PURE__ */ new Set(["owner", "operator", ...roles])
24
+ ];
25
+ var withOwners = (roles = []) => [.../* @__PURE__ */ new Set(["owner", ...roles])];
26
+ var createModerationAuthorization = (options = {}) => ({
27
+ roles: {
28
+ owner: role.creator(),
29
+ operator: role.property("operators"),
30
+ ...options.roles
31
+ },
32
+ actions: {
33
+ read: allow(...withOperators(options.read)),
34
+ write: allow(...withOperators(options.write)),
35
+ delete: allow(...withOwners(options.delete)),
36
+ share: allow(...withOperators(options.share)),
37
+ admin: allow(...withOwners(options.admin))
38
+ },
39
+ ...options.publicProps !== void 0 ? { publicProps: [...options.publicProps] } : {}
40
+ });
41
+ var reportAuthorization = createModerationAuthorization({
42
+ roles: {
43
+ reporter: role.property("reporter"),
44
+ reviewer: role.property("reviewers")
45
+ },
46
+ read: ["reporter", "reviewer"],
47
+ write: ["reviewer"],
48
+ share: ["reviewer"],
49
+ admin: ["reviewer"]
50
+ });
51
+ var labelAuthorization = createModerationAuthorization({
52
+ roles: {
53
+ labeler: role.property("labelers"),
54
+ reviewer: role.property("reviewers"),
55
+ source: role.property("sourceDID")
56
+ },
57
+ read: ["labeler", "reviewer", "source"],
58
+ write: ["labeler", "reviewer", "source"],
59
+ share: ["reviewer"]
60
+ });
61
+ var policyListAuthorization = createModerationAuthorization({
62
+ roles: {
63
+ publisher: role.property("publisher"),
64
+ policyPublisher: role.property("publishers"),
65
+ labeler: role.property("labelers"),
66
+ reviewer: role.property("reviewers")
67
+ },
68
+ read: ["publisher", "policyPublisher", "labeler", "reviewer"],
69
+ write: ["publisher", "policyPublisher"],
70
+ share: ["publisher", "policyPublisher"],
71
+ admin: ["publisher", "policyPublisher"]
72
+ });
73
+ var subscriptionAuthorization = createModerationAuthorization({
74
+ roles: {
75
+ subscriber: role.property("subscriber")
76
+ },
77
+ read: ["subscriber"],
78
+ write: ["subscriber"]
79
+ });
80
+ var publicInteractionPolicyAuthorization = createModerationAuthorization({
81
+ roles: {
82
+ maintainer: role.property("maintainers"),
83
+ moderator: role.property("moderators"),
84
+ policyPublisher: role.property("policyPublishers"),
85
+ targetOwner: role.relation("target", "owner"),
86
+ targetAdmin: role.relation("target", "admin")
87
+ },
88
+ read: ["maintainer", "moderator", "policyPublisher", "targetOwner", "targetAdmin"],
89
+ write: ["maintainer", "moderator", "targetOwner", "targetAdmin"],
90
+ share: ["maintainer", "policyPublisher", "targetOwner", "targetAdmin"],
91
+ admin: ["maintainer", "targetOwner", "targetAdmin"],
92
+ publicProps: [
93
+ "target",
94
+ "targetSchema",
95
+ "scope",
96
+ "commentMode",
97
+ "replyMode",
98
+ "reactionMode",
99
+ "quoteMode",
100
+ "mentionMode",
101
+ "communityNoteMode",
102
+ "messageMode",
103
+ "crawlMode",
104
+ "indexMode",
105
+ "defaultVisibility",
106
+ "firstContactMode",
107
+ "moderationMode",
108
+ "slowModeSeconds",
109
+ "maxRootCommentsPerHour",
110
+ "maxRepliesPerHour",
111
+ "maxReactionsPerHour",
112
+ "maxMentionsPerComment",
113
+ "minimumAccountAgeHours",
114
+ "minimumReputation",
115
+ "trustThreshold",
116
+ "quarantineConfidenceThreshold",
117
+ "hideConfidenceThreshold",
118
+ "requiresVerifiedIdentity",
119
+ "acceptsPolicySubscriptions",
120
+ "policyLists",
121
+ "updatedAt"
122
+ ]
123
+ });
124
+ var messageRequestAuthorization = createModerationAuthorization({
125
+ roles: {
126
+ sender: role.property("sender"),
127
+ recipient: role.property("recipient"),
128
+ reviewer: role.property("reviewers")
129
+ },
130
+ read: ["sender", "recipient", "reviewer"],
131
+ write: ["sender", "recipient", "reviewer"],
132
+ share: ["recipient", "reviewer"],
133
+ admin: ["recipient", "reviewer"]
134
+ });
135
+ var communityNoteAuthorization = createModerationAuthorization({
136
+ roles: {
137
+ author: role.property("author"),
138
+ reviewer: role.property("reviewers")
139
+ },
140
+ read: ["author", "reviewer"],
141
+ write: ["author", "reviewer"],
142
+ share: ["author", "reviewer"]
143
+ });
144
+ var noteRatingAuthorization = createModerationAuthorization({
145
+ roles: {
146
+ rater: role.property("rater"),
147
+ reviewer: role.property("reviewers")
148
+ },
149
+ read: ["rater", "reviewer"],
150
+ write: ["rater", "reviewer"]
151
+ });
152
+ var signalAuthorization = createModerationAuthorization({
153
+ roles: {
154
+ source: role.property("sourceDID"),
155
+ reviewer: role.property("reviewers")
156
+ },
157
+ read: ["source", "reviewer"],
158
+ write: ["source", "reviewer"],
159
+ share: ["reviewer"]
160
+ });
161
+ var provenanceAuthorization = createModerationAuthorization({
162
+ roles: {
163
+ source: role.property("sourceDID"),
164
+ reviewer: role.property("reviewers")
165
+ },
166
+ read: ["source", "reviewer"],
167
+ write: ["source", "reviewer"],
168
+ share: ["reviewer"]
169
+ });
170
+ var appealAuthorization = createModerationAuthorization({
171
+ roles: {
172
+ appellant: role.property("appellant"),
173
+ reviewer: role.property("reviewers")
174
+ },
175
+ read: ["appellant", "reviewer"],
176
+ write: ["appellant", "reviewer"],
177
+ share: ["reviewer"],
178
+ admin: ["reviewer"]
179
+ });
180
+ var reviewTaskAuthorization = createModerationAuthorization({
181
+ roles: {
182
+ reviewer: role.property("reviewers"),
183
+ assignee: role.property("assignedTo"),
184
+ resolver: role.property("resolvedBy")
185
+ },
186
+ read: ["reviewer", "assignee", "resolver"],
187
+ write: ["reviewer", "assignee", "resolver"],
188
+ share: ["reviewer"],
189
+ admin: ["reviewer"]
190
+ });
191
+ var commonModerationMetadata = {
192
+ operators: person({ multiple: true }),
193
+ createdAt: created(),
194
+ createdBy: createdBy(),
195
+ updatedAt: updated()
196
+ };
197
+ var policyScopes = [
198
+ { id: "user", name: "User", color: "gray" },
199
+ { id: "workspace", name: "Workspace", color: "blue" },
200
+ { id: "community", name: "Community", color: "green" },
201
+ { id: "hub", name: "Hub", color: "purple" },
202
+ { id: "appView", name: "App View", color: "orange" },
203
+ { id: "protocol", name: "Protocol", color: "red" }
204
+ ];
205
+ var labelValues = [
206
+ { id: "spam", name: "Spam", color: "red" },
207
+ { id: "scam", name: "Scam", color: "red" },
208
+ { id: "malware", name: "Malware", color: "red" },
209
+ { id: "impersonation", name: "Impersonation", color: "orange" },
210
+ { id: "harassment", name: "Harassment", color: "orange" },
211
+ { id: "slop", name: "AI Slop", color: "yellow" },
212
+ { id: "inaccurate", name: "Inaccurate", color: "yellow" },
213
+ { id: "unsupported", name: "Unsupported", color: "yellow" },
214
+ { id: "stale", name: "Stale", color: "gray" },
215
+ { id: "synthetic", name: "Synthetic", color: "blue" },
216
+ // Sensitivity labels (exploration 0175) — aligned to the ATProto/Bluesky
217
+ // moderation lexicon so third-party labelers interoperate. These are a
218
+ // per-viewer filtering concern, not a platform-hide concern.
219
+ { id: "sexual", name: "Sexually suggestive", color: "pink" },
220
+ { id: "nudity", name: "Non-sexual nudity", color: "pink" },
221
+ { id: "porn", name: "Explicit / pornographic", color: "red" },
222
+ { id: "graphic-media", name: "Graphic / violent", color: "orange" },
223
+ { id: "safe", name: "Safe", color: "green" }
224
+ ];
225
+ var signalSources = [
226
+ { id: "user", name: "User", color: "blue" },
227
+ { id: "local-ai", name: "Local AI", color: "green" },
228
+ { id: "cloud-ai", name: "Cloud AI", color: "purple" },
229
+ { id: "community-note", name: "Community Note", color: "yellow" },
230
+ { id: "labeler", name: "Labeler", color: "teal" },
231
+ { id: "policy-list", name: "Policy List", color: "orange" },
232
+ { id: "hub", name: "Hub", color: "red" },
233
+ { id: "crawler", name: "Crawler", color: "gray" }
234
+ ];
235
+ var reviewQueues = [
236
+ { id: "safety", name: "Safety", color: "red" },
237
+ { id: "quality", name: "Quality", color: "yellow" },
238
+ { id: "appeal", name: "Appeal", color: "blue" },
239
+ { id: "operator", name: "Operator", color: "purple" }
240
+ ];
241
+ var reviewStatuses = [
242
+ { id: "open", name: "Open", color: "blue" },
243
+ { id: "in-progress", name: "In Progress", color: "yellow" },
244
+ { id: "resolved", name: "Resolved", color: "green" },
245
+ { id: "escalated", name: "Escalated", color: "orange" },
246
+ { id: "closed", name: "Closed", color: "gray" }
247
+ ];
248
+ var interactionModes = [
249
+ { id: "open", name: "Open", color: "green" },
250
+ { id: "authenticated", name: "Authenticated", color: "blue" },
251
+ { id: "trusted", name: "Trusted", color: "purple" },
252
+ { id: "reviewed", name: "Reviewed", color: "yellow" },
253
+ { id: "closed", name: "Closed", color: "red" }
254
+ ];
255
+ var firstContactModes = [
256
+ { id: "allow", name: "Allow", color: "green" },
257
+ { id: "slow-mode", name: "Slow Mode", color: "blue" },
258
+ { id: "quarantine", name: "Quarantine", color: "purple" },
259
+ { id: "review", name: "Review", color: "yellow" },
260
+ { id: "block", name: "Block", color: "red" }
261
+ ];
262
+ var moderationModes = [
263
+ { id: "off", name: "Off", color: "gray" },
264
+ { id: "label-only", name: "Label Only", color: "blue" },
265
+ { id: "post-review", name: "Post Review", color: "yellow" },
266
+ { id: "pre-filter", name: "Pre Filter", color: "orange" },
267
+ { id: "pre-review", name: "Pre Review", color: "red" }
268
+ ];
269
+ var defaultVisibilityModes = [
270
+ { id: "visible", name: "Visible", color: "green" },
271
+ { id: "collapsed", name: "Collapsed", color: "yellow" },
272
+ { id: "quarantined", name: "Quarantined", color: "purple" },
273
+ { id: "hidden", name: "Hidden", color: "red" }
274
+ ];
275
+ var messageRequestStatuses = [
276
+ { id: "pending", name: "Pending", color: "yellow" },
277
+ { id: "accepted", name: "Accepted", color: "green" },
278
+ { id: "declined", name: "Declined", color: "gray" },
279
+ { id: "quarantined", name: "Quarantined", color: "purple" },
280
+ { id: "blocked", name: "Blocked", color: "red" },
281
+ { id: "expired", name: "Expired", color: "gray" }
282
+ ];
283
+ var firstContactAdmissionModes = [
284
+ { id: "allow", name: "Allow", color: "green" },
285
+ { id: "message-request", name: "Message Request", color: "blue" },
286
+ { id: "quarantine", name: "Quarantine", color: "purple" },
287
+ { id: "review", name: "Review", color: "yellow" },
288
+ { id: "block", name: "Block", color: "red" }
289
+ ];
290
+ var firstContactReasonCodes = [
291
+ { id: "first-contact", name: "First Contact", color: "blue" },
292
+ { id: "trusted-sender", name: "Trusted Sender", color: "green" },
293
+ { id: "known-contact", name: "Known Contact", color: "green" },
294
+ { id: "sender-muted", name: "Sender Muted", color: "yellow" },
295
+ { id: "sender-blocked", name: "Sender Blocked", color: "red" },
296
+ { id: "review-required", name: "Review Required", color: "orange" },
297
+ { id: "verified-identity-required", name: "Verified Identity Required", color: "purple" },
298
+ { id: "policy-allow", name: "Policy Allow", color: "green" },
299
+ { id: "policy-slow-mode", name: "Policy Slow Mode", color: "blue" },
300
+ { id: "policy-quarantine", name: "Policy Quarantine", color: "purple" },
301
+ { id: "policy-review", name: "Policy Review", color: "yellow" },
302
+ { id: "policy-block", name: "Policy Block", color: "red" }
303
+ ];
304
+ var AbuseReportSchema = defineSchema({
305
+ name: "AbuseReport",
306
+ namespace: "xnet://xnet.fyi/",
307
+ properties: {
308
+ target: relation({ required: true }),
309
+ targetSchema: text({}),
310
+ reporter: person({ required: true }),
311
+ category: select({
312
+ options: labelValues,
313
+ required: true
314
+ }),
315
+ reason: text({ required: true, maxLength: 4e3 }),
316
+ evidenceRefs: text({}),
317
+ observedAt: date({ includeTime: true }),
318
+ status: select({
319
+ options: [
320
+ { id: "open", name: "Open", color: "blue" },
321
+ { id: "triaged", name: "Triaged", color: "yellow" },
322
+ { id: "accepted", name: "Accepted", color: "green" },
323
+ { id: "rejected", name: "Rejected", color: "gray" },
324
+ { id: "duplicate", name: "Duplicate", color: "gray" }
325
+ ],
326
+ default: "open"
327
+ }),
328
+ reviewedBy: person({}),
329
+ reviewedAt: date({ includeTime: true }),
330
+ resolution: text({ maxLength: 4e3 }),
331
+ reviewers: person({ multiple: true }),
332
+ ...commonModerationMetadata
333
+ },
334
+ authorization: reportAuthorization
335
+ });
336
+ var ModerationLabelSchema = defineSchema({
337
+ name: "ModerationLabel",
338
+ namespace: "xnet://xnet.fyi/",
339
+ properties: {
340
+ target: relation({ required: true }),
341
+ targetSchema: text({}),
342
+ value: select({
343
+ options: labelValues,
344
+ required: true
345
+ }),
346
+ sourceDID: person({ required: true }),
347
+ sourceType: select({
348
+ options: signalSources,
349
+ required: true
350
+ }),
351
+ confidence: number({ required: true, min: 0, max: 1 }),
352
+ sourceWeight: number({ required: true, min: 0, max: 10 }),
353
+ evidenceRefs: text({}),
354
+ expiresAt: date({ includeTime: true }),
355
+ negates: relation({}),
356
+ policyList: relation({}),
357
+ modelProvider: text({ maxLength: 200 }),
358
+ modelName: text({ maxLength: 200 }),
359
+ modelVersion: text({ maxLength: 200 }),
360
+ signedEnvelope: text({}),
361
+ labelers: person({ multiple: true }),
362
+ reviewers: person({ multiple: true }),
363
+ ...commonModerationMetadata
364
+ },
365
+ authorization: labelAuthorization
366
+ });
367
+ var PolicyListSchema = defineSchema({
368
+ name: "PolicyList",
369
+ namespace: "xnet://xnet.fyi/",
370
+ properties: {
371
+ title: text({ required: true, maxLength: 500 }),
372
+ description: text({ maxLength: 4e3 }),
373
+ publisher: person({ required: true }),
374
+ scope: select({
375
+ options: policyScopes,
376
+ required: true
377
+ }),
378
+ defaultAction: select({
379
+ options: [
380
+ { id: "allow", name: "Allow", color: "green" },
381
+ { id: "warn", name: "Warn", color: "yellow" },
382
+ { id: "demote", name: "Demote", color: "orange" },
383
+ { id: "hide", name: "Hide", color: "red" },
384
+ { id: "quarantine", name: "Quarantine", color: "purple" },
385
+ { id: "block-peer", name: "Block Peer", color: "red" }
386
+ ],
387
+ default: "warn"
388
+ }),
389
+ entries: text({ required: true }),
390
+ labelers: person({ multiple: true }),
391
+ reviewers: person({ multiple: true }),
392
+ publishers: person({ multiple: true }),
393
+ appealContact: text({ maxLength: 500 }),
394
+ signedEnvelope: text({}),
395
+ ...commonModerationMetadata
396
+ },
397
+ authorization: policyListAuthorization
398
+ });
399
+ var PolicySubscriptionSchema = defineSchema({
400
+ name: "PolicySubscription",
401
+ namespace: "xnet://xnet.fyi/",
402
+ properties: {
403
+ policyList: relation({ required: true }),
404
+ subscriber: person({ required: true }),
405
+ scope: select({
406
+ options: policyScopes,
407
+ required: true
408
+ }),
409
+ trust: number({ required: true, min: 0, max: 1 }),
410
+ maxLabelsPerHour: number({ min: 0, integer: true }),
411
+ localOverride: checkbox({ default: true }),
412
+ enabled: checkbox({ default: true }),
413
+ expiresAt: date({ includeTime: true }),
414
+ lastSyncedAt: date({ includeTime: true }),
415
+ ...commonModerationMetadata
416
+ },
417
+ authorization: subscriptionAuthorization
418
+ });
419
+ var PublicInteractionPolicySchema = defineSchema({
420
+ name: "PublicInteractionPolicy",
421
+ namespace: "xnet://xnet.fyi/",
422
+ properties: {
423
+ target: relation({ required: true }),
424
+ targetSchema: text({}),
425
+ scope: select({
426
+ options: policyScopes,
427
+ required: true
428
+ }),
429
+ commentMode: select({
430
+ options: interactionModes,
431
+ default: "authenticated"
432
+ }),
433
+ replyMode: select({
434
+ options: interactionModes,
435
+ default: "authenticated"
436
+ }),
437
+ reactionMode: select({
438
+ options: interactionModes,
439
+ default: "authenticated"
440
+ }),
441
+ quoteMode: select({
442
+ options: interactionModes,
443
+ default: "trusted"
444
+ }),
445
+ mentionMode: select({
446
+ options: interactionModes,
447
+ default: "trusted"
448
+ }),
449
+ communityNoteMode: select({
450
+ options: interactionModes,
451
+ default: "reviewed"
452
+ }),
453
+ messageMode: select({
454
+ options: interactionModes,
455
+ default: "authenticated"
456
+ }),
457
+ crawlMode: select({
458
+ options: interactionModes,
459
+ default: "closed"
460
+ }),
461
+ indexMode: select({
462
+ options: interactionModes,
463
+ default: "reviewed"
464
+ }),
465
+ defaultVisibility: select({
466
+ options: defaultVisibilityModes,
467
+ default: "visible"
468
+ }),
469
+ firstContactMode: select({
470
+ options: firstContactModes,
471
+ default: "slow-mode"
472
+ }),
473
+ moderationMode: select({
474
+ options: moderationModes,
475
+ default: "post-review"
476
+ }),
477
+ slowModeSeconds: number({ min: 0, integer: true }),
478
+ maxRootCommentsPerHour: number({ min: 0, integer: true }),
479
+ maxRepliesPerHour: number({ min: 0, integer: true }),
480
+ maxReactionsPerHour: number({ min: 0, integer: true }),
481
+ maxMentionsPerComment: number({ min: 0, integer: true }),
482
+ minimumAccountAgeHours: number({ min: 0, integer: true }),
483
+ minimumReputation: number({ min: 0 }),
484
+ trustThreshold: number({ min: 0, max: 1 }),
485
+ quarantineConfidenceThreshold: number({ min: 0, max: 1 }),
486
+ hideConfidenceThreshold: number({ min: 0, max: 1 }),
487
+ requiresVerifiedIdentity: checkbox({ default: false }),
488
+ acceptsPolicySubscriptions: checkbox({ default: true }),
489
+ policyLists: relation({ multiple: true }),
490
+ activeLabels: multiSelect({
491
+ options: labelValues
492
+ }),
493
+ maintainers: person({ multiple: true }),
494
+ moderators: person({ multiple: true }),
495
+ policyPublishers: person({ multiple: true }),
496
+ trustedDIDs: person({ multiple: true }),
497
+ mutedDIDs: person({ multiple: true }),
498
+ blockedDIDs: person({ multiple: true }),
499
+ rationale: text({ maxLength: 4e3 }),
500
+ ...commonModerationMetadata
501
+ },
502
+ authorization: publicInteractionPolicyAuthorization
503
+ });
504
+ var MessageRequestSchema = defineSchema({
505
+ name: "MessageRequest",
506
+ namespace: "xnet://xnet.fyi/",
507
+ properties: {
508
+ conversationKey: text({ required: true, maxLength: 500 }),
509
+ sender: person({ required: true }),
510
+ recipient: person({ required: true }),
511
+ target: relation({}),
512
+ targetSchema: text({}),
513
+ firstMessageRef: relation({}),
514
+ firstMessagePreview: text({ maxLength: 1e3 }),
515
+ status: select({
516
+ options: messageRequestStatuses,
517
+ default: "pending"
518
+ }),
519
+ admission: select({
520
+ options: firstContactAdmissionModes,
521
+ default: "message-request"
522
+ }),
523
+ reasonCodes: multiSelect({
524
+ options: firstContactReasonCodes
525
+ }),
526
+ confidence: number({ min: 0, max: 1 }),
527
+ policy: relation({}),
528
+ policyMode: select({
529
+ options: firstContactModes
530
+ }),
531
+ quarantineUntil: date({ includeTime: true }),
532
+ expiresAt: date({ includeTime: true }),
533
+ respondedAt: date({ includeTime: true }),
534
+ respondedBy: person({}),
535
+ reviewers: person({ multiple: true }),
536
+ notes: text({ maxLength: 4e3 }),
537
+ signedEnvelope: text({}),
538
+ ...commonModerationMetadata
539
+ },
540
+ authorization: messageRequestAuthorization
541
+ });
542
+ var CommunityNoteSchema = defineSchema({
543
+ name: "CommunityNote",
544
+ namespace: "xnet://xnet.fyi/",
545
+ properties: {
546
+ target: relation({ required: true }),
547
+ targetSchema: text({}),
548
+ author: person({ required: true }),
549
+ body: text({ required: true, maxLength: 1e4 }),
550
+ claim: text({ maxLength: 1e3 }),
551
+ citations: text({}),
552
+ status: select({
553
+ options: [
554
+ { id: "draft", name: "Draft", color: "gray" },
555
+ { id: "published", name: "Published", color: "green" },
556
+ { id: "hidden", name: "Hidden", color: "red" },
557
+ { id: "retracted", name: "Retracted", color: "orange" }
558
+ ],
559
+ default: "draft"
560
+ }),
561
+ ratingSummary: text({}),
562
+ reviewers: person({ multiple: true }),
563
+ ...commonModerationMetadata
564
+ },
565
+ authorization: communityNoteAuthorization
566
+ });
567
+ var NoteRatingSchema = defineSchema({
568
+ name: "NoteRating",
569
+ namespace: "xnet://xnet.fyi/",
570
+ properties: {
571
+ note: relation({ required: true }),
572
+ rater: person({ required: true }),
573
+ helpfulness: select({
574
+ options: [
575
+ { id: "helpful", name: "Helpful", color: "green" },
576
+ { id: "not-helpful", name: "Not Helpful", color: "red" },
577
+ { id: "needs-source", name: "Needs Source", color: "yellow" },
578
+ { id: "irrelevant", name: "Irrelevant", color: "gray" }
579
+ ],
580
+ required: true
581
+ }),
582
+ perspective: text({ maxLength: 500 }),
583
+ confidence: number({ required: true, min: 0, max: 1 }),
584
+ reason: text({ maxLength: 2e3 }),
585
+ reviewers: person({ multiple: true }),
586
+ ...commonModerationMetadata
587
+ },
588
+ authorization: noteRatingAuthorization
589
+ });
590
+ var QualitySignalSchema = defineSchema({
591
+ name: "QualitySignal",
592
+ namespace: "xnet://xnet.fyi/",
593
+ properties: {
594
+ target: relation({ required: true }),
595
+ sourceDID: person({ required: true }),
596
+ sourceType: select({
597
+ options: signalSources,
598
+ required: true
599
+ }),
600
+ signal: select({
601
+ options: [
602
+ { id: "duplicate", name: "Duplicate", color: "gray" },
603
+ { id: "slop", name: "AI Slop", color: "yellow" },
604
+ { id: "citation-coverage", name: "Citation Coverage", color: "blue" },
605
+ { id: "provenance", name: "Provenance", color: "green" },
606
+ { id: "claim-mismatch", name: "Claim Mismatch", color: "orange" },
607
+ { id: "freshness", name: "Freshness", color: "purple" }
608
+ ],
609
+ required: true
610
+ }),
611
+ score: number({ required: true, min: 0, max: 1 }),
612
+ confidence: number({ required: true, min: 0, max: 1 }),
613
+ evidenceRefs: text({}),
614
+ modelProvider: text({ maxLength: 200 }),
615
+ modelName: text({ maxLength: 200 }),
616
+ modelVersion: text({ maxLength: 200 }),
617
+ expiresAt: date({ includeTime: true }),
618
+ reviewers: person({ multiple: true }),
619
+ ...commonModerationMetadata
620
+ },
621
+ authorization: signalAuthorization
622
+ });
623
+ var ContentProvenanceSchema = defineSchema({
624
+ name: "ContentProvenance",
625
+ namespace: "xnet://xnet.fyi/",
626
+ properties: {
627
+ target: relation({ required: true }),
628
+ sourceUrl: url({}),
629
+ sourceDID: person({}),
630
+ sourceType: select({
631
+ options: [
632
+ { id: "human", name: "Human", color: "green" },
633
+ { id: "ai", name: "AI", color: "purple" },
634
+ { id: "mixed", name: "Mixed", color: "yellow" },
635
+ { id: "crawl", name: "Crawl", color: "blue" },
636
+ { id: "import", name: "Import", color: "gray" },
637
+ { id: "syndicated", name: "Syndicated", color: "orange" }
638
+ ],
639
+ required: true
640
+ }),
641
+ aiGenerated: checkbox({ default: false }),
642
+ modelProvider: text({ maxLength: 200 }),
643
+ modelName: text({ maxLength: 200 }),
644
+ modelVersion: text({ maxLength: 200 }),
645
+ toolchain: text({}),
646
+ credentials: text({}),
647
+ c2paManifest: text({}),
648
+ capturedAt: date({ includeTime: true }),
649
+ license: text({ maxLength: 500 }),
650
+ reviewers: person({ multiple: true }),
651
+ ...commonModerationMetadata
652
+ },
653
+ authorization: provenanceAuthorization
654
+ });
655
+ var AppealSchema = defineSchema({
656
+ name: "Appeal",
657
+ namespace: "xnet://xnet.fyi/",
658
+ properties: {
659
+ target: relation({ required: true }),
660
+ decision: relation({}),
661
+ appellant: person({ required: true }),
662
+ status: select({
663
+ options: [
664
+ { id: "open", name: "Open", color: "blue" },
665
+ { id: "accepted", name: "Accepted", color: "green" },
666
+ { id: "rejected", name: "Rejected", color: "red" },
667
+ { id: "needs-info", name: "Needs Info", color: "yellow" }
668
+ ],
669
+ default: "open"
670
+ }),
671
+ reason: text({ required: true, maxLength: 4e3 }),
672
+ evidenceRefs: text({}),
673
+ reviewer: person({}),
674
+ reviewedAt: date({ includeTime: true }),
675
+ resolution: text({ maxLength: 4e3 }),
676
+ reviewers: person({ multiple: true }),
677
+ ...commonModerationMetadata
678
+ },
679
+ authorization: appealAuthorization
680
+ });
681
+ var ReviewTaskSchema = defineSchema({
682
+ name: "ReviewTask",
683
+ namespace: "xnet://xnet.fyi/",
684
+ properties: {
685
+ target: relation({ required: true }),
686
+ decision: relation({}),
687
+ queue: select({
688
+ options: reviewQueues,
689
+ required: true
690
+ }),
691
+ priority: number({ required: true, min: 0, max: 100, integer: true }),
692
+ status: select({
693
+ options: reviewStatuses,
694
+ default: "open"
695
+ }),
696
+ assignedTo: person({}),
697
+ dueAt: date({ includeTime: true }),
698
+ reasonCodes: text({}),
699
+ decisionSnapshot: text({}),
700
+ resolvedBy: person({}),
701
+ resolvedAt: date({ includeTime: true }),
702
+ resolution: text({ maxLength: 4e3 }),
703
+ reviewers: person({ multiple: true }),
704
+ ...commonModerationMetadata
705
+ },
706
+ authorization: reviewTaskAuthorization
707
+ });
708
+
709
+ export {
710
+ AbuseReportSchema,
711
+ ModerationLabelSchema,
712
+ PolicyListSchema,
713
+ PolicySubscriptionSchema,
714
+ PublicInteractionPolicySchema,
715
+ MessageRequestSchema,
716
+ CommunityNoteSchema,
717
+ NoteRatingSchema,
718
+ QualitySignalSchema,
719
+ ContentProvenanceSchema,
720
+ AppealSchema,
721
+ ReviewTaskSchema
722
+ };