@chatwarden/core 0.1.6 → 0.1.7

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 (131) hide show
  1. package/README.md +50 -0
  2. package/dist/src/ai/agreement.d.ts +46 -0
  3. package/dist/src/ai/agreement.d.ts.map +1 -0
  4. package/dist/src/ai/agreement.js +71 -0
  5. package/dist/src/ai/agreement.js.map +1 -0
  6. package/dist/src/ai/breaker.d.ts +31 -0
  7. package/dist/src/ai/breaker.d.ts.map +1 -0
  8. package/dist/src/ai/breaker.js +62 -0
  9. package/dist/src/ai/breaker.js.map +1 -0
  10. package/dist/src/ai/budget.d.ts +26 -0
  11. package/dist/src/ai/budget.d.ts.map +1 -0
  12. package/dist/src/ai/budget.js +57 -0
  13. package/dist/src/ai/budget.js.map +1 -0
  14. package/dist/src/ai/case.d.ts +37 -0
  15. package/dist/src/ai/case.d.ts.map +1 -0
  16. package/dist/src/ai/case.js +30 -0
  17. package/dist/src/ai/case.js.map +1 -0
  18. package/dist/src/ai/casebook.d.ts +59 -0
  19. package/dist/src/ai/casebook.d.ts.map +1 -0
  20. package/dist/src/ai/casebook.js +47 -0
  21. package/dist/src/ai/casebook.js.map +1 -0
  22. package/dist/src/ai/ceilings.d.ts +42 -0
  23. package/dist/src/ai/ceilings.d.ts.map +1 -0
  24. package/dist/src/ai/ceilings.js +59 -0
  25. package/dist/src/ai/ceilings.js.map +1 -0
  26. package/dist/src/ai/fake.d.ts +41 -0
  27. package/dist/src/ai/fake.d.ts.map +1 -0
  28. package/dist/src/ai/fake.js +75 -0
  29. package/dist/src/ai/fake.js.map +1 -0
  30. package/dist/src/ai/hash.d.ts +13 -0
  31. package/dist/src/ai/hash.d.ts.map +1 -0
  32. package/dist/src/ai/hash.js +19 -0
  33. package/dist/src/ai/hash.js.map +1 -0
  34. package/dist/src/ai/inert.d.ts +5 -0
  35. package/dist/src/ai/inert.d.ts.map +1 -0
  36. package/dist/src/ai/inert.js +22 -0
  37. package/dist/src/ai/inert.js.map +1 -0
  38. package/dist/src/ai/injection.d.ts +8 -0
  39. package/dist/src/ai/injection.d.ts.map +1 -0
  40. package/dist/src/ai/injection.js +30 -0
  41. package/dist/src/ai/injection.js.map +1 -0
  42. package/dist/src/ai/lines.d.ts +64 -0
  43. package/dist/src/ai/lines.d.ts.map +1 -0
  44. package/dist/src/ai/lines.js +172 -0
  45. package/dist/src/ai/lines.js.map +1 -0
  46. package/dist/src/ai/prompt.d.ts +44 -0
  47. package/dist/src/ai/prompt.d.ts.map +1 -0
  48. package/dist/src/ai/prompt.js +185 -0
  49. package/dist/src/ai/prompt.js.map +1 -0
  50. package/dist/src/ai/redact.d.ts +29 -0
  51. package/dist/src/ai/redact.d.ts.map +1 -0
  52. package/dist/src/ai/redact.js +160 -0
  53. package/dist/src/ai/redact.js.map +1 -0
  54. package/dist/src/ai/schema.d.ts +6 -0
  55. package/dist/src/ai/schema.d.ts.map +1 -0
  56. package/dist/src/ai/schema.js +50 -0
  57. package/dist/src/ai/schema.js.map +1 -0
  58. package/dist/src/ai/service.d.ts +328 -0
  59. package/dist/src/ai/service.d.ts.map +1 -0
  60. package/dist/src/ai/service.js +749 -0
  61. package/dist/src/ai/service.js.map +1 -0
  62. package/dist/src/ai/types.d.ts +180 -0
  63. package/dist/src/ai/types.d.ts.map +1 -0
  64. package/dist/src/ai/types.js +23 -0
  65. package/dist/src/ai/types.js.map +1 -0
  66. package/dist/src/ai/validate.d.ts +30 -0
  67. package/dist/src/ai/validate.d.ts.map +1 -0
  68. package/dist/src/ai/validate.js +160 -0
  69. package/dist/src/ai/validate.js.map +1 -0
  70. package/dist/src/ai/worker.d.ts +74 -0
  71. package/dist/src/ai/worker.d.ts.map +1 -0
  72. package/dist/src/ai/worker.js +286 -0
  73. package/dist/src/ai/worker.js.map +1 -0
  74. package/dist/src/audit.d.ts +12 -3
  75. package/dist/src/audit.d.ts.map +1 -1
  76. package/dist/src/audit.js +30 -4
  77. package/dist/src/audit.js.map +1 -1
  78. package/dist/src/chatwarden.d.ts +16 -0
  79. package/dist/src/chatwarden.d.ts.map +1 -1
  80. package/dist/src/chatwarden.js +49 -1
  81. package/dist/src/chatwarden.js.map +1 -1
  82. package/dist/src/decide.d.ts +36 -1
  83. package/dist/src/decide.d.ts.map +1 -1
  84. package/dist/src/decide.js +62 -2
  85. package/dist/src/decide.js.map +1 -1
  86. package/dist/src/documents.d.ts +1 -1
  87. package/dist/src/documents.d.ts.map +1 -1
  88. package/dist/src/documents.js +4 -1
  89. package/dist/src/documents.js.map +1 -1
  90. package/dist/src/index.d.ts +27 -5
  91. package/dist/src/index.d.ts.map +1 -1
  92. package/dist/src/index.js +17 -2
  93. package/dist/src/index.js.map +1 -1
  94. package/dist/src/profile.d.ts +30 -1
  95. package/dist/src/profile.d.ts.map +1 -1
  96. package/dist/src/profile.js +43 -4
  97. package/dist/src/profile.js.map +1 -1
  98. package/dist/src/retention.d.ts +19 -0
  99. package/dist/src/retention.d.ts.map +1 -1
  100. package/dist/src/retention.js +33 -10
  101. package/dist/src/retention.js.map +1 -1
  102. package/dist/src/types.d.ts +269 -2
  103. package/dist/src/types.d.ts.map +1 -1
  104. package/dist/src/types.js.map +1 -1
  105. package/package.json +2 -2
  106. package/src/ai/agreement.ts +106 -0
  107. package/src/ai/breaker.ts +73 -0
  108. package/src/ai/budget.ts +65 -0
  109. package/src/ai/case.ts +74 -0
  110. package/src/ai/casebook.ts +75 -0
  111. package/src/ai/ceilings.ts +68 -0
  112. package/src/ai/fake.ts +105 -0
  113. package/src/ai/hash.ts +20 -0
  114. package/src/ai/inert.ts +26 -0
  115. package/src/ai/injection.ts +32 -0
  116. package/src/ai/lines.ts +216 -0
  117. package/src/ai/prompt.ts +208 -0
  118. package/src/ai/redact.ts +174 -0
  119. package/src/ai/schema.ts +51 -0
  120. package/src/ai/service.ts +955 -0
  121. package/src/ai/types.ts +165 -0
  122. package/src/ai/validate.ts +173 -0
  123. package/src/ai/worker.ts +364 -0
  124. package/src/audit.ts +31 -5
  125. package/src/chatwarden.ts +64 -1
  126. package/src/decide.ts +97 -4
  127. package/src/documents.ts +5 -2
  128. package/src/index.ts +52 -1
  129. package/src/profile.ts +68 -4
  130. package/src/retention.ts +47 -10
  131. package/src/types.ts +294 -2
@@ -0,0 +1,328 @@
1
+ import type { AuditRecordInput } from '../audit.js';
2
+ import type { Subscribe } from '../events.js';
3
+ import type { Suggestion } from '../ladder.js';
4
+ import type { ResolvedProfile } from '../profile.js';
5
+ import type { CommunityRules, RuleRef } from '../rules.js';
6
+ import type { AiOutcomeInsert, Clock, ConductLevel, Logger, ReportRecord, SanctionKind, Store, SubjectId } from '../types.js';
7
+ import { Breaker } from './breaker.js';
8
+ import { CallWindow } from './budget.js';
9
+ import type { Prepared } from './case.js';
10
+ import type { AiOutcomeArgs } from './casebook.js';
11
+ import type { AIExampleInput, AIRead, ModerationAI } from './types.js';
12
+ import { Meter } from './worker.js';
13
+ import type { AiStore } from './worker.js';
14
+ /**
15
+ * What the code decides about the AI. The adapter and the ceilings on level and spend are code, never the hub's.
16
+ * @experimental
17
+ */
18
+ export interface AiOptions {
19
+ /** The model behind the reads. Runs on the server only. */
20
+ adapter: ModerationAI;
21
+ /** The highest level the hub may switch to. Default 2. */
22
+ maxLevel?: 1 | 2;
23
+ /** The most the AI may spend in a UTC day, in micro-dollars (1 = $0.000001). Default 1 000 000 ($1.00). Set in code: a hub cannot raise it. */
24
+ dailyBudgetMicros?: number;
25
+ /** The most calls in any minute. Default 30. */
26
+ perMinuteCalls?: number;
27
+ /** The most reads in flight at once. Default 2. */
28
+ concurrency?: number;
29
+ /** The hard deadline for one call, in milliseconds. Default 30 000. */
30
+ timeoutMs?: number;
31
+ /**
32
+ * `'raw'` (default) sends a line the filter touched (blocked, or starred in the room) as typed: the model needs the words to judge
33
+ * intent. `'mask'` sends it masked instead (a starred line as the room saw it, a blocked line as stars). Read the adapter's README
34
+ * before leaving the default: the provider receives abusive text.
35
+ */
36
+ blockedLines?: 'raw' | 'mask';
37
+ /** Reserved. No room tag, and no tag value, is ever sent to a provider in this release. */
38
+ contextTags?: string[];
39
+ }
40
+ /** Where the AI stands, for Settings. */
41
+ export interface AiStatus {
42
+ /** An adapter is configured. */
43
+ available: boolean;
44
+ /** The effective level: the lower of the hub's setting and `maxLevel`; 0 without an adapter. */
45
+ level: 0 | 1 | 2;
46
+ maxLevel: 0 | 1 | 2;
47
+ state: 'ok' | 'paused_budget' | 'unavailable' | 'off';
48
+ /** Today's spend (UTC), in micro-dollars, from the store. */
49
+ spentMicros: number;
50
+ capMicros: number;
51
+ /** The owner's ceiling on calls in a UTC day (`profile.ai.dailyCalls`); `reads` is counted against it. */
52
+ capCalls: number;
53
+ /** The UTC day the spend is for, `YYYY-MM-DD`. */
54
+ day: string;
55
+ /** Calls made today (UTC), from the store. */
56
+ reads: number;
57
+ /** The share of input tokens the provider served from its cache, over the calls this process made; null before any. */
58
+ cacheHitRate: number | null;
59
+ /** Answers core refused, by validator code, since this process started. Codes only, never text. */
60
+ invalid: Record<string, number>;
61
+ }
62
+ /** What the queue carries for a report: no summary, no line ids. */
63
+ export interface AiBrief {
64
+ severity: ConductLevel;
65
+ confidence: AIRead['confidence'];
66
+ rule: number | 'uncovered' | null;
67
+ /** The read was made from older rules or an older version of the case. */
68
+ stale: boolean;
69
+ injectionSuspected: boolean;
70
+ /** Level 2 and a recommendation that is not `unclear`. */
71
+ hasRecommendation: boolean;
72
+ }
73
+ /** The step the ladder gives for the AI's conduct level: what a one-click accept may fill. */
74
+ export interface SuggestionStep {
75
+ kind: SanctionKind;
76
+ durationMs: number | null;
77
+ label: string;
78
+ }
79
+ /** A stored read as the case page shows it. */
80
+ export interface AiReadView {
81
+ /** The read's id: what a decision echoes back. */
82
+ id: string;
83
+ severity: ConductLevel;
84
+ rule: number | 'uncovered' | null;
85
+ summary: string;
86
+ /** Real line ids, at most 5. */
87
+ evidenceLineIds: string[];
88
+ confidence: AIRead['confidence'];
89
+ /** From older rules, or from an older version of the case. */
90
+ stale: boolean;
91
+ injectionSuspected: boolean;
92
+ model: string | null;
93
+ /** When the read was started, epoch ms. */
94
+ at: number;
95
+ /** Level 2 only. */
96
+ recommendation: null | {
97
+ verdict: 'upheld' | 'noted' | 'no_action' | 'unclear';
98
+ severity: ConductLevel;
99
+ rule: number | 'uncovered' | null;
100
+ evidenceLineIds: string[];
101
+ /** `cw.suggest` for the AI's conduct level, now; null when it names no action. */
102
+ step: SuggestionStep | null;
103
+ /** `step` is within the ceilings (a warning, a note or a restriction of at most 24 hours, with a line by the reported person cited). */
104
+ stepWithinCeiling: boolean;
105
+ };
106
+ }
107
+ /** The casebook counts for one rule. */
108
+ export interface AiStatsRuleView {
109
+ rule: number | 'uncovered' | null;
110
+ decided: number;
111
+ agree: number;
112
+ override: number;
113
+ none: number;
114
+ falsePositives: number;
115
+ /** Decisions that were a one-click accept of the AI's pre-fill. */
116
+ oneClick: number;
117
+ }
118
+ /** The casebook, overall and per rule. */
119
+ export interface AiStatsView {
120
+ since: number;
121
+ decided: number;
122
+ agree: number;
123
+ override: number;
124
+ none: number;
125
+ falsePositives: number;
126
+ oneClick: number;
127
+ /** agree / (agree + override); null with neither. */
128
+ agreementRate: number | null;
129
+ /** falsePositives / (agree + override); null with neither. */
130
+ falsePositiveRate: number | null;
131
+ /** oneClick / (agree + override): how often a shown recommendation was accepted as it stood; null with none shown. */
132
+ oneClickRate: number | null;
133
+ rules: AiStatsRuleView[];
134
+ }
135
+ /** What `cw.ai.readAgain` answers. */
136
+ export type AiReadAgain = AiReadView | 'pending' | 'budget' | 'off' | 'rate'
137
+ /** The read for this input ended without an answer and a moderator already retook it once: there is nothing more to ask. */
138
+ | 'final'
139
+ /** The breaker is open or the call window is full: nothing can be called for `retryAfterMs`. */
140
+ | {
141
+ unavailable: {
142
+ retryAfterMs: number;
143
+ };
144
+ };
145
+ /**
146
+ * `cw.ai`. Every method is safe to call at any time: with the AI off, without an adapter or with a failing provider or store it
147
+ * answers as if there were no AI (null, an empty map, `'off'`), and never throws.
148
+ * @experimental
149
+ */
150
+ export interface AiFacade {
151
+ /** The effective level now. */
152
+ level(): 0 | 1 | 2;
153
+ status(): AiStatus;
154
+ /**
155
+ * The newest finished read of a report as the case page shows it, or null. At level 0 nothing is read from the store. With
156
+ * `open: true` (the case page) a report with no read, or a stale one, is queued for a (re)read.
157
+ */
158
+ read(reportId: string, opts?: {
159
+ open?: boolean;
160
+ }): AiReadView | null;
161
+ /**
162
+ * Whether a read of this report is on its way now, so the case page may wait for one: the effective level is 1 or 2, an adapter is
163
+ * configured, the breaker is closed, neither daily cap (money, calls) is reached, the report is open and its read has not ended
164
+ * without an answer. False otherwise, and on any failure; the page then renders exactly as with the AI off.
165
+ */
166
+ expected(reportId: string): boolean;
167
+ /**
168
+ * "Read again": the stored read when the input has not changed (no call), else a call is queued and the answer is `'pending'`.
169
+ * `'off'` at level 0 or for a report that is gone or decided, `'budget'` at the daily money or call cap, `'rate'` once `actor` has
170
+ * asked 10 times in a minute (counted in this process; every answer below uses an ask), `{ unavailable }` while the breaker is open or
171
+ * the call window is full, and `'final'` when the read for this input ended without an answer (declined, invalid twice, fatal, given
172
+ * up) and an explicit ask has already retaken it once. The first explicit ask on such a row retakes it (`'pending'`): it is charged
173
+ * to the spend and audited like any other read.
174
+ */
175
+ readAgain(reportId: string, actor: string): Promise<AiReadAgain>;
176
+ /** The queue's brief of each report that has a read. Reports without one are absent. */
177
+ briefs(reportIds: readonly string[]): Map<string, AiBrief>;
178
+ /** The casebook counts for decisions at or after `since` (default: the last 30 days). */
179
+ stats(q?: {
180
+ since?: number;
181
+ }): AiStatsView;
182
+ /**
183
+ * The one function the appeals inbox calls when a decision is reversed (a granted appeal, a take-back): the report's casebook row can
184
+ * never teach again, loses its example text, and counts as an AI false positive when the AI had recommended action. True when the
185
+ * report has a row.
186
+ */
187
+ markReversed(reportId: string): boolean;
188
+ /** A senior's "don't teach" mark on a decided case: the row can never teach again and loses its example text. True when the report has a row. */
189
+ dontTeach(reportId: string): boolean;
190
+ /** Resolves when no read is queued or running (tests, graceful shutdown). */
191
+ idle(): Promise<void>;
192
+ /** Run the sweeper once. The timer does this every 60 seconds. */
193
+ sweep(): Promise<void>;
194
+ /** Stop the sweeper and abort the calls in flight. `cw.close()` does this. */
195
+ close(): void;
196
+ }
197
+ /** How often the sweeper runs. */
198
+ export declare const SWEEP_EVERY_MS = 60000;
199
+ /** The most reports one sweep queues. */
200
+ export declare const SWEEP_BATCH = 20;
201
+ /** The most stale reads one idle sweep queues. */
202
+ export declare const STALE_PER_SWEEP = 5;
203
+ /** How many times one moderator may ask for a read again in a minute. */
204
+ export declare const READ_AGAIN_PER_MINUTE = 10;
205
+ /** The most reports the sweeper remembers as not to be queued (and the most final reads it remembers). */
206
+ export declare const PARKED_MAX = 2000;
207
+ /** The audit actor for the AI: `ai:` and the adapter's id with every character the trail refuses made an underscore, cut to fit. */
208
+ export declare function aiActorOf(adapterId: string): string;
209
+ /** The store, typed with its AI methods; throws a plain error when it has not got them. */
210
+ export declare function requireAiStore(store: Store): AiStore;
211
+ /**
212
+ * Check the AI option before anything is started (throws a plain error for a bad one) and name the AI methods the store lacks. A store that
213
+ * lacks some leaves the AI inert: `createChatwarden` says so once and carries on, as it does for any optional Store method.
214
+ */
215
+ export declare function checkAiSetup(store: Store, options: AiOptions): string[];
216
+ declare function checkOptions(o: AiOptions): Required<Omit<AiOptions, 'adapter' | 'contextTags'>> & {
217
+ contextTags: string[];
218
+ };
219
+ /** What the service needs from the kit around it. */
220
+ export interface AiServiceDeps {
221
+ options: AiOptions;
222
+ store: Store;
223
+ clock: Clock;
224
+ logger: Logger | undefined;
225
+ /** The profile in force now (never kept across calls). */
226
+ profile: () => ResolvedProfile;
227
+ rules: CommunityRules;
228
+ /** `cw.suggest`. */
229
+ suggest: (subject: SubjectId, level: ConductLevel | null, rule: RuleRef, ctx: {
230
+ roomId: string | null;
231
+ }) => Suggestion;
232
+ subscribe: Subscribe;
233
+ /** `cw.audit.record`. */
234
+ audit: (input: AuditRecordInput) => boolean;
235
+ /** How long the text of a casebook example is kept (`retention.aiExamplesMs`); 0 keeps none. */
236
+ exampleRetentionMs: () => number;
237
+ }
238
+ export declare class AiService implements AiFacade {
239
+ protected readonly store: AiStore;
240
+ protected readonly clock: Clock;
241
+ protected readonly adapter: ModerationAI;
242
+ protected readonly actor: string;
243
+ protected readonly opts: ReturnType<typeof checkOptions>;
244
+ protected readonly meter: Meter;
245
+ protected readonly breaker: Breaker;
246
+ protected readonly window: CallWindow;
247
+ private readonly queue;
248
+ private readonly queued;
249
+ private readonly running;
250
+ private readonly parked;
251
+ private readonly retakes;
252
+ private readonly controllers;
253
+ private readonly cache;
254
+ private readonly asked;
255
+ private pumpTimer;
256
+ private sweepTimer;
257
+ private unsubscribe;
258
+ private waiters;
259
+ private policyText;
260
+ private lastStable;
261
+ private stableKey;
262
+ private isClosed;
263
+ protected readonly deps: AiServiceDeps;
264
+ constructor(deps: AiServiceDeps);
265
+ level(): 0 | 1 | 2;
266
+ status(): AiStatus;
267
+ read(reportId: string, o?: {
268
+ open?: boolean;
269
+ }): AiReadView | null;
270
+ expected(reportId: string): boolean;
271
+ readAgain(reportId: string, actor: string): Promise<AiReadAgain>;
272
+ /** A sliding minute per actor. Held in memory: it guards the provider's bill from one eager hand, not a security boundary. */
273
+ private allowAsk;
274
+ briefs(reportIds: readonly string[]): Map<string, AiBrief>;
275
+ stats(q?: {
276
+ since?: number;
277
+ }): AiStatsView;
278
+ markReversed(reportId: string): boolean;
279
+ dontTeach(reportId: string): boolean;
280
+ private mark;
281
+ idle(): Promise<void>;
282
+ close(): void;
283
+ /**
284
+ * Put a report on the queue. Synchronous and cheap: no store read, no await. Does nothing at level 0. `force` is for a case that
285
+ * changed or was asked for (it forgets any wait the sweeper was keeping).
286
+ */
287
+ enqueue(reportId: string, o?: {
288
+ force?: boolean;
289
+ }): boolean;
290
+ /** The reporter's follow-up changed the case: read it again once. Called by the facade's `reports.addDetail`. */
291
+ caseChanged(reportId: string): void;
292
+ private schedulePump;
293
+ private pump;
294
+ private runOne;
295
+ /** Remember not to queue `reportId` before `until`. Bounded: the oldest entry goes when the list is full. */
296
+ private park;
297
+ /** How many reports the sweeper is holding back (tests). */
298
+ parkedSize(): number;
299
+ private isIdle;
300
+ private settleIdle;
301
+ sweep(): Promise<void>;
302
+ private isParked;
303
+ /** A report made ready for a read, cached by what it is made from. */
304
+ protected prepare(report: ReportRecord): Prepared;
305
+ private view;
306
+ /** The step the ladder gives for the recommendation, and whether it is within the ceilings. */
307
+ private stepFor;
308
+ private env;
309
+ /**
310
+ * Casebook examples for a read: none unless learning is on, example text is kept at all, the case names a reason that maps to a rule,
311
+ * and at least 30 teachable decisions exist. Then the two newest of that rule at the conduct level the AI gave this report before
312
+ * (or, for a first read, at any level), newest first. Each is pseudonymised already; the row's report id is its id.
313
+ */
314
+ protected examplesFor(report: ReportRecord, prepared: Prepared): AIExampleInput[];
315
+ /**
316
+ * The casebook row for a decision (the hook `DecisionService` calls inside its transaction), computed here from the stored read and
317
+ * the decision. The server always records it when a read exists at level 1 or 2, whichever way the decision came (the hub, `cw.decide`,
318
+ * a webhook, a bulk dismissal); the echo, when there is one, only names the read the moderator saw, says whether they clicked accept
319
+ * (kept only when the decision is the pre-fill) and gives the conduct level of their form (kept only when it fits the verdict).
320
+ * With no echo there is no example text. Null at level 0 and when the report has no read. Fenced by the caller.
321
+ */
322
+ outcomeOf(args: AiOutcomeArgs): AiOutcomeInsert | null;
323
+ /** The owner's most calls in a UTC day, read live from the profile. */
324
+ private dailyCalls;
325
+ protected warn(event: string, err: unknown): void;
326
+ }
327
+ export {};
328
+ //# sourceMappingURL=service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../src/ai/service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO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