@artieeez/cf-plugin-github 0.0.0-stage → 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.
@@ -0,0 +1,539 @@
1
+ import { Octokit } from '@octokit/rest';
2
+ import { z } from 'zod';
3
+ import { type FilterValue, type Trigger, type WaitFilterValue } from '@artieeez/cf-core';
4
+ import { setting, type Exec, type SettingSpec, type WaitEvent } from '@artieeez/cf-sdk';
5
+ import { type CheckResult, type IngressRequest, type NormalizedEvent, type PluginContext } from '@artieeez/cf-sdk/plugin';
6
+ import { type CiPolicy, type CiResult } from './ci.ts';
7
+ export * from './ci.ts';
8
+ export * from './diff.ts';
9
+ export { setting } from '@artieeez/cf-sdk';
10
+ declare const Config: z.ZodObject<{
11
+ appId: z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>, z.ZodString>;
12
+ installationId: z.ZodPipe<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>, z.ZodString>;
13
+ appSlug: z.ZodString;
14
+ repos: z.ZodPreprocess<z.ZodArray<z.ZodString>, unknown>;
15
+ }, z.core.$strict>;
16
+ export type GithubConfig = z.infer<typeof Config>;
17
+ export declare const GITHUB_API_URL = "https://api.github.com";
18
+ export declare const GITHUB_GIT_URL = "https://github.com";
19
+ export declare const EVENTS: {
20
+ 'github.checks.completed': z.ZodObject<{
21
+ repo: z.ZodString;
22
+ sha: z.ZodString;
23
+ suiteId: z.ZodNumber;
24
+ app: z.ZodObject<{
25
+ id: z.ZodNumber;
26
+ slug: z.ZodString;
27
+ }, z.core.$strict>;
28
+ conclusion: z.ZodNullable<z.ZodString>;
29
+ headBranch: z.ZodNullable<z.ZodString>;
30
+ pullRequests: z.ZodArray<z.ZodNumber>;
31
+ }, z.core.$strict>;
32
+ 'github.pr.opened': z.ZodObject<{
33
+ repo: z.ZodString;
34
+ number: z.ZodNumber;
35
+ url: z.ZodString;
36
+ title: z.ZodString;
37
+ draft: z.ZodBoolean;
38
+ head: z.ZodObject<{
39
+ ref: z.ZodString;
40
+ sha: z.ZodString;
41
+ }, z.core.$strict>;
42
+ base: z.ZodObject<{
43
+ ref: z.ZodString;
44
+ }, z.core.$strict>;
45
+ user: z.ZodNullable<z.ZodObject<{
46
+ login: z.ZodString;
47
+ }, z.core.$strict>>;
48
+ }, z.core.$strict>;
49
+ 'github.pr.closed': z.ZodObject<{
50
+ merged: z.ZodBoolean;
51
+ repo: z.ZodString;
52
+ number: z.ZodNumber;
53
+ url: z.ZodString;
54
+ title: z.ZodString;
55
+ draft: z.ZodBoolean;
56
+ head: z.ZodObject<{
57
+ ref: z.ZodString;
58
+ sha: z.ZodString;
59
+ }, z.core.$strict>;
60
+ base: z.ZodObject<{
61
+ ref: z.ZodString;
62
+ }, z.core.$strict>;
63
+ user: z.ZodNullable<z.ZodObject<{
64
+ login: z.ZodString;
65
+ }, z.core.$strict>>;
66
+ }, z.core.$strict>;
67
+ 'github.pr.merged': z.ZodObject<{
68
+ merged: z.ZodBoolean;
69
+ repo: z.ZodString;
70
+ number: z.ZodNumber;
71
+ url: z.ZodString;
72
+ title: z.ZodString;
73
+ draft: z.ZodBoolean;
74
+ head: z.ZodObject<{
75
+ ref: z.ZodString;
76
+ sha: z.ZodString;
77
+ }, z.core.$strict>;
78
+ base: z.ZodObject<{
79
+ ref: z.ZodString;
80
+ }, z.core.$strict>;
81
+ user: z.ZodNullable<z.ZodObject<{
82
+ login: z.ZodString;
83
+ }, z.core.$strict>>;
84
+ }, z.core.$strict>;
85
+ 'github.pr.synchronized': z.ZodObject<{
86
+ before: z.ZodString;
87
+ repo: z.ZodString;
88
+ number: z.ZodNumber;
89
+ url: z.ZodString;
90
+ title: z.ZodString;
91
+ draft: z.ZodBoolean;
92
+ head: z.ZodObject<{
93
+ ref: z.ZodString;
94
+ sha: z.ZodString;
95
+ }, z.core.$strict>;
96
+ base: z.ZodObject<{
97
+ ref: z.ZodString;
98
+ }, z.core.$strict>;
99
+ user: z.ZodNullable<z.ZodObject<{
100
+ login: z.ZodString;
101
+ }, z.core.$strict>>;
102
+ }, z.core.$strict>;
103
+ 'github.pr.reopened': z.ZodObject<{
104
+ repo: z.ZodString;
105
+ number: z.ZodNumber;
106
+ url: z.ZodString;
107
+ title: z.ZodString;
108
+ draft: z.ZodBoolean;
109
+ head: z.ZodObject<{
110
+ ref: z.ZodString;
111
+ sha: z.ZodString;
112
+ }, z.core.$strict>;
113
+ base: z.ZodObject<{
114
+ ref: z.ZodString;
115
+ }, z.core.$strict>;
116
+ user: z.ZodNullable<z.ZodObject<{
117
+ login: z.ZodString;
118
+ }, z.core.$strict>>;
119
+ }, z.core.$strict>;
120
+ 'github.pr.ready': z.ZodObject<{
121
+ repo: z.ZodString;
122
+ number: z.ZodNumber;
123
+ url: z.ZodString;
124
+ title: z.ZodString;
125
+ draft: z.ZodBoolean;
126
+ head: z.ZodObject<{
127
+ ref: z.ZodString;
128
+ sha: z.ZodString;
129
+ }, z.core.$strict>;
130
+ base: z.ZodObject<{
131
+ ref: z.ZodString;
132
+ }, z.core.$strict>;
133
+ user: z.ZodNullable<z.ZodObject<{
134
+ login: z.ZodString;
135
+ }, z.core.$strict>>;
136
+ }, z.core.$strict>;
137
+ 'github.pr.review.submitted': z.ZodObject<{
138
+ repo: z.ZodString;
139
+ number: z.ZodNumber;
140
+ url: z.ZodString;
141
+ headSha: z.ZodString;
142
+ author: z.ZodNullable<z.ZodObject<{
143
+ login: z.ZodString;
144
+ }, z.core.$strict>>;
145
+ review: z.ZodObject<{
146
+ id: z.ZodNumber;
147
+ state: z.ZodEnum<{
148
+ approved: "approved";
149
+ changes_requested: "changes_requested";
150
+ commented: "commented";
151
+ }>;
152
+ body: z.ZodString;
153
+ commitId: z.ZodString;
154
+ url: z.ZodString;
155
+ stale: z.ZodBoolean;
156
+ }, z.core.$strict>;
157
+ user: z.ZodObject<{
158
+ login: z.ZodString;
159
+ association: z.ZodString;
160
+ bot: z.ZodBoolean;
161
+ }, z.core.$strict>;
162
+ byAuthor: z.ZodBoolean;
163
+ }, z.core.$strict>;
164
+ 'github.pr.comment.created': z.ZodObject<{
165
+ repo: z.ZodString;
166
+ number: z.ZodNumber;
167
+ url: z.ZodString;
168
+ author: z.ZodNullable<z.ZodObject<{
169
+ login: z.ZodString;
170
+ }, z.core.$strict>>;
171
+ comment: z.ZodObject<{
172
+ id: z.ZodNumber;
173
+ kind: z.ZodEnum<{
174
+ issue: "issue";
175
+ review: "review";
176
+ }>;
177
+ body: z.ZodString;
178
+ url: z.ZodString;
179
+ path: z.ZodNullable<z.ZodString>;
180
+ line: z.ZodNullable<z.ZodNumber>;
181
+ reviewId: z.ZodNullable<z.ZodNumber>;
182
+ inReplyTo: z.ZodNullable<z.ZodNumber>;
183
+ }, z.core.$strict>;
184
+ user: z.ZodObject<{
185
+ login: z.ZodString;
186
+ association: z.ZodString;
187
+ bot: z.ZodBoolean;
188
+ }, z.core.$strict>;
189
+ byAuthor: z.ZodBoolean;
190
+ command: z.ZodNullable<z.ZodString>;
191
+ text: z.ZodNullable<z.ZodString>;
192
+ }, z.core.$strict>;
193
+ };
194
+ /** Webhook -> door 1 events; another installation, a repo outside `repos` and other kinds give none. */
195
+ export declare function normalize(req: IngressRequest, config: GithubConfig): NormalizedEvent[];
196
+ /** `X-Hub-Signature-256`: `sha256=` and the hex HMAC-SHA256 of the raw body under the webhook secret. */
197
+ export declare function verify(rawBody: string, signature: string | undefined, secret: string | undefined): boolean;
198
+ /** Pages of 100 workflow runs `github.ci.check` reads for a sha (door 6). */
199
+ export declare const WORKFLOW_RUN_PAGES = 10;
200
+ type Ctx = PluginContext<GithubConfig>;
201
+ /** The permissions a minted token may carry (door 2, AD-072), and its default. */
202
+ export declare const TOKEN_PERMISSIONS: readonly ["contents", "pull_requests", "checks", "actions", "statuses", "issues"];
203
+ export type TokenPermissions = Partial<Record<(typeof TOKEN_PERMISSIONS)[number], 'read' | 'write'>>;
204
+ declare function actions(ctx: Ctx): {
205
+ /**
206
+ * An installation token for `repo` only, minted with the App key (door 2, AD-072): pushes and
207
+ * PRs made with it are the App's bot's. A repo outside `repos`, or a permission outside door 2,
208
+ * is refused before any request.
209
+ */
210
+ token(a: {
211
+ repo: string;
212
+ permissions?: TokenPermissions;
213
+ }): Promise<{
214
+ token: string;
215
+ expiresAt: string;
216
+ }>;
217
+ /** an issue comment on PR `number` of `repo`, as the instance's App; a repo outside `repos` is refused */
218
+ comment(a: {
219
+ repo: string;
220
+ number: number;
221
+ body: string;
222
+ }): Promise<{
223
+ id: number;
224
+ url: string;
225
+ }>;
226
+ };
227
+ export type GithubActions = ReturnType<typeof actions>;
228
+ /** The official `github` plugin (the `forge` slot). */
229
+ export declare const githubPlugin: import("@artieeez/cf-sdk/plugin").PluginDefinition<{
230
+ appId: string;
231
+ installationId: string;
232
+ appSlug: string;
233
+ repos: string[];
234
+ }, {
235
+ /**
236
+ * An installation token for `repo` only, minted with the App key (door 2, AD-072): pushes and
237
+ * PRs made with it are the App's bot's. A repo outside `repos`, or a permission outside door 2,
238
+ * is refused before any request.
239
+ */
240
+ token(a: {
241
+ repo: string;
242
+ permissions?: TokenPermissions;
243
+ }): Promise<{
244
+ token: string;
245
+ expiresAt: string;
246
+ }>;
247
+ /** an issue comment on PR `number` of `repo`, as the instance's App; a repo outside `repos` is refused */
248
+ comment(a: {
249
+ repo: string;
250
+ number: number;
251
+ body: string;
252
+ }): Promise<{
253
+ id: number;
254
+ url: string;
255
+ }>;
256
+ }>;
257
+ /** What the helpers need of a task context. */
258
+ export interface HelperContext {
259
+ exec: Exec;
260
+ step: string;
261
+ outputs: Record<string, unknown>;
262
+ }
263
+ /** The env `git` runs with: no system or global config, no prompt, no hooks, the token by a credential helper. */
264
+ export declare function gitEnv(token: string): Record<string, string>;
265
+ export declare const redact: (text: string, token: string) => string;
266
+ /**
267
+ * Pushes `sha` to `branch` of `repo` with the workflow's `token` (door 5): never forced, no push
268
+ * options, no hooks; the token reaches git only through the credential helper's env.
269
+ */
270
+ declare function push(ctx: HelperContext, a: {
271
+ token: string;
272
+ repo: string;
273
+ dir: string;
274
+ sha: string;
275
+ branch: string;
276
+ }): Promise<{
277
+ pushed: true;
278
+ remoteSha: string;
279
+ }>;
280
+ /**
281
+ * Clones `repo` into `dir` under `ctx.wd` with the workflow's `token` (github-helpers door 1,
282
+ * AD-067): no token in argv, URLs, `.git/config` or logs, no hooks, no global/system git config.
283
+ */
284
+ declare function clone(ctx: Pick<HelperContext, 'exec'>, a: {
285
+ token: string;
286
+ repo: string;
287
+ dir: string;
288
+ branch?: string;
289
+ depth?: number;
290
+ }): Promise<{
291
+ dir: string;
292
+ sha: string;
293
+ branch: string;
294
+ }>;
295
+ /**
296
+ * One CI check of `sha` (door 4) through the workflow's `octokit`: reads the checks, classifies
297
+ * them with the step's previous result of the same sha, and for `retrying` re-runs the failed jobs
298
+ * of each workflow run of the new round.
299
+ */
300
+ declare function check(ctx: HelperContext, a: {
301
+ octokit: Octokit;
302
+ repo: string;
303
+ sha: string;
304
+ policy?: CiPolicy;
305
+ }): Promise<CiResult>;
306
+ /**
307
+ * Opens a PR from `head` to `base` of `repo` through the workflow's `octokit` (AD-062): the PR
308
+ * already open for `head` on `base` comes back with `created: false`, one open for `head` on
309
+ * another base is an error, and a create that loses a race (422) returns the PR that won it.
310
+ */
311
+ declare function open(_ctx: HelperContext, a: {
312
+ octokit: Octokit;
313
+ repo: string;
314
+ head: string;
315
+ base: string;
316
+ title: string;
317
+ body: string;
318
+ draft?: boolean;
319
+ }): Promise<{
320
+ number: number;
321
+ url: string;
322
+ created: boolean;
323
+ }>;
324
+ /** What `github.pr.feedback` answers (door 5). */
325
+ export interface ReviewFeedback {
326
+ review: {
327
+ id: number;
328
+ state: string;
329
+ body: string;
330
+ user: {
331
+ login: string;
332
+ } | null;
333
+ };
334
+ comments: {
335
+ id: number;
336
+ path: string;
337
+ line: number | null;
338
+ body: string;
339
+ diffHunk: string;
340
+ url: string;
341
+ inReplyTo: number | null;
342
+ }[];
343
+ }
344
+ /** Review `reviewId` of PR `number` and every inline comment of it, through `octokit` (door 5). */
345
+ declare function feedback(_ctx: HelperContext, a: {
346
+ octokit: Octokit;
347
+ repo: string;
348
+ number: number;
349
+ reviewId: number;
350
+ }): Promise<ReviewFeedback>;
351
+ /** A comment `github.pr.review` posts: inline on `line` of `path`'s head when the diff shows it. */
352
+ export interface ReviewComment {
353
+ path: string;
354
+ line: number;
355
+ body: string;
356
+ }
357
+ /** What `github.pr.review` answers (github-review-helper door 1). */
358
+ export interface PostedReview {
359
+ id: number;
360
+ url: string;
361
+ /** `false`: a review holding this call's marker was already on the PR, and nothing was posted */
362
+ created: boolean;
363
+ inline: number;
364
+ inBody: number;
365
+ }
366
+ /** GitHub's limit on a review body. */
367
+ export declare const REVIEW_BODY_MAX = 65536;
368
+ /**
369
+ * Posts one `COMMENT` review on `commitId` of PR `number` through `octokit` (github-review-helper,
370
+ * AD-079): a comment on a head line the diff `<base>...<commitId>` shows goes inline, the rest go
371
+ * in the body under `### Outside the diff`; a `422` posts again with every comment in the body. The
372
+ * body's first line marks it with `key` (default `<runId>/<step>@<visit>`): a review already
373
+ * holding that marker is returned with `created: false` and nothing is posted.
374
+ */
375
+ declare function review(ctx: HelperContext & {
376
+ runId: string;
377
+ visit: number;
378
+ }, a: {
379
+ octokit: Octokit;
380
+ repo: string;
381
+ number: number;
382
+ commitId: string;
383
+ body: string;
384
+ comments?: ReviewComment[];
385
+ key?: string;
386
+ }): Promise<PostedReview>;
387
+ /**
388
+ * Whether the workflow's own client can read each of `repos` (health-ready door 7), for its
389
+ * `workerReady`: `401` is a token GitHub rejects and `404` a repo it cannot see, both fatal; a
390
+ * network error or any other answer is not.
391
+ */
392
+ declare function checkAccess(octokit: Octokit, a: {
393
+ repos: string[];
394
+ }): Promise<CheckResult>;
395
+ type Matched = string | FilterValue;
396
+ /** The PR updates `github.on.prUpdated` binds, and their events (door 2). */
397
+ declare const PR_UPDATES: {
398
+ readonly opened: "github.pr.opened";
399
+ readonly synchronized: "github.pr.synchronized";
400
+ readonly reopened: "github.pr.reopened";
401
+ readonly ready: "github.pr.ready";
402
+ };
403
+ export type PrUpdate = keyof typeof PR_UPDATES;
404
+ /** The associations that mean write access (AD-073). */
405
+ export declare const WRITE_ACCESS: string[];
406
+ type ReviewState = 'approved' | 'changes_requested' | 'commented';
407
+ /** The authoring helpers of door 5. */
408
+ export declare const github: {
409
+ slot: () => import("@artieeez/cf-sdk").PluginSlot<{
410
+ /**
411
+ * An installation token for `repo` only, minted with the App key (door 2, AD-072): pushes and
412
+ * PRs made with it are the App's bot's. A repo outside `repos`, or a permission outside door 2,
413
+ * is refused before any request.
414
+ */
415
+ token(a: {
416
+ repo: string;
417
+ permissions?: TokenPermissions;
418
+ }): Promise<{
419
+ token: string;
420
+ expiresAt: string;
421
+ }>;
422
+ /** an issue comment on PR `number` of `repo`, as the instance's App; a repo outside `repos` is refused */
423
+ comment(a: {
424
+ repo: string;
425
+ number: number;
426
+ body: string;
427
+ }): Promise<{
428
+ id: number;
429
+ url: string;
430
+ }>;
431
+ }>;
432
+ repo: (opts?: {
433
+ default?: string;
434
+ }) => SettingSpec;
435
+ branch: (opts?: {
436
+ default?: string;
437
+ }) => SettingSpec;
438
+ label: (opts?: {
439
+ default?: string;
440
+ }) => SettingSpec;
441
+ setting: typeof setting;
442
+ match: {
443
+ /** a check suite of `sha` in `repo` completed */
444
+ checksCompleted(o: {
445
+ slot: string;
446
+ repo: WaitFilterValue;
447
+ sha: WaitFilterValue;
448
+ }): WaitEvent;
449
+ /**
450
+ * A review of PR `number` of `repo` by someone who counts (AD-073); `states` narrows the state,
451
+ * `sha` the commit reviewed
452
+ */
453
+ reviewSubmitted(o: {
454
+ slot: string;
455
+ repo: WaitFilterValue;
456
+ number: WaitFilterValue;
457
+ states?: ReviewState[];
458
+ reviewers?: string[];
459
+ sha?: WaitFilterValue;
460
+ }): WaitEvent;
461
+ /** A comment on PR `number` of `repo` by someone who counts (AD-073), starting with `command` when given */
462
+ commentCreated(o: {
463
+ slot: string;
464
+ repo: WaitFilterValue;
465
+ number: WaitFilterValue;
466
+ command?: string;
467
+ reviewers?: string[];
468
+ }): WaitEvent;
469
+ /** new commits pushed to PR `number` of `repo` (head `sha`, when given) */
470
+ prSynchronized(o: {
471
+ slot: string;
472
+ repo: WaitFilterValue;
473
+ number: WaitFilterValue;
474
+ sha?: WaitFilterValue;
475
+ }): WaitEvent;
476
+ /** PR `number` of `repo` closed, merged or not */
477
+ prClosed(o: {
478
+ slot: string;
479
+ repo: WaitFilterValue;
480
+ number: WaitFilterValue;
481
+ }): WaitEvent;
482
+ };
483
+ on: {
484
+ /**
485
+ * A non-draft PR became worth reviewing: opened, new commits, reopened or marked ready (`on`
486
+ * narrows it, all four by default); one trigger per update, keyed on the PR's URL
487
+ */
488
+ prUpdated(o: {
489
+ slot: string;
490
+ repo?: Matched;
491
+ base?: Matched;
492
+ on?: PrUpdate[];
493
+ input: Record<string, string>;
494
+ key?: string;
495
+ }): Trigger[];
496
+ /** a PR merged (into `base`, when given) */
497
+ prMerged(o: {
498
+ slot: string;
499
+ base?: Matched;
500
+ input: Record<string, string>;
501
+ key?: string;
502
+ }): Trigger;
503
+ /**
504
+ * A review of the PR whose URL the run holds as a key (AD-074) answers its open `step`: one
505
+ * trigger per state in `outcomes`; stale reviews and those who do not count (AD-073) answer nothing
506
+ */
507
+ reviewAnswers(o: {
508
+ slot: string;
509
+ step: string;
510
+ outcomes: Partial<Record<ReviewState, string>>;
511
+ data?: Record<string, string>;
512
+ reviewers?: string[];
513
+ }): Trigger[];
514
+ /** a PR comment whose first word is `command`, from someone who counts, answers the open `step` with `outcome` */
515
+ commentCommand(o: {
516
+ slot: string;
517
+ command: string;
518
+ step: string;
519
+ outcome: string;
520
+ data?: Record<string, string>;
521
+ reviewers?: string[];
522
+ }): Trigger;
523
+ };
524
+ git: {
525
+ push: typeof push;
526
+ clone: typeof clone;
527
+ };
528
+ ci: {
529
+ check: typeof check;
530
+ };
531
+ pr: {
532
+ open: typeof open;
533
+ feedback: typeof feedback;
534
+ review: typeof review;
535
+ };
536
+ checkAccess: typeof checkAccess;
537
+ };
538
+ export * from './setup.ts';
539
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAsD,KAAK,WAAW,EAAE,KAAK,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC7I,OAAO,EAAE,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,WAAW,EAAE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACxF,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,aAAa,EAGnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAA0B,KAAK,QAAQ,EAAE,KAAK,QAAQ,EAAmB,MAAM,SAAS,CAAC;AAGhG,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAW3C,QAAA,MAAM,MAAM;;;;;kBAUV,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,CAAC;AAElD,eAAO,MAAM,cAAc,2BAA2B,CAAC;AACvD,eAAO,MAAM,cAAc,uBAAuB,CAAC;AAgEnD,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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