airbyte-faros-destination 0.23.34 → 0.23.35
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.
|
@@ -2,6 +2,23 @@ import { AirbyteRecord } from 'faros-airbyte-cdk';
|
|
|
2
2
|
import { AssistantMetric, OrgKey } from '../common/vcs';
|
|
3
3
|
import { DestinationModel, DestinationRecord, StreamContext } from '../converter';
|
|
4
4
|
import { CodexConverter } from './common';
|
|
5
|
+
interface TextTokenUsage {
|
|
6
|
+
uncached_text_input_tokens?: number | null;
|
|
7
|
+
cached_text_input_tokens?: number | null;
|
|
8
|
+
text_output_tokens?: number | null;
|
|
9
|
+
text_total_tokens?: number | null;
|
|
10
|
+
}
|
|
11
|
+
interface BilledUsage extends TextTokenUsage {
|
|
12
|
+
credits: number | null;
|
|
13
|
+
cost_usd?: number | null;
|
|
14
|
+
estimated_cost_usd?: number | null;
|
|
15
|
+
}
|
|
16
|
+
interface ActivityUsage extends BilledUsage {
|
|
17
|
+
chats?: number;
|
|
18
|
+
messages?: number;
|
|
19
|
+
threads?: number;
|
|
20
|
+
turns?: number;
|
|
21
|
+
}
|
|
5
22
|
export interface CodexUsageItem {
|
|
6
23
|
object: string;
|
|
7
24
|
start_time: number;
|
|
@@ -13,34 +30,13 @@ export interface CodexUsageItem {
|
|
|
13
30
|
user_id: string;
|
|
14
31
|
email: string | null;
|
|
15
32
|
} | null;
|
|
16
|
-
totals:
|
|
17
|
-
|
|
18
|
-
turns: number;
|
|
19
|
-
credits: number;
|
|
20
|
-
uncached_text_input_tokens?: number | null;
|
|
21
|
-
cached_text_input_tokens?: number | null;
|
|
22
|
-
text_output_tokens?: number | null;
|
|
23
|
-
text_total_tokens?: number | null;
|
|
24
|
-
};
|
|
25
|
-
clients: Array<{
|
|
33
|
+
totals: ActivityUsage;
|
|
34
|
+
clients: Array<ActivityUsage & {
|
|
26
35
|
client_id: string;
|
|
27
|
-
threads: number;
|
|
28
|
-
turns: number;
|
|
29
|
-
credits: number;
|
|
30
|
-
uncached_text_input_tokens?: number | null;
|
|
31
|
-
cached_text_input_tokens?: number | null;
|
|
32
|
-
text_output_tokens?: number | null;
|
|
33
|
-
text_total_tokens?: number | null;
|
|
34
36
|
}>;
|
|
35
|
-
models?: Array<{
|
|
37
|
+
models?: Array<BilledUsage & {
|
|
36
38
|
model: string;
|
|
37
39
|
speed?: string | null;
|
|
38
|
-
credits: number;
|
|
39
|
-
estimated_cost_usd?: number | null;
|
|
40
|
-
uncached_text_input_tokens?: number | null;
|
|
41
|
-
cached_text_input_tokens?: number | null;
|
|
42
|
-
text_output_tokens?: number | null;
|
|
43
|
-
text_total_tokens?: number | null;
|
|
44
40
|
}> | null;
|
|
45
41
|
code_attribution?: {
|
|
46
42
|
lines_of_code?: {
|
|
@@ -70,6 +66,7 @@ export interface CodexAssistantMetricConfig {
|
|
|
70
66
|
model?: string;
|
|
71
67
|
speed?: string;
|
|
72
68
|
}
|
|
69
|
+
export declare function isCodexClient(clientId: string): boolean;
|
|
73
70
|
export declare class Usage extends CodexConverter {
|
|
74
71
|
private readonly seenUsers;
|
|
75
72
|
readonly destinationModels: ReadonlyArray<DestinationModel>;
|
|
@@ -77,3 +74,4 @@ export declare class Usage extends CodexConverter {
|
|
|
77
74
|
convert(record: AirbyteRecord, ctx: StreamContext): Promise<ReadonlyArray<DestinationRecord>>;
|
|
78
75
|
onProcessingComplete(): Promise<ReadonlyArray<DestinationRecord>>;
|
|
79
76
|
}
|
|
77
|
+
export {};
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Usage = void 0;
|
|
4
|
+
exports.isCodexClient = isCodexClient;
|
|
4
5
|
const common_1 = require("faros-airbyte-common/common");
|
|
5
6
|
const lodash_1 = require("lodash");
|
|
6
7
|
const vcs_1 = require("../common/vcs");
|
|
7
8
|
const common_2 = require("./common");
|
|
9
|
+
// The unified usage API also reports ChatGPT and Work clients. Work clients
|
|
10
|
+
// carry a CODEX_ prefix but are not Codex usage.
|
|
11
|
+
function isCodexClient(clientId) {
|
|
12
|
+
return clientId.startsWith('CODEX_') && !clientId.startsWith('CODEX_WORK_');
|
|
13
|
+
}
|
|
14
|
+
function isBilled(usage) {
|
|
15
|
+
return Boolean(usage.credits || usage.cost_usd || usage.estimated_cost_usd);
|
|
16
|
+
}
|
|
8
17
|
class Usage extends common_2.CodexConverter {
|
|
9
18
|
constructor() {
|
|
10
19
|
super(...arguments);
|
|
@@ -70,20 +79,117 @@ class Usage extends common_2.CodexConverter {
|
|
|
70
79
|
}
|
|
71
80
|
async convert(record, ctx) {
|
|
72
81
|
const usageItem = record.record.data;
|
|
73
|
-
//
|
|
82
|
+
// vcs_User is keyed by email, so rows without one cannot be attributed
|
|
74
83
|
const userEmail = usageItem.actor?.email ?? usageItem.user_email;
|
|
75
84
|
if (!userEmail) {
|
|
76
85
|
return [];
|
|
77
86
|
}
|
|
78
|
-
// Convert Unix timestamps to dates
|
|
79
87
|
const startedAt = new Date(usageItem.start_time * 1000);
|
|
80
88
|
const endedAt = new Date(usageItem.end_time * 1000);
|
|
81
89
|
const organization = {
|
|
82
90
|
uid: this.streamName.source,
|
|
83
91
|
source: this.streamName.source,
|
|
84
92
|
};
|
|
93
|
+
const metrics = [];
|
|
94
|
+
let hasActivity = false;
|
|
95
|
+
const emit = (assistantMetricType, value, dims, assistantMetricTypeDetail) => {
|
|
96
|
+
if (value > 0) {
|
|
97
|
+
hasActivity = true;
|
|
98
|
+
}
|
|
99
|
+
metrics.push(...this.getAssistantMetric({
|
|
100
|
+
startedAt,
|
|
101
|
+
endedAt,
|
|
102
|
+
assistantMetricType,
|
|
103
|
+
assistantMetricTypeDetail,
|
|
104
|
+
value,
|
|
105
|
+
organization,
|
|
106
|
+
userEmail,
|
|
107
|
+
...dims,
|
|
108
|
+
}));
|
|
109
|
+
};
|
|
110
|
+
// Null means not reported and is skipped; a reported zero is kept
|
|
111
|
+
const emitBilling = (usage, dims) => {
|
|
112
|
+
if (!(0, lodash_1.isNil)(usage.credits)) {
|
|
113
|
+
emit(vcs_1.AssistantMetric.Cost, usage.credits, dims);
|
|
114
|
+
}
|
|
115
|
+
// Cost/USD is estimated_cost_usd: credits priced at the workspace's
|
|
116
|
+
// overage rate, not billed spend. API rounds it to the cent; store
|
|
117
|
+
// integer cents, matching the Claude path.
|
|
118
|
+
if (!(0, lodash_1.isNil)(usage.estimated_cost_usd)) {
|
|
119
|
+
emit(vcs_1.AssistantMetric.Cost, Math.round(usage.estimated_cost_usd * 100), dims, 'USD');
|
|
120
|
+
}
|
|
121
|
+
// Native USD-priced usage, excluding credit-priced usage
|
|
122
|
+
if (!(0, lodash_1.isNil)(usage.cost_usd)) {
|
|
123
|
+
emit(vcs_1.AssistantMetric.Cost, Math.round(usage.cost_usd * 100), dims, 'NativeUSD');
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
const emitTokens = (usage, dims) => {
|
|
127
|
+
if (usage.uncached_text_input_tokens) {
|
|
128
|
+
emit(vcs_1.AssistantMetric.InputTokens, usage.uncached_text_input_tokens, dims);
|
|
129
|
+
}
|
|
130
|
+
if (usage.cached_text_input_tokens) {
|
|
131
|
+
emit(vcs_1.AssistantMetric.CacheReadTokens, usage.cached_text_input_tokens, dims);
|
|
132
|
+
}
|
|
133
|
+
if (usage.text_output_tokens) {
|
|
134
|
+
emit(vcs_1.AssistantMetric.OutputTokens, usage.text_output_tokens, dims);
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
// Per-client breakdown, Codex clients only. Totals are skipped: they
|
|
138
|
+
// include ChatGPT and Work usage.
|
|
139
|
+
const clients = usageItem.clients ?? [];
|
|
140
|
+
for (const client of clients.filter((c) => isCodexClient(c.client_id))) {
|
|
141
|
+
const dims = { feature: client.client_id };
|
|
142
|
+
emitBilling(client, dims);
|
|
143
|
+
const threads = client.chats ?? client.threads;
|
|
144
|
+
if (threads > 0) {
|
|
145
|
+
emit(vcs_1.AssistantMetric.Usages, threads, dims, 'Threads');
|
|
146
|
+
}
|
|
147
|
+
const turns = client.messages ?? client.turns;
|
|
148
|
+
if (turns > 0) {
|
|
149
|
+
emit(vcs_1.AssistantMetric.Usages, turns, dims, 'Turns');
|
|
150
|
+
}
|
|
151
|
+
emitTokens(client, dims);
|
|
152
|
+
}
|
|
153
|
+
// Model buckets can combine products. They also capture Codex credits
|
|
154
|
+
// with no client attribution, so they are the spend source of truth. Only
|
|
155
|
+
// attribute them to Codex when every client with billed usage is Codex.
|
|
156
|
+
// Model token counts may still include unbilled ChatGPT or Work tokens.
|
|
157
|
+
const models = usageItem.models ?? [];
|
|
158
|
+
const modelsAreCodex = clients.every((c) => isCodexClient(c.client_id) || !isBilled(c));
|
|
159
|
+
// Without a Codex client or model billing, model tokens are ChatGPT/Work
|
|
160
|
+
const hasCodexActivity = clients.some((c) => isCodexClient(c.client_id)) || models.some(isBilled);
|
|
161
|
+
if (modelsAreCodex && hasCodexActivity) {
|
|
162
|
+
for (const modelUsage of models) {
|
|
163
|
+
// Speed tier disambiguates the metric uid for models billed at both
|
|
164
|
+
// standard and fast rates
|
|
165
|
+
const dims = {
|
|
166
|
+
model: modelUsage.model,
|
|
167
|
+
speed: modelUsage.speed ?? undefined,
|
|
168
|
+
};
|
|
169
|
+
emitBilling(modelUsage, dims);
|
|
170
|
+
emitTokens(modelUsage, dims);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
// Code attribution is Codex-only (user x day; no model or client)
|
|
174
|
+
const linesOfCode = usageItem.code_attribution?.lines_of_code;
|
|
175
|
+
if (linesOfCode?.added) {
|
|
176
|
+
emit(vcs_1.AssistantMetric.AILinesAdded, linesOfCode.added, {});
|
|
177
|
+
}
|
|
178
|
+
if (linesOfCode?.removed) {
|
|
179
|
+
emit(vcs_1.AssistantMetric.AILinesRemoved, linesOfCode.removed, {});
|
|
180
|
+
}
|
|
181
|
+
if (linesOfCode?.committed_percentage) {
|
|
182
|
+
emit(vcs_1.AssistantMetric.PercentageOfCodeWritten, linesOfCode.committed_percentage, {});
|
|
183
|
+
}
|
|
184
|
+
const commitAttribution = usageItem.code_attribution?.commits;
|
|
185
|
+
if (commitAttribution?.with_codex_contribution) {
|
|
186
|
+
emit(vcs_1.AssistantMetric.CommitsCreated, commitAttribution.with_codex_contribution, {});
|
|
187
|
+
}
|
|
188
|
+
// ChatGPT- or Work-only rows must not register the user as a Codex user
|
|
189
|
+
if (!metrics.length) {
|
|
190
|
+
return [];
|
|
191
|
+
}
|
|
85
192
|
const res = [];
|
|
86
|
-
// Track user and create user records if not seen before
|
|
87
193
|
if (!this.seenUsers.has(userEmail)) {
|
|
88
194
|
this.seenUsers.add(userEmail);
|
|
89
195
|
res.push({
|
|
@@ -115,206 +221,7 @@ class Usage extends common_2.CodexConverter {
|
|
|
115
221
|
},
|
|
116
222
|
});
|
|
117
223
|
}
|
|
118
|
-
|
|
119
|
-
let hasActivity = false;
|
|
120
|
-
// Per-client breakdown metrics (skip totals - let reports aggregate)
|
|
121
|
-
for (const client of usageItem.clients) {
|
|
122
|
-
const clientFeature = client.client_id;
|
|
123
|
-
if (client.credits > 0) {
|
|
124
|
-
hasActivity = true;
|
|
125
|
-
res.push(...this.getAssistantMetric({
|
|
126
|
-
startedAt,
|
|
127
|
-
endedAt,
|
|
128
|
-
assistantMetricType: vcs_1.AssistantMetric.Cost,
|
|
129
|
-
value: client.credits,
|
|
130
|
-
organization,
|
|
131
|
-
userEmail,
|
|
132
|
-
feature: clientFeature,
|
|
133
|
-
}));
|
|
134
|
-
}
|
|
135
|
-
if (client.threads > 0) {
|
|
136
|
-
hasActivity = true;
|
|
137
|
-
res.push(...this.getAssistantMetric({
|
|
138
|
-
startedAt,
|
|
139
|
-
endedAt,
|
|
140
|
-
assistantMetricType: vcs_1.AssistantMetric.Usages,
|
|
141
|
-
assistantMetricTypeDetail: 'Threads',
|
|
142
|
-
value: client.threads,
|
|
143
|
-
organization,
|
|
144
|
-
userEmail,
|
|
145
|
-
feature: clientFeature,
|
|
146
|
-
}));
|
|
147
|
-
}
|
|
148
|
-
if (client.turns > 0) {
|
|
149
|
-
hasActivity = true;
|
|
150
|
-
res.push(...this.getAssistantMetric({
|
|
151
|
-
startedAt,
|
|
152
|
-
endedAt,
|
|
153
|
-
assistantMetricType: vcs_1.AssistantMetric.Usages,
|
|
154
|
-
assistantMetricTypeDetail: 'Turns',
|
|
155
|
-
value: client.turns,
|
|
156
|
-
organization,
|
|
157
|
-
userEmail,
|
|
158
|
-
feature: clientFeature,
|
|
159
|
-
}));
|
|
160
|
-
}
|
|
161
|
-
if (client.uncached_text_input_tokens) {
|
|
162
|
-
hasActivity = true;
|
|
163
|
-
res.push(...this.getAssistantMetric({
|
|
164
|
-
startedAt,
|
|
165
|
-
endedAt,
|
|
166
|
-
assistantMetricType: vcs_1.AssistantMetric.InputTokens,
|
|
167
|
-
value: client.uncached_text_input_tokens,
|
|
168
|
-
organization,
|
|
169
|
-
userEmail,
|
|
170
|
-
feature: clientFeature,
|
|
171
|
-
}));
|
|
172
|
-
}
|
|
173
|
-
if (client.cached_text_input_tokens) {
|
|
174
|
-
hasActivity = true;
|
|
175
|
-
res.push(...this.getAssistantMetric({
|
|
176
|
-
startedAt,
|
|
177
|
-
endedAt,
|
|
178
|
-
assistantMetricType: vcs_1.AssistantMetric.CacheReadTokens,
|
|
179
|
-
value: client.cached_text_input_tokens,
|
|
180
|
-
organization,
|
|
181
|
-
userEmail,
|
|
182
|
-
feature: clientFeature,
|
|
183
|
-
}));
|
|
184
|
-
}
|
|
185
|
-
if (client.text_output_tokens) {
|
|
186
|
-
hasActivity = true;
|
|
187
|
-
res.push(...this.getAssistantMetric({
|
|
188
|
-
startedAt,
|
|
189
|
-
endedAt,
|
|
190
|
-
assistantMetricType: vcs_1.AssistantMetric.OutputTokens,
|
|
191
|
-
value: client.text_output_tokens,
|
|
192
|
-
organization,
|
|
193
|
-
userEmail,
|
|
194
|
-
feature: clientFeature,
|
|
195
|
-
}));
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
// Per-model breakdown metrics; speed tier disambiguates the metric uid
|
|
199
|
-
// for models billed at both standard and fast rates
|
|
200
|
-
for (const modelUsage of usageItem.models ?? []) {
|
|
201
|
-
const dims = {
|
|
202
|
-
model: modelUsage.model,
|
|
203
|
-
speed: modelUsage.speed ?? undefined,
|
|
204
|
-
};
|
|
205
|
-
if (modelUsage.credits > 0) {
|
|
206
|
-
hasActivity = true;
|
|
207
|
-
res.push(...this.getAssistantMetric({
|
|
208
|
-
startedAt,
|
|
209
|
-
endedAt,
|
|
210
|
-
assistantMetricType: vcs_1.AssistantMetric.Cost,
|
|
211
|
-
value: modelUsage.credits,
|
|
212
|
-
organization,
|
|
213
|
-
userEmail,
|
|
214
|
-
...dims,
|
|
215
|
-
}));
|
|
216
|
-
}
|
|
217
|
-
// API reports estimated_cost_usd rounded to the nearest cent; store
|
|
218
|
-
// integer cents with the currency as detail, matching the Claude path
|
|
219
|
-
const estimatedCents = Math.round((modelUsage.estimated_cost_usd ?? 0) * 100);
|
|
220
|
-
if (estimatedCents > 0) {
|
|
221
|
-
hasActivity = true;
|
|
222
|
-
res.push(...this.getAssistantMetric({
|
|
223
|
-
startedAt,
|
|
224
|
-
endedAt,
|
|
225
|
-
assistantMetricType: vcs_1.AssistantMetric.Cost,
|
|
226
|
-
assistantMetricTypeDetail: 'USD',
|
|
227
|
-
value: estimatedCents,
|
|
228
|
-
organization,
|
|
229
|
-
userEmail,
|
|
230
|
-
...dims,
|
|
231
|
-
}));
|
|
232
|
-
}
|
|
233
|
-
if (modelUsage.uncached_text_input_tokens) {
|
|
234
|
-
hasActivity = true;
|
|
235
|
-
res.push(...this.getAssistantMetric({
|
|
236
|
-
startedAt,
|
|
237
|
-
endedAt,
|
|
238
|
-
assistantMetricType: vcs_1.AssistantMetric.InputTokens,
|
|
239
|
-
value: modelUsage.uncached_text_input_tokens,
|
|
240
|
-
organization,
|
|
241
|
-
userEmail,
|
|
242
|
-
...dims,
|
|
243
|
-
}));
|
|
244
|
-
}
|
|
245
|
-
if (modelUsage.cached_text_input_tokens) {
|
|
246
|
-
hasActivity = true;
|
|
247
|
-
res.push(...this.getAssistantMetric({
|
|
248
|
-
startedAt,
|
|
249
|
-
endedAt,
|
|
250
|
-
assistantMetricType: vcs_1.AssistantMetric.CacheReadTokens,
|
|
251
|
-
value: modelUsage.cached_text_input_tokens,
|
|
252
|
-
organization,
|
|
253
|
-
userEmail,
|
|
254
|
-
...dims,
|
|
255
|
-
}));
|
|
256
|
-
}
|
|
257
|
-
if (modelUsage.text_output_tokens) {
|
|
258
|
-
hasActivity = true;
|
|
259
|
-
res.push(...this.getAssistantMetric({
|
|
260
|
-
startedAt,
|
|
261
|
-
endedAt,
|
|
262
|
-
assistantMetricType: vcs_1.AssistantMetric.OutputTokens,
|
|
263
|
-
value: modelUsage.text_output_tokens,
|
|
264
|
-
organization,
|
|
265
|
-
userEmail,
|
|
266
|
-
...dims,
|
|
267
|
-
}));
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
// Code attribution metrics (user x day; no model or client dimension)
|
|
271
|
-
const linesOfCode = usageItem.code_attribution?.lines_of_code;
|
|
272
|
-
if (linesOfCode?.added) {
|
|
273
|
-
hasActivity = true;
|
|
274
|
-
res.push(...this.getAssistantMetric({
|
|
275
|
-
startedAt,
|
|
276
|
-
endedAt,
|
|
277
|
-
assistantMetricType: vcs_1.AssistantMetric.AILinesAdded,
|
|
278
|
-
value: linesOfCode.added,
|
|
279
|
-
organization,
|
|
280
|
-
userEmail,
|
|
281
|
-
}));
|
|
282
|
-
}
|
|
283
|
-
if (linesOfCode?.removed) {
|
|
284
|
-
hasActivity = true;
|
|
285
|
-
res.push(...this.getAssistantMetric({
|
|
286
|
-
startedAt,
|
|
287
|
-
endedAt,
|
|
288
|
-
assistantMetricType: vcs_1.AssistantMetric.AILinesRemoved,
|
|
289
|
-
value: linesOfCode.removed,
|
|
290
|
-
organization,
|
|
291
|
-
userEmail,
|
|
292
|
-
}));
|
|
293
|
-
}
|
|
294
|
-
if (linesOfCode?.committed_percentage) {
|
|
295
|
-
hasActivity = true;
|
|
296
|
-
res.push(...this.getAssistantMetric({
|
|
297
|
-
startedAt,
|
|
298
|
-
endedAt,
|
|
299
|
-
assistantMetricType: vcs_1.AssistantMetric.PercentageOfCodeWritten,
|
|
300
|
-
value: linesOfCode.committed_percentage,
|
|
301
|
-
organization,
|
|
302
|
-
userEmail,
|
|
303
|
-
}));
|
|
304
|
-
}
|
|
305
|
-
const commitAttribution = usageItem.code_attribution?.commits;
|
|
306
|
-
if (commitAttribution?.with_codex_contribution) {
|
|
307
|
-
hasActivity = true;
|
|
308
|
-
res.push(...this.getAssistantMetric({
|
|
309
|
-
startedAt,
|
|
310
|
-
endedAt,
|
|
311
|
-
assistantMetricType: vcs_1.AssistantMetric.CommitsCreated,
|
|
312
|
-
value: commitAttribution.with_codex_contribution,
|
|
313
|
-
organization,
|
|
314
|
-
userEmail,
|
|
315
|
-
}));
|
|
316
|
-
}
|
|
317
|
-
// Add UserToolUsage record if user had any activity
|
|
224
|
+
res.push(...metrics);
|
|
318
225
|
if (hasActivity) {
|
|
319
226
|
res.push({
|
|
320
227
|
model: 'vcs_UserToolUsage',
|
|
@@ -338,7 +245,6 @@ class Usage extends common_2.CodexConverter {
|
|
|
338
245
|
return res;
|
|
339
246
|
}
|
|
340
247
|
async onProcessingComplete() {
|
|
341
|
-
// Create organization record
|
|
342
248
|
return [
|
|
343
249
|
{
|
|
344
250
|
model: 'vcs_Organization',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usage.js","sourceRoot":"","sources":["../../../src/converters/codex/usage.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"usage.js","sourceRoot":"","sources":["../../../src/converters/codex/usage.ts"],"names":[],"mappings":";;;AAwFA,sCAEC;AAzFD,wDAAmD;AACnD,mCAA6B;AAE7B,uCAMuB;AAEvB,qCAAwC;AA0ExC,4E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