@chatwarden/core 0.1.1 → 0.1.3

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 (71) hide show
  1. package/README.md +128 -4
  2. package/dist/src/audit.d.ts +27 -5
  3. package/dist/src/audit.d.ts.map +1 -1
  4. package/dist/src/audit.js +57 -6
  5. package/dist/src/audit.js.map +1 -1
  6. package/dist/src/chatwarden.d.ts +183 -11
  7. package/dist/src/chatwarden.d.ts.map +1 -1
  8. package/dist/src/chatwarden.js +65 -10
  9. package/dist/src/chatwarden.js.map +1 -1
  10. package/dist/src/documents.d.ts +12 -2
  11. package/dist/src/documents.d.ts.map +1 -1
  12. package/dist/src/documents.js +56 -34
  13. package/dist/src/documents.js.map +1 -1
  14. package/dist/src/events.d.ts +3 -0
  15. package/dist/src/events.d.ts.map +1 -1
  16. package/dist/src/events.js.map +1 -1
  17. package/dist/src/index.d.ts +20 -11
  18. package/dist/src/index.d.ts.map +1 -1
  19. package/dist/src/index.js +11 -6
  20. package/dist/src/index.js.map +1 -1
  21. package/dist/src/ladder.d.ts +2 -0
  22. package/dist/src/ladder.d.ts.map +1 -1
  23. package/dist/src/ladder.js +1 -1
  24. package/dist/src/ladder.js.map +1 -1
  25. package/dist/src/policy.d.ts +129 -0
  26. package/dist/src/policy.d.ts.map +1 -0
  27. package/dist/src/policy.js +242 -0
  28. package/dist/src/policy.js.map +1 -0
  29. package/dist/src/profile.d.ts +120 -7
  30. package/dist/src/profile.d.ts.map +1 -1
  31. package/dist/src/profile.js +295 -7
  32. package/dist/src/profile.js.map +1 -1
  33. package/dist/src/reporting.d.ts +127 -0
  34. package/dist/src/reporting.d.ts.map +1 -0
  35. package/dist/src/reporting.js +172 -0
  36. package/dist/src/reporting.js.map +1 -0
  37. package/dist/src/reports.d.ts +80 -4
  38. package/dist/src/reports.d.ts.map +1 -1
  39. package/dist/src/reports.js +120 -6
  40. package/dist/src/reports.js.map +1 -1
  41. package/dist/src/staffReports.d.ts +17 -5
  42. package/dist/src/staffReports.d.ts.map +1 -1
  43. package/dist/src/staffReports.js +22 -5
  44. package/dist/src/staffReports.js.map +1 -1
  45. package/dist/src/staffViews.d.ts +138 -0
  46. package/dist/src/staffViews.d.ts.map +1 -0
  47. package/dist/src/staffViews.js +205 -0
  48. package/dist/src/staffViews.js.map +1 -0
  49. package/dist/src/team.d.ts +149 -0
  50. package/dist/src/team.d.ts.map +1 -0
  51. package/dist/src/team.js +385 -0
  52. package/dist/src/team.js.map +1 -0
  53. package/dist/src/types.d.ts +245 -4
  54. package/dist/src/types.d.ts.map +1 -1
  55. package/dist/src/types.js +5 -0
  56. package/dist/src/types.js.map +1 -1
  57. package/package.json +2 -2
  58. package/src/audit.ts +71 -7
  59. package/src/chatwarden.ts +245 -20
  60. package/src/documents.ts +70 -43
  61. package/src/events.ts +10 -1
  62. package/src/index.ts +109 -4
  63. package/src/ladder.ts +1 -1
  64. package/src/policy.ts +288 -0
  65. package/src/profile.ts +369 -14
  66. package/src/reporting.ts +251 -0
  67. package/src/reports.ts +163 -10
  68. package/src/staffReports.ts +33 -7
  69. package/src/staffViews.ts +325 -0
  70. package/src/team.ts +422 -0
  71. package/src/types.ts +257 -4
@@ -1,4 +1,6 @@
1
1
  import type { AuditListQuery, AuditRow } from './audit.js';
2
+ import type { PolicyLayer } from './profile.js';
3
+ import type { RuleRef } from './rules.js';
2
4
  /**
3
5
  * Who a chat line or a sanction is attached to, in storable form.
4
6
  *
@@ -137,6 +139,60 @@ export interface SanctionRow {
137
139
  * other load leaves the property off.
138
140
  */
139
141
  revokedAt?: number | null;
142
+ /**
143
+ * Who revoked the group and why. Set only by `listSubjectSanctions` (null while unrevoked, and on a row revoked
144
+ * before the actor was kept); every other load leaves the properties off.
145
+ */
146
+ revokedBy?: string | null;
147
+ revokeReason?: string | null;
148
+ }
149
+ /**
150
+ * What {@link Store.listSubjectSanctions} takes: the SUBJECT rows of sanction groups, newest first. Never an IP row.
151
+ */
152
+ export interface SanctionListQuery {
153
+ /** Only rows whose stored target is one of these subject ids (a person's canonical id and its aliases). Absent: everyone; empty: nobody. */
154
+ subjects?: readonly SubjectId[];
155
+ /** Only rows from this source. */
156
+ source?: Source;
157
+ /** Only rows with `startsAt >= since`. */
158
+ since?: number;
159
+ /**
160
+ * Only rows in force at this instant, of any age: not revoked, and with no end or an end strictly after it. Combines
161
+ * (AND) with the other filters.
162
+ */
163
+ activeAt?: number;
164
+ /**
165
+ * With `since`: also the rows older than `since` that are permanent (`endsAt` null) and not revoked. Ignored without
166
+ * `since`.
167
+ */
168
+ alsoPermanent?: boolean;
169
+ /** Keyset cursor: only rows older than this (`startsAt` below it, or equal with an id below `beforeId`). `beforeId` without `before` is ignored. */
170
+ before?: number;
171
+ beforeId?: string;
172
+ /** Clamped to 1..200 (a fraction is floored). */
173
+ limit: number;
174
+ }
175
+ /** What {@link Store.reporterTally} counts over the reports a person filed. `badFaith` is the number marked bad faith. */
176
+ export interface ReporterTally {
177
+ open: number;
178
+ actioned: number;
179
+ dismissed: number;
180
+ badFaith: number;
181
+ }
182
+ /**
183
+ * One decided report a person filed that carried a reason, with what its decision did: for the reporter's accuracy. `reason` is
184
+ * the report's stored `reportedReason`; `target` the reported subject as stored; `actions` one entry per sanction group the
185
+ * decision wrote (its subject row: who, and the rule cited, `'uncovered'` included). A dismissal with no actions has an empty list.
186
+ */
187
+ export interface ReporterDecision {
188
+ reportId: string;
189
+ status: 'actioned' | 'dismissed';
190
+ reason: string;
191
+ target: SubjectId;
192
+ actions: Array<{
193
+ subject: SubjectId;
194
+ rule: RuleRef;
195
+ }>;
140
196
  }
141
197
  /**
142
198
  * How serious a piece of behaviour is, as the AI read (K3) or a moderator rates it. The shared vocabulary of every
@@ -193,7 +249,11 @@ export interface DiscordThreadRow {
193
249
  /** Epoch ms. */
194
250
  createdAt: number;
195
251
  }
196
- /** What a player may report another for. */
252
+ /**
253
+ * What a player could report another for in 0.1.1. A report's `category` is still one of these (derived from its reason, so
254
+ * code that reads `category` keeps working), but the reason a player picks is now `reportedReason`, an id from the profile's
255
+ * reporting reasons. `ReportInput.category` stays accepted as an alias of `reason`.
256
+ */
197
257
  export type ReportCategory = 'harassment' | 'hate' | 'cheating' | 'spam' | 'disruption' | 'other';
198
258
  /**
199
259
  * One chat line inside a report's excerpt. It carries no identity of its own: `p` is the writer's index in the
@@ -231,7 +291,14 @@ export interface StoredReport {
231
291
  targetSubject: SubjectId;
232
292
  targetSeat: string;
233
293
  targetHandle: string;
294
+ /** The 0.1.1 category this report is kept under, derived from `reportedReason` (`'other'` when none). Prefer `reportedReason`. */
234
295
  category: ReportCategory;
296
+ /**
297
+ * The reason the reporter gave: an id from the profile's reporting reasons, or null when they gave none. A HINT, never the
298
+ * truth: the case is settled by the moderator's decision. Optional on a row a store is given (missing reads as null); a
299
+ * store returns it on every record.
300
+ */
301
+ reportedReason?: string | null;
235
302
  note: string | null;
236
303
  lineId: string | null;
237
304
  excerpt: ReportExcerptLine[];
@@ -244,7 +311,18 @@ export interface StoredReport {
244
311
  * until then. `badFaith` marks a dismissal as the reporter's bad faith (it counts toward their suspension).
245
312
  * Private: moderator tools only.
246
313
  */
247
- export interface ReportRecord extends Omit<StoredReport, 'status'> {
314
+ export interface ReportRecord extends Omit<StoredReport, 'status' | 'reportedReason'> {
315
+ /**
316
+ * The reason the reporter gave (a reason id), or null. Rows stored before 0.1.2 carry their old category here (`disruption` as
317
+ * `griefing`). Every first-party store returns it; it is optional here so a custom store's 0.1.1-shaped record still type-checks (a
318
+ * missing one reads as the old category, see `StaffReport`, where it is always present).
319
+ */
320
+ reportedReason?: string | null;
321
+ /**
322
+ * When the reporter added their one follow-up (`cw.reports.addDetail`), epoch ms, or null. At most one per report, and only
323
+ * while the report is open.
324
+ */
325
+ detailAt?: number | null;
248
326
  status: 'open' | 'actioned' | 'dismissed';
249
327
  badFaith: boolean;
250
328
  actionedAt: number | null;
@@ -262,8 +340,60 @@ export interface ReportListQuery {
262
340
  /** Epoch ms; only reports created before this (exclusive), or at it with an id below `beforeId`. */
263
341
  before?: number;
264
342
  beforeId?: string;
343
+ /** Only reports whose `reportedReason` is this id; null keeps only those with none. Omit for all. */
344
+ reason?: string | null;
345
+ limit: number;
346
+ }
347
+ /** What {@link Store.listOpenReports} takes: the take-next scan, oldest first. */
348
+ export interface OpenReportQuery {
349
+ /** Only reports of this category. */
350
+ category?: ReportCategory;
351
+ /** Only reports whose `reportedReason` is this id; null keeps only those with none. Omit for all. A store must apply it. */
352
+ reason?: string | null;
353
+ /** Keyset cursor: only reports newer than this (`createdAt` above it, or equal with an id above `afterId`). `afterId` without `after` is ignored. */
354
+ after?: number;
355
+ afterId?: string;
356
+ /** Clamped to 1..200 (a fraction is floored). */
265
357
  limit: number;
266
358
  }
359
+ /** How long a claim lasts after the last claim or heartbeat: 10 minutes. */
360
+ export declare const CLAIM_TTL_MS: number;
361
+ /**
362
+ * A soft claim on a person's case: `by` (a staff actor) is handling it from `since` until `until` (epoch ms). It is live
363
+ * strictly before `until`; an expired claim reads as absent. Staff only: `person` is a subject id.
364
+ */
365
+ export interface ClaimRow {
366
+ person: SubjectId;
367
+ by: string;
368
+ since: number;
369
+ until: number;
370
+ }
371
+ /**
372
+ * How {@link Store.claimCase} treats a claim that someone else holds:
373
+ * - `claim`: wins when the case is free or the caller already holds it (a heartbeat).
374
+ * - `free`: wins only when nobody holds a live claim, the caller included (take next uses it to skip what it holds).
375
+ * - `takeover`: wins always (a senior moving a claim to themselves).
376
+ */
377
+ export type ClaimMode = 'claim' | 'free' | 'takeover';
378
+ /**
379
+ * What {@link Store.claimCase} answers. A win carries the claim now in force and `from`, the other actor whose LIVE claim
380
+ * this one replaced (null for a fresh claim, a heartbeat or an expired claim). A loss carries the live claim that stands.
381
+ */
382
+ export type ClaimAttempt = {
383
+ won: true;
384
+ claim: ClaimRow;
385
+ from: string | null;
386
+ } | {
387
+ won: false;
388
+ claim: ClaimRow;
389
+ };
390
+ /** A saved decision reason: a short label for the picker and the text it fills in. */
391
+ export interface ReasonRow {
392
+ id: string;
393
+ label: string;
394
+ text: string;
395
+ active: boolean;
396
+ }
267
397
  /**
268
398
  * One recorded moderator decision, kept so the same decision sent twice is a replay and not a second action.
269
399
  * `key` is a hash of the report and the decision; `resultJson` is what the first call answered.
@@ -396,6 +526,12 @@ export interface Store {
396
526
  * Each row carries `revokedAt` (null when unrevoked). The history behind the escalation ladder.
397
527
  */
398
528
  loadSubjectActions(since: number): SanctionRow[];
529
+ /**
530
+ * The SUBJECT rows of sanction groups (never an IP row), newest first (`startsAt` descending, then `id` descending, so a
531
+ * tie is stable), revoked and ended ones included. Every row carries `revokedAt`, `revokedBy` and `revokeReason` (all
532
+ * null while unrevoked). See {@link SanctionListQuery}.
533
+ */
534
+ listSubjectSanctions(q: SanctionListQuery): SanctionRow[];
399
535
  /** Every subject row that carries a rule-gap note (any status, revoked or not), newest `startsAt` first. */
400
536
  listGaps(): SanctionRow[];
401
537
  /**
@@ -428,6 +564,16 @@ export interface Store {
428
564
  subject: SubjectId;
429
565
  startsAt: number;
430
566
  }>;
567
+ /**
568
+ * Strikes at or after `since` (epoch ms), newest first (`at` descending, then `id` descending), at most `limit`
569
+ * (clamped to 1..500). The staff "blocked messages" view.
570
+ */
571
+ listStrikes(since: number, limit: number): StrikeRow[];
572
+ /** For each term id, how many strikes at or after `since` it earned (terms with none are absent). Order is unspecified. */
573
+ countStrikesByTerm(since: number): Array<{
574
+ termId: string;
575
+ count: number;
576
+ }>;
431
577
  /**
432
578
  * Insert one report. Returns false, having written nothing, when a report by the same reporter subject
433
579
  * against the same target subject in the same room already exists (the UNIQUE backstop); any other
@@ -438,7 +584,7 @@ export interface Store {
438
584
  loadReport(id: string): ReportRecord | null;
439
585
  /**
440
586
  * Reports newest first (`created_at` descending, then `id` descending, so a tie is stable), whole records. `status`
441
- * filters; `before` keeps only reports older than that instant (exclusive), and with `beforeId` also the ones filed
587
+ * filters; `reason` filters on `reportedReason` (an id, or null for none; a store must apply it, so paging stays right); `before` keeps only reports older than that instant (exclusive), and with `beforeId` also the ones filed
442
588
  * AT that instant whose id sorts below it (keyset paging: pass the last row's `createdAt` and `id`). `beforeId`
443
589
  * without `before` is ignored. `limit` is clamped to 1..200 (a fraction is floored).
444
590
  */
@@ -449,6 +595,46 @@ export interface Store {
449
595
  * clamped to 1..200 (a fraction is floored). An empty list matches nothing.
450
596
  */
451
597
  listReportsByPerson(subjects: readonly SubjectId[], limit: number): ReportRecord[];
598
+ /**
599
+ * Reports that are still `open`, OLDEST first (`createdAt` ascending, then `id` ascending, so a tie is stable), whole
600
+ * records. `category` filters; `after` keeps only reports newer than that instant (exclusive), and with `afterId` also
601
+ * the ones filed AT that instant whose id sorts above it (keyset paging: pass the last row's `createdAt` and `id`).
602
+ * `limit` is clamped to 1..200 (a fraction is floored). The scan behind "take next".
603
+ */
604
+ listOpenReports(q: OpenReportQuery): ReportRecord[];
605
+ /**
606
+ * The OPEN reports filed AGAINST any of the given subjects (`targetSubject` as stored: pass the person's canonical id
607
+ * and every alias merged into it), newest first (`createdAt` descending, then `id` descending), whole records. `limit` is
608
+ * clamped to 1..200 (a fraction is floored). An empty list matches nothing.
609
+ */
610
+ listOpenReportsByPerson(subjects: readonly SubjectId[], limit: number): ReportRecord[];
611
+ /**
612
+ * How the reports FILED BY any of the given subjects stand (`reporterSubject` as stored: pass the person's canonical id
613
+ * and every alias merged into it): how many are still open, actioned or dismissed, and how many carry the bad-faith
614
+ * mark. An empty list counts nothing.
615
+ */
616
+ reporterTally(reporters: readonly SubjectId[]): ReporterTally;
617
+ /**
618
+ * OPTIONAL. The DECIDED reports (`actioned` or `dismissed`) filed by any of the given subjects (`reporterSubject` as stored)
619
+ * that carry a `reportedReason`, each with the sanction groups its decision wrote (the group's subject row: the person and
620
+ * the rule it cited). The reporter-accuracy read behind `reasonMatched` / `reasonDecided`. A store that leaves it out
621
+ * reports 0 and 0. An empty list matches nothing; open reports and reports with no reason are never returned. At most the newest
622
+ * 200 (newest first). A decision row that cannot be read is a decision with no actions, never an error.
623
+ */
624
+ loadReporterDecisions?(reporters: readonly SubjectId[]): ReporterDecision[];
625
+ /**
626
+ * OPTIONAL. Attach the reporter's one follow-up to an `open` report that has none yet: set `reportedReason` and `note` (the
627
+ * FINAL values; the caller has merged them with what the report had) and `detailAt`, atomically. Returns true when this call
628
+ * did it, false (nothing changed) for an unknown report, one that is no longer `open`, or one that already has a follow-up.
629
+ * Never touches the target, the excerpt or the line. A store that leaves it out cannot take a follow-up: `addDetail` answers
630
+ * `off`. `category` is the 0.1.1 category to keep beside the reason.
631
+ */
632
+ addReportDetail?(id: string, detail: {
633
+ reportedReason: string | null;
634
+ category: ReportCategory;
635
+ note: string | null;
636
+ at: number;
637
+ }): boolean;
452
638
  /**
453
639
  * Close a report that is still `open`: set its status, bad-faith mark, `actionedAt`, `actionedBy` and `modNote`,
454
640
  * and the bad-faith `evidence` (null or omitted when there is none). Returns true when this call closed it; false
@@ -479,7 +665,62 @@ export interface Store {
479
665
  subject: SubjectId;
480
666
  groupId: string;
481
667
  }>;
482
- /** Insert one audit entry. A duplicate id throws (nothing is written). Both json columns are written NULL. */
668
+ /**
669
+ * The change token: an opaque string that is different after every change a moderator's queue shows, and the same
670
+ * otherwise. It persists with the store (a restart does not rewind it) and is shared by every process on the same
671
+ * database. An adapter must move it INSIDE the same transaction as the write, so an undone write leaves it as it was,
672
+ * on exactly these events: `insertReport` (true), `closeReport` (true), `insertSanctionGroup` (true),
673
+ * `revokeSanctionGroup` (more than 0), `closeGap` (true), `claimCase` (a win that changes the owner of the case, so a
674
+ * heartbeat does not), `releaseClaim` (true), `insertReason`, and `updateReason` / `setReasonActive` when a value changes.
675
+ * Nothing else moves it, and reading it never does.
676
+ */
677
+ changeToken(): string;
678
+ /**
679
+ * Claim a person's case for `by` at `now`, the claim ending at `until`, as ONE atomic conditional write: of two callers
680
+ * racing for the same free case, exactly one wins, even from two processes on one database. See {@link ClaimMode} and
681
+ * {@link ClaimAttempt}. A claim is live strictly before its `until`; an expired one is replaced as if absent. `since` is
682
+ * kept across a heartbeat and set to `now` otherwise. The token moves when the owner of the case changes.
683
+ */
684
+ claimCase(person: SubjectId, by: string, now: number, until: number, mode: ClaimMode): ClaimAttempt;
685
+ /**
686
+ * Release `by`'s claim on the person. True only when it removed a LIVE claim held by `by`; someone else's claim, no claim
687
+ * and an expired claim (already absent) answer false and the first two are left alone.
688
+ */
689
+ releaseClaim(person: SubjectId, by: string, now: number): boolean;
690
+ /** The claims in force at `now` (not expired) among these people, ordered by person. An empty list matches nobody. */
691
+ loadClaims(persons: readonly SubjectId[], now: number): ClaimRow[];
692
+ /** Every saved reason (active or not), in the order they were added. */
693
+ listReasons(): ReasonRow[];
694
+ /** Add a reason. A duplicate `id` throws and writes nothing. */
695
+ insertReason(row: ReasonRow): void;
696
+ /** Change a reason's label and/or text. False for an unknown id; true otherwise (also when nothing differs). */
697
+ updateReason(id: string, patch: {
698
+ label?: string;
699
+ text?: string;
700
+ }): boolean;
701
+ /** Switch a reason on or off. False for an unknown id; true otherwise (also when it already was so). */
702
+ setReasonActive(id: string, active: boolean): boolean;
703
+ /**
704
+ * The stored policy layer and its version, or null when none was ever saved (version 0). `layer` is whatever was saved,
705
+ * unvalidated: the kit checks it against the profile and ignores one it cannot use. A row that cannot be read at all (its text is
706
+ * not JSON) still answers its version, with a `layer` of null, which the kit reports as unusable. Returns a copy.
707
+ */
708
+ loadPolicyLayer?(): {
709
+ layer: PolicyLayer;
710
+ version: number;
711
+ } | null;
712
+ /**
713
+ * Replace the stored layer with `layer` IF the stored version is still `expectedVersion` (0 when none is stored), as ONE
714
+ * atomic conditional write: of two callers (two processes on one database included) that pass the same version, exactly
715
+ * one wins. Returns the new version (`expectedVersion + 1`), or null on a version conflict, which writes nothing. Runs
716
+ * inside `transaction`, so an undone transaction undoes it. It does not move the change token.
717
+ */
718
+ savePolicyLayer?(layer: PolicyLayer, expectedVersion: number): number | null;
719
+ /**
720
+ * Insert one audit entry. A duplicate id throws (nothing is written). Both json columns are written NULL. A policy row
721
+ * (`policy.update`, `policy.reset`) also carries `detail` (the sections changed and the owner's reason): a store MUST keep it
722
+ * and return it from `listAudit`, or the trail silently loses what changed and why. A row without one has no `detail` key.
723
+ */
483
724
  insertAudit(row: AuditRow): void;
484
725
  /**
485
726
  * Audit entries newest first (`at` descending, then `id` descending, so a tie is stable). `actor` and `action`
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAM3D;;;;;;;;;GASG;AACH,MAAM,WAAW,WAAW;IAC1B,kCAAkC;IAClC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,0DAA0D;IAC1D,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,kCAAkC;IAClC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,MAAM;IACrB,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;OAMG;IACH,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACpB;AAED,kFAAkF;AAClF,MAAM,MAAM,SAAS,GAAG,MAAM,CAAC;AAM/B,4EAA4E;AAC5E,MAAM,WAAW,KAAK;IACpB,wCAAwC;IACxC,GAAG,IAAI,MAAM,CAAC;CACf;AAED,8DAA8D;AAC9D,MAAM,WAAW,MAAM;IACrB,6BAA6B;IAC7B,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,6BAA6B;IAC7B,EAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB;AAMD;;;;;GAKG;AACH,MAAM,WAAW,MAAM;IACrB,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,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MD;;;;GAIG;AACH,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAAC;IAC/B;;;;;OAKG;IACH,MAAM,CAAC,CAAC,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE;QAAE,IAAI,EAAE,gBAAgB,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;CACxG"}
package/dist/src/types.js CHANGED
@@ -2,6 +2,11 @@
2
2
  // their own sections below.
3
3
  /** Every {@link ConductLevel}, ordered from mildest to worst. */
4
4
  export const CONDUCT_LEVELS = Object.freeze(['banter', 'rude', 'hostile', 'severe']);
5
+ // ---------------------------------------------------------------------------
6
+ // Team workbench (storage shapes): soft claims and saved reasons
7
+ // ---------------------------------------------------------------------------
8
+ /** How long a claim lasts after the last claim or heartbeat: 10 minutes. */
9
+ export const CLAIM_TTL_MS = 10 * 60 * 1000;
5
10
  /** How long an incoming-webhook idempotency key is remembered: 24 hours. */
6
11
  export const WEBHOOK_KEY_TTL_MS = 24 * 60 * 60 * 1000;
7
12
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,4BAA4B;AA6L5B,iEAAiE;AACjE,MAAM,CAAC,MAAM,cAAc,GAA4B,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,CAAU,CAAC,CAAC;AAkJvH,4EAA4E;AAC5E,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,4BAA4B;AAqP5B,iEAAiE;AACjE,MAAM,CAAC,MAAM,cAAc,GAA4B,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,CAAU,CAAC,CAAC;AA2KvH,8EAA8E;AAC9E,iEAAiE;AACjE,8EAA8E;AAE9E,4EAA4E;AAC5E,MAAM,CAAC,MAAM,YAAY,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AA+C3C,4EAA4E;AAC5E,MAAM,CAAC,MAAM,kBAAkB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chatwarden/core",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "private": false,
5
5
  "description": "Chat moderation engine for games: reports, warnings, timeouts and bans, a moderator queue and player notices. No sockets, HTTP or disk.",
6
6
  "license": "Apache-2.0",
@@ -43,7 +43,7 @@
43
43
  "prepack": "tsc -b"
44
44
  },
45
45
  "devDependencies": {
46
- "@chatwarden/store-memory": "0.1.1"
46
+ "@chatwarden/store-memory": "0.1.3"
47
47
  },
48
48
  "publishConfig": {
49
49
  "access": "public"
package/src/audit.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  import { randomId } from './crypto.js';
2
+ import { POLICY_SECTIONS } from './profile.js';
3
+ import type { PolicySection } from './profile.js';
2
4
  import { safeWarn } from './log.js';
3
5
  import { b64urlDecode, b64urlEncode } from './staffReports.js';
4
6
  import type { Clock, Logger, Store } from './types.js';
@@ -26,11 +28,34 @@ export const AUDIT_ACTIONS = [
26
28
  'history.view',
27
29
  'suggest',
28
30
  'policy.view',
31
+ 'blocked.view',
32
+ 'case.takeover',
33
+ 'reason.add',
34
+ 'reason.update',
35
+ 'reason.toggle',
36
+ 'policy.update',
37
+ 'policy.reset',
29
38
  ] as const;
30
39
  export type AuditAction = (typeof AUDIT_ACTIONS)[number];
31
40
 
32
- /** What an entry points at: a report id, a sanction group id, a person (a staff ref), a term id or an exception id. */
33
- export const AUDIT_TARGET_TYPES = ['report', 'sanction', 'person', 'term', 'exception'] as const;
41
+ /**
42
+ * What a `policy.update` or `policy.reset` row says it did: the editable sections it changed, and the reason the owner gave.
43
+ * The reason is the one free text an audit row may carry (1 to {@link AUDIT_REASON_MAX} characters, trimmed); the sections are
44
+ * names from a closed list. No layer value is ever recorded.
45
+ */
46
+ export interface AuditDetail {
47
+ sections: PolicySection[];
48
+ reason?: string;
49
+ }
50
+
51
+ /** The longest reason a policy audit row keeps. */
52
+ export const AUDIT_REASON_MAX = 2000;
53
+
54
+ /** The actions whose row carries an {@link AuditDetail}, and the only ones that may. */
55
+ const DETAIL_ACTIONS: readonly string[] = ['policy.update', 'policy.reset'];
56
+
57
+ /** What an entry points at: a report id, a sanction group id, a person (a staff ref), a term id, an exception id or a saved reason id. */
58
+ export const AUDIT_TARGET_TYPES = ['report', 'sanction', 'person', 'term', 'exception', 'reason'] as const;
34
59
  export type AuditTargetType = (typeof AUDIT_TARGET_TYPES)[number];
35
60
 
36
61
  export interface AuditTarget {
@@ -53,9 +78,14 @@ export interface AuditRecordInput {
53
78
  role: Role;
54
79
  action: AuditAction;
55
80
  target?: AuditTarget;
81
+ /** Required for `policy.update` and `policy.reset` (and refused for every other action). */
82
+ detail?: AuditDetail;
56
83
  }
57
84
 
58
- /** One entry as the store keeps and returns it. There is no field for chat text, a reason or a note. */
85
+ /**
86
+ * One entry as the store keeps and returns it. There is no field for chat text or a note. The one free text is the `reason` inside
87
+ * the `detail` of a `policy.update` or `policy.reset` row (the owner's own reason for changing the settings).
88
+ */
59
89
  export interface AuditRow {
60
90
  id: string;
61
91
  /** Epoch ms. */
@@ -65,6 +95,8 @@ export interface AuditRow {
65
95
  role: Role | null;
66
96
  action: AuditAction;
67
97
  target: AuditTarget | null;
98
+ /** Only on a `policy.update` or `policy.reset` row. */
99
+ detail?: AuditDetail;
68
100
  }
69
101
 
70
102
  /** What {@link Store.listAudit} takes. */
@@ -86,6 +118,8 @@ export interface AuditItem {
86
118
  role: Role | null;
87
119
  action: AuditAction;
88
120
  target?: AuditTarget;
121
+ /** Only on a `policy.update` or `policy.reset` row. */
122
+ detail?: AuditDetail;
89
123
  }
90
124
 
91
125
  /** What `cw.audit.list` takes. `limit` is required. */
@@ -146,22 +180,50 @@ export function decodeAuditCursor(cursor: unknown): { at: number; id: string } {
146
180
  return { at, id: text.slice(sep + 1) };
147
181
  }
148
182
 
183
+ /** The detail of a policy row, or null when it is not valid: sections from the closed list, an optional reason, nothing else. */
184
+ function parseDetail(detail: unknown): AuditDetail | null {
185
+ if (typeof detail !== 'object' || detail === null || Array.isArray(detail)) return null;
186
+ const d = detail as Record<string, unknown>;
187
+ for (const k of Object.keys(d)) if (k !== 'sections' && k !== 'reason') return null;
188
+ const sections = d.sections;
189
+ if (!Array.isArray(sections)) return null;
190
+ const known: readonly string[] = POLICY_SECTIONS;
191
+ if (!sections.every((x) => typeof x === 'string' && known.includes(x))) return null;
192
+ const unique = [...new Set(sections as PolicySection[])];
193
+ if (d.reason === undefined) return { sections: unique };
194
+ if (typeof d.reason !== 'string') return null;
195
+ const reason = d.reason.trim();
196
+ if (reason === '' || reason.length > AUDIT_REASON_MAX) return null;
197
+ return { sections: unique, reason };
198
+ }
199
+
149
200
  /** Parse the input of `record`; null when anything is off. Copies only the known fields. */
150
201
  function parse(input: unknown): AuditRecordInput | null {
151
202
  if (typeof input !== 'object' || input === null) return null;
152
- const { actor, role, action, target } = input as Record<string, unknown>;
203
+ const { actor, role, action, target, detail } = input as Record<string, unknown>;
153
204
  if (typeof actor !== 'string' || !ACTOR_RE.test(actor)) return null;
154
205
  if (!isRole(role) || !isAction(action)) return null;
155
- if (target === undefined) return { actor, role, action };
206
+ // A policy row must say what it changed; no other row may carry anything but ids.
207
+ let parsedDetail: AuditDetail | undefined;
208
+ if (DETAIL_ACTIONS.includes(action)) {
209
+ const d = parseDetail(detail);
210
+ if (d === null) return null;
211
+ parsedDetail = d;
212
+ } else if (detail !== undefined) {
213
+ return null;
214
+ }
215
+ const extra = parsedDetail === undefined ? {} : { detail: parsedDetail };
216
+ if (target === undefined) return { actor, role, action, ...extra };
156
217
  if (typeof target !== 'object' || target === null) return null;
157
218
  const { type, ref } = target as Record<string, unknown>;
158
219
  if (!isTargetType(type) || typeof ref !== 'string' || !REF_RE.test(ref)) return null;
159
- return { actor, role, action, target: { type, ref } };
220
+ return { actor, role, action, target: { type, ref }, ...extra };
160
221
  }
161
222
 
162
223
  /**
163
224
  * The staff audit trail: who (actor and role) did what (a name from {@link AUDIT_ACTIONS}) to which id, and when.
164
- * It stores no chat text, reason, note or evidence: there is no field for any, and a target must look like an id.
225
+ * It stores no chat text, note or evidence: there is no field for any, and a target must look like an id. The one free text it
226
+ * keeps is the owner's `reason` in the `detail` of a `policy.update` or `policy.reset` row, next to the section names.
165
227
  */
166
228
  export class AuditService {
167
229
  private readonly store: Store;
@@ -192,6 +254,7 @@ export class AuditService {
192
254
  role: parsed.role,
193
255
  action: parsed.action,
194
256
  target: parsed.target ?? null,
257
+ ...(parsed.detail === undefined ? {} : { detail: parsed.detail }),
195
258
  });
196
259
  return true;
197
260
  } catch (err) {
@@ -232,6 +295,7 @@ export class AuditService {
232
295
  role: r.role,
233
296
  action: r.action,
234
297
  ...(r.target === null ? {} : { target: { type: r.target.type, ref: r.target.ref } }),
298
+ ...(r.detail === undefined ? {} : { detail: { sections: [...r.detail.sections], ...(r.detail.reason === undefined ? {} : { reason: r.detail.reason }) } }),
235
299
  }),
236
300
  ),
237
301
  next: rows.length === limit && last !== undefined ? encodeAuditCursor(last.at, last.id) : null,