@artieeez/cf-plugin-linear 0.0.0-stage → 0.2.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.
package/README.md CHANGED
@@ -1,3 +1,123 @@
1
- # Temporary Holding Version
1
+ # linear (official plugin)
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ `@artieeez/cf-plugin-linear`. Ingress, run in-process on the server, verifies Linear webhook
4
+ signatures (`Linear-Signature`, a hex HMAC-SHA256 of the raw body), refuses deliveries more
5
+ than 60 s old, deduplicates on `Linear-Delivery`, and turns them into
6
+ `linear.issue.created`, `linear.issue.updated`, `linear.issue.labeled` and
7
+ `linear.comment.created` events. Actions run on the server with its `LINEAR_API_KEY`
8
+ (AD-047), called from task and hook code as `ctx.plugins.<slot>`: `getIssue`, `comment`,
9
+ `updateIssue({ state, labels, assignee })`, `createSubIssue` and
10
+ `linkUrl(issueId, { url, title })` (a link attachment, e.g. the PR), and the file actions
11
+ `downloadFiles`, `uploadFile` and `attachFile` (below), through `@linear/sdk`, and only on
12
+ issues of the instance's team. The worker needs no Linear key.
13
+
14
+ An admin can set Linear up on the dashboard (**Integrations > Linear > Set up**, AD-091):
15
+ paste an API key, choose one of its teams, and the server creates the webhook for `Issue`
16
+ and `Comment` on that team and stores the key and the webhook's signing secret sealed with
17
+ `CF_SECRETS_KEY`. Removing it there deletes the webhook on Linear.
18
+
19
+ The server also makes one instance from env (AD-089) when `LINEAR_TEAM` (the `team` key,
20
+ e.g. `BOSS`) is set, named `CF_LINEAR_INSTANCE` (default `linear`). `CF_LINEAR_HOOK_TOKEN`
21
+ (24 chars or more) is the `<token>` of its webhook URL `/hooks/<instance>/<token>`; unset,
22
+ the instance has no webhook. A `tracker` slot binds to the only Linear instance by itself;
23
+ settings are set on the dashboard.
24
+
25
+ ```ts
26
+ import { linear, setting } from '@artieeez/cf-plugin-linear';
27
+
28
+ plugins: { tracker: linear.slot() },
29
+ settings: { handoff: linear.state({ default: 'Factory' }) },
30
+ triggers: [
31
+ linear.on.issueEnteredState({ slot: 'tracker', state: setting('handoff'), input: { issueId: '$.data.id' } }),
32
+ linear.on.commentCommand({ slot: 'tracker', command: '/approve', step: 'approve', outcome: 'approved' }),
33
+ ],
34
+ ```
35
+
36
+ A comment command answers with `{}` unless the trigger maps event paths into the step's form
37
+ (AD-061). `text` is the comment after the command word, or `null` when nothing follows it:
38
+
39
+ ```ts
40
+ linear.on.commentCommand({
41
+ slot: 'tracker', command: '/approve', step: 'approve', outcome: 'approved',
42
+ data: { note: '$.data.text' }, // "/approve ship it" answers { note: "ship it" }
43
+ }),
44
+ ```
45
+
46
+ Register refuses a mapping that leaves out a required field or names one the form lacks, and
47
+ a step with a dynamic form cannot be answered by a comment. Data that fails the form at
48
+ answer time leaves the step open and appends `signal.ignored` with reason `invalid_answer`.
49
+
50
+ ## Files
51
+
52
+ Files travel as run artifacts, never in an action's JSON. The server fetches and uploads
53
+ them with its key.
54
+
55
+ - `downloadFiles(issueId)` stores every Linear upload on the issue as a run artifact. That
56
+ covers images and files in the description, in comments (the first 100, oldest first) and
57
+ attachments whose URL is on `uploads.linear.app`. The order is description, then comments,
58
+ then attachments. Each file lands at `linear/<IDENT>/<nn>-<name>`, numbered from `01`. It
59
+ answers `{ files, skipped, links }`. A file over 10 MB, or one Linear does not serve, is
60
+ in `skipped` with `reason` `too_large` or `fetch_failed`. Any other URL (a PR, a
61
+ look-alike host) is in `links` and is never fetched: the key goes only to Linear. More
62
+ than 20 uploads on one issue fails the call, with nothing stored.
63
+ - `uploadFile(issueId, { artifact })` uploads an artifact of the calling run (a path, or
64
+ `{ sha256 }`) of at most 10 MB, and answers `{ assetUrl }` to embed in a comment.
65
+ - `attachFile(issueId, { artifact, title, subtitle? })` uploads it the same way and adds it
66
+ to the issue as an attachment: `{ id, url, assetUrl }`.
67
+
68
+ Copy an issue's captures into the workspace in `preInit`:
69
+
70
+ ```ts
71
+ async preInit(ctx) {
72
+ const { files, skipped } = await ctx.plugins.tracker.downloadFiles(ctx.input.issueId);
73
+ const dir = join(ctx.wd, '.specs/features', ctx.input.feature, 'captures');
74
+ await mkdir(dir, { recursive: true });
75
+ for (const f of files) {
76
+ const a = await ctx.artifacts.get({ sha256: f.sha256 });
77
+ await writeFile(join(dir, f.path.split('/').at(-1)!), a!.bytes);
78
+ }
79
+ if (skipped.length > 0) ctx.log(`not copied: ${skipped.map((s) => s.name).join(', ')}`, 'warn');
80
+ },
81
+ ```
82
+
83
+ Post a proof from a task:
84
+
85
+ ```ts
86
+ await ctx.artifacts.put('proofs/login.png', png, { mediaType: 'image/png' });
87
+ await ctx.plugins.tracker.attachFile(issueId, { artifact: 'proofs/login.png', title: 'Login proof' });
88
+ // or inline in a comment
89
+ const { assetUrl } = await ctx.plugins.tracker.uploadFile(issueId, { artifact: 'proofs/login.png' });
90
+ await ctx.plugins.tracker.comment(issueId, `Proof:\n\n![login](${assetUrl})`);
91
+ ```
92
+
93
+ See [docs/design/plugins.md](../../docs/design/plugins.md) and the events in
94
+ [docs/design/events.md](../../docs/design/events.md).
95
+
96
+ ## Live walk
97
+
98
+ Runs `examples/hello-linear` once against a real Linear workspace. The tests use recorded
99
+ payloads and a fake GraphQL server; this is the run against the real thing.
100
+
101
+ 1. In Linear, pick a team (its key, e.g. `BOSS`) that has the states `Factory` and `Done`,
102
+ or set `handoff` and `done` to states it has. Create a personal API key (Settings,
103
+ Security & access) for `LINEAR_API_KEY`.
104
+ 2. Start a tunnel to the server's port (default 4400), e.g.
105
+ `cloudflared tunnel --url http://127.0.0.1:4400`, and note its public URL.
106
+ 3. In Linear, create a webhook (Settings, API, Webhooks) for that one team, with the data
107
+ change events Issues and Comments, and the URL `<tunnel URL>/hooks/<instance>/<token>`:
108
+ here `/hooks/linear-boss/<token>`, where `<token>` is a random string of at least 24
109
+ chars. Its signing secret is `LINEAR_WEBHOOK_SECRET`.
110
+ 4. There is no config file (AD-089): the server makes the instance from env. Export
111
+ `LINEAR_TEAM` (the team key), `CF_LINEAR_INSTANCE=linear-boss` (default `linear`),
112
+ `CF_LINEAR_HOOK_TOKEN` (the `<token>` above; unset, the instance has no webhook),
113
+ `LINEAR_API_KEY` and `LINEAR_WEBHOOK_SECRET` in the server's shell.
114
+ 5. Run `pnpm dev:server`, and `pnpm dev:hello-linear-worker` in another shell, which
115
+ needs no Linear key. The worker logs `registered hello-linear@0.1.0` once the server has
116
+ checked both states in the team. `tracker` binds to the only Linear instance by itself;
117
+ other states for `handoff` and `done` are set on the dashboard (Workflows >
118
+ hello-linear).
119
+ 6. Move an issue of the team into `Factory`. `pnpm cf run list` shows `hello-linear-1`
120
+ waiting on `approve`, and its events start with `run.created` `trigger: signal`.
121
+ 7. Comment `/approve` on the issue. The run ends `succeeded`, the issue gets a comment from
122
+ `onFinish` and moves to `Done`. `pnpm cf run view hello-linear-1` shows the
123
+ `plugin.action.*` events of each call.
@@ -0,0 +1,391 @@
1
+ import { z } from 'zod';
2
+ import { type ArtifactRef, type FilterValue, type Trigger, type WaitFilterValue } from '@artieeez/cf-core';
3
+ import { setting, type SettingSpec, type WaitEvent } from '@artieeez/cf-sdk';
4
+ import { type IngressRequest, type NormalizedEvent, type PluginContext } from '@artieeez/cf-sdk/plugin';
5
+ export { setting } from '@artieeez/cf-sdk';
6
+ /** The instance's scope: one team, by key (`BOSS`). */
7
+ declare const Config: z.ZodObject<{
8
+ team: z.ZodString;
9
+ }, z.core.$strict>;
10
+ export type LinearConfig = z.infer<typeof Config>;
11
+ export declare const LINEAR_API_URL = "https://api.linear.app/graphql";
12
+ export declare const EVENTS: {
13
+ 'linear.issue.created': z.ZodObject<{
14
+ id: z.ZodString;
15
+ identifier: z.ZodString;
16
+ title: z.ZodString;
17
+ url: z.ZodString;
18
+ team: z.ZodObject<{
19
+ id: z.ZodString;
20
+ key: z.ZodString;
21
+ }, z.core.$strict>;
22
+ state: z.ZodObject<{
23
+ id: z.ZodString;
24
+ name: z.ZodString;
25
+ type: z.ZodString;
26
+ }, z.core.$strict>;
27
+ labels: z.ZodArray<z.ZodObject<{
28
+ id: z.ZodString;
29
+ name: z.ZodString;
30
+ }, z.core.$strict>>;
31
+ assignee: z.ZodNullable<z.ZodObject<{
32
+ id: z.ZodString;
33
+ name: z.ZodString;
34
+ }, z.core.$strict>>;
35
+ stateChanged: z.ZodBoolean;
36
+ actor: z.ZodNullable<z.ZodObject<{
37
+ id: z.ZodString;
38
+ name: z.ZodString;
39
+ }, z.core.$strict>>;
40
+ }, z.core.$strict>;
41
+ 'linear.issue.updated': z.ZodObject<{
42
+ id: z.ZodString;
43
+ identifier: z.ZodString;
44
+ title: z.ZodString;
45
+ url: z.ZodString;
46
+ team: z.ZodObject<{
47
+ id: z.ZodString;
48
+ key: z.ZodString;
49
+ }, z.core.$strict>;
50
+ state: z.ZodObject<{
51
+ id: z.ZodString;
52
+ name: z.ZodString;
53
+ type: z.ZodString;
54
+ }, z.core.$strict>;
55
+ labels: z.ZodArray<z.ZodObject<{
56
+ id: z.ZodString;
57
+ name: z.ZodString;
58
+ }, z.core.$strict>>;
59
+ assignee: z.ZodNullable<z.ZodObject<{
60
+ id: z.ZodString;
61
+ name: z.ZodString;
62
+ }, z.core.$strict>>;
63
+ stateChanged: z.ZodBoolean;
64
+ actor: z.ZodNullable<z.ZodObject<{
65
+ id: z.ZodString;
66
+ name: z.ZodString;
67
+ }, z.core.$strict>>;
68
+ }, z.core.$strict>;
69
+ 'linear.issue.labeled': z.ZodObject<{
70
+ label: z.ZodObject<{
71
+ id: z.ZodString;
72
+ name: z.ZodString;
73
+ }, z.core.$strict>;
74
+ id: z.ZodString;
75
+ identifier: z.ZodString;
76
+ title: z.ZodString;
77
+ url: z.ZodString;
78
+ team: z.ZodObject<{
79
+ id: z.ZodString;
80
+ key: z.ZodString;
81
+ }, z.core.$strict>;
82
+ state: z.ZodObject<{
83
+ id: z.ZodString;
84
+ name: z.ZodString;
85
+ type: z.ZodString;
86
+ }, z.core.$strict>;
87
+ labels: z.ZodArray<z.ZodObject<{
88
+ id: z.ZodString;
89
+ name: z.ZodString;
90
+ }, z.core.$strict>>;
91
+ assignee: z.ZodNullable<z.ZodObject<{
92
+ id: z.ZodString;
93
+ name: z.ZodString;
94
+ }, z.core.$strict>>;
95
+ stateChanged: z.ZodBoolean;
96
+ actor: z.ZodNullable<z.ZodObject<{
97
+ id: z.ZodString;
98
+ name: z.ZodString;
99
+ }, z.core.$strict>>;
100
+ }, z.core.$strict>;
101
+ 'linear.comment.created': z.ZodObject<{
102
+ id: z.ZodString;
103
+ body: z.ZodString;
104
+ command: z.ZodNullable<z.ZodString>;
105
+ text: z.ZodNullable<z.ZodString>;
106
+ issue: z.ZodObject<{
107
+ id: z.ZodString;
108
+ }, z.core.$strict>;
109
+ user: z.ZodNullable<z.ZodObject<{
110
+ id: z.ZodString;
111
+ name: z.ZodString;
112
+ }, z.core.$strict>>;
113
+ }, z.core.$strict>;
114
+ };
115
+ export { commandOf, textOf } from '@artieeez/cf-core';
116
+ /** Webhook body -> door 3 events; another team's issue, removals and other entities give none. */
117
+ export declare function normalize(req: IngressRequest, config: LinearConfig): NormalizedEvent[];
118
+ /** `Linear-Signature`: hex HMAC-SHA256 of the raw body under the webhook secret. */
119
+ export declare function verify(rawBody: string, signature: string | undefined, secret: string | undefined): boolean;
120
+ interface Issue {
121
+ id: string;
122
+ identifier: string;
123
+ title: string;
124
+ description: string | null;
125
+ url: string;
126
+ state: {
127
+ id: string;
128
+ name: string;
129
+ type: string;
130
+ };
131
+ team: {
132
+ id: string;
133
+ key: string;
134
+ };
135
+ labels: {
136
+ id: string;
137
+ name: string;
138
+ }[];
139
+ assignee: {
140
+ id: string;
141
+ name: string;
142
+ } | null;
143
+ }
144
+ export interface IssuePatch {
145
+ /** a state name of the team */
146
+ state?: string;
147
+ /** label names of the team (or the workspace); replaces the issue's labels */
148
+ labels?: string[];
149
+ /** a user id; `null` unassigns */
150
+ assignee?: string | null;
151
+ }
152
+ /** The host Linear serves uploads from; the only host besides the API that gets the key (AC 5). */
153
+ export declare const UPLOADS_HOST = "uploads.linear.app";
154
+ /** Largest file downloaded or uploaded (AC 6, AC 13). */
155
+ export declare const FILE_MAX_BYTES = 10485760;
156
+ /** Most distinct uploads one issue may have for `downloadFiles` (AC 8). */
157
+ export declare const FILES_MAX = 20;
158
+ /** A file `downloadFiles` stored as a run artifact (door 3). */
159
+ export interface IssueFile extends ArtifactRef {
160
+ name: string;
161
+ source: 'description' | 'comment' | 'attachment';
162
+ commentId?: string;
163
+ }
164
+ /** What `downloadFiles` answers (door 3). */
165
+ export interface IssueFiles {
166
+ files: IssueFile[];
167
+ skipped: {
168
+ name: string;
169
+ url: string;
170
+ reason: 'too_large' | 'fetch_failed';
171
+ }[];
172
+ links: {
173
+ title: string;
174
+ url: string;
175
+ }[];
176
+ }
177
+ /** An artifact of the calling run: its path, or `{ sha256 }`. */
178
+ export type ArtifactArg = string | {
179
+ sha256: string;
180
+ };
181
+ /** Whether `url` is a Linear upload: https on exactly `uploads.linear.app`. */
182
+ export declare function isUpload(url: string): boolean;
183
+ /**
184
+ * Door 2: `linear/<IDENT>/<nn>-<name>`, `nn` counting stored files only, the name with every char
185
+ * outside `[A-Za-z0-9._-]` as `_` and trailing dots dropped, an extension from the media type unless
186
+ * it already ends in a known one, cut (stem first) to `ARTIFACT_PATH_MAX`.
187
+ */
188
+ export declare function filePath(identifier: string, n: number, name: string, mediaType: string): string;
189
+ declare function actions(ctx: PluginContext<LinearConfig>): {
190
+ getIssue: (id: string) => Promise<Issue>;
191
+ comment(issueId: string, body: string): Promise<{
192
+ id: string;
193
+ url: string;
194
+ }>;
195
+ updateIssue(id: string, patch: IssuePatch): Promise<{
196
+ id: string;
197
+ }>;
198
+ /** attaches `url` to the issue as a link titled `title`; Linear keeps one attachment per issue and URL */
199
+ linkUrl(issueId: string, link: {
200
+ url: string;
201
+ title: string;
202
+ }): Promise<{
203
+ id: string;
204
+ url: string;
205
+ }>;
206
+ /**
207
+ * Every Linear upload on the issue (description, comments oldest first, upload attachments)
208
+ * stored as a run artifact at `linear/<IDENT>/<nn>-<name>`; other URLs in `links`, never fetched
209
+ */
210
+ downloadFiles(issueId: string): Promise<IssueFiles>;
211
+ /** uploads a run artifact to Linear's storage; `assetUrl` can be embedded in a comment */
212
+ uploadFile: (issueId: string, file: {
213
+ artifact: ArtifactArg;
214
+ }) => Promise<{
215
+ assetUrl: string;
216
+ }>;
217
+ /** uploads a run artifact and adds it to the issue as an attachment titled `title` */
218
+ attachFile(issueId: string, file: {
219
+ artifact: ArtifactArg;
220
+ title: string;
221
+ subtitle?: string;
222
+ }): Promise<{
223
+ id: string;
224
+ url: string;
225
+ assetUrl: string;
226
+ }>;
227
+ createSubIssue(parentId: string, input: {
228
+ title: string;
229
+ description?: string;
230
+ }): Promise<{
231
+ id: string;
232
+ identifier: string;
233
+ url: string;
234
+ }>;
235
+ };
236
+ export type LinearActions = ReturnType<typeof actions>;
237
+ /** The official `linear` plugin. */
238
+ export declare const linearPlugin: import("@artieeez/cf-sdk/plugin").PluginDefinition<{
239
+ team: string;
240
+ }, {
241
+ getIssue: (id: string) => Promise<Issue>;
242
+ comment(issueId: string, body: string): Promise<{
243
+ id: string;
244
+ url: string;
245
+ }>;
246
+ updateIssue(id: string, patch: IssuePatch): Promise<{
247
+ id: string;
248
+ }>;
249
+ /** attaches `url` to the issue as a link titled `title`; Linear keeps one attachment per issue and URL */
250
+ linkUrl(issueId: string, link: {
251
+ url: string;
252
+ title: string;
253
+ }): Promise<{
254
+ id: string;
255
+ url: string;
256
+ }>;
257
+ /**
258
+ * Every Linear upload on the issue (description, comments oldest first, upload attachments)
259
+ * stored as a run artifact at `linear/<IDENT>/<nn>-<name>`; other URLs in `links`, never fetched
260
+ */
261
+ downloadFiles(issueId: string): Promise<IssueFiles>;
262
+ /** uploads a run artifact to Linear's storage; `assetUrl` can be embedded in a comment */
263
+ uploadFile: (issueId: string, file: {
264
+ artifact: ArtifactArg;
265
+ }) => Promise<{
266
+ assetUrl: string;
267
+ }>;
268
+ /** uploads a run artifact and adds it to the issue as an attachment titled `title` */
269
+ attachFile(issueId: string, file: {
270
+ artifact: ArtifactArg;
271
+ title: string;
272
+ subtitle?: string;
273
+ }): Promise<{
274
+ id: string;
275
+ url: string;
276
+ assetUrl: string;
277
+ }>;
278
+ createSubIssue(parentId: string, input: {
279
+ title: string;
280
+ description?: string;
281
+ }): Promise<{
282
+ id: string;
283
+ identifier: string;
284
+ url: string;
285
+ }>;
286
+ }>;
287
+ type Matched = string | FilterValue;
288
+ /** The authoring helpers of door 9. */
289
+ export declare const linear: {
290
+ slot: () => import("@artieeez/cf-sdk").PluginSlot<{
291
+ getIssue: (id: string) => Promise<Issue>;
292
+ comment(issueId: string, body: string): Promise<{
293
+ id: string;
294
+ url: string;
295
+ }>;
296
+ updateIssue(id: string, patch: IssuePatch): Promise<{
297
+ id: string;
298
+ }>;
299
+ /** attaches `url` to the issue as a link titled `title`; Linear keeps one attachment per issue and URL */
300
+ linkUrl(issueId: string, link: {
301
+ url: string;
302
+ title: string;
303
+ }): Promise<{
304
+ id: string;
305
+ url: string;
306
+ }>;
307
+ /**
308
+ * Every Linear upload on the issue (description, comments oldest first, upload attachments)
309
+ * stored as a run artifact at `linear/<IDENT>/<nn>-<name>`; other URLs in `links`, never fetched
310
+ */
311
+ downloadFiles(issueId: string): Promise<IssueFiles>;
312
+ /** uploads a run artifact to Linear's storage; `assetUrl` can be embedded in a comment */
313
+ uploadFile: (issueId: string, file: {
314
+ artifact: ArtifactArg;
315
+ }) => Promise<{
316
+ assetUrl: string;
317
+ }>;
318
+ /** uploads a run artifact and adds it to the issue as an attachment titled `title` */
319
+ attachFile(issueId: string, file: {
320
+ artifact: ArtifactArg;
321
+ title: string;
322
+ subtitle?: string;
323
+ }): Promise<{
324
+ id: string;
325
+ url: string;
326
+ assetUrl: string;
327
+ }>;
328
+ createSubIssue(parentId: string, input: {
329
+ title: string;
330
+ description?: string;
331
+ }): Promise<{
332
+ id: string;
333
+ identifier: string;
334
+ url: string;
335
+ }>;
336
+ }>;
337
+ state: (opts?: {
338
+ default?: string;
339
+ }) => SettingSpec;
340
+ label: (opts?: {
341
+ default?: string;
342
+ }) => SettingSpec;
343
+ setting: typeof setting;
344
+ match: {
345
+ /**
346
+ * The issue `issue` (often `ref('input.issueId')`) created in `state`, or moved into it
347
+ * (wait-steps); without `issue`, any issue, as a run-level handler names its run by `key`
348
+ */
349
+ issueEnteredState(o: {
350
+ slot: string;
351
+ issue?: WaitFilterValue;
352
+ state: Matched;
353
+ }): WaitEvent;
354
+ /** an issue moved out of `state`: for a run-level handler with `key: '$.data.id'` (boss-sdd-gaps door 4) */
355
+ issueLeftState(o: {
356
+ slot: string;
357
+ state: string | {
358
+ setting: string;
359
+ };
360
+ }): WaitEvent;
361
+ };
362
+ on: {
363
+ /** an issue created in `state`, or moved into it */
364
+ issueEnteredState(o: {
365
+ slot: string;
366
+ state: Matched;
367
+ input: Record<string, string>;
368
+ key?: string;
369
+ }): Trigger;
370
+ /** `label` added to an issue (or present when it was created) */
371
+ labelAdded(o: {
372
+ slot: string;
373
+ label: Matched;
374
+ input: Record<string, string>;
375
+ key?: string;
376
+ }): Trigger;
377
+ /**
378
+ * a comment whose first word is `command` answers the open `step` of the issue's run with
379
+ * `outcome`; `data` maps form fields to event paths, e.g. `{ note: '$.data.text' }` (AD-061)
380
+ */
381
+ commentCommand(o: {
382
+ slot: string;
383
+ command: string;
384
+ step: string;
385
+ outcome: string;
386
+ data?: Record<string, string>;
387
+ }): Trigger;
388
+ };
389
+ };
390
+ export * from './setup.ts';
391
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAA6D,KAAK,WAAW,EAAE,KAAK,WAAW,EAAE,KAAK,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,mBAAmB,C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