@sympoies/dsh-telegram 0.0.0-bootstrap.0 → 0.6.1
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/LICENSE +1 -2
- package/NOTICE +19 -0
- package/README.md +588 -2
- package/cordis.patch.yml +14 -0
- package/lib/access.d.ts +76 -0
- package/lib/access.d.ts.map +1 -0
- package/lib/access.js +137 -0
- package/lib/access.js.map +1 -0
- package/lib/client.js +835 -0
- package/lib/commands.d.ts +51 -0
- package/lib/commands.d.ts.map +1 -0
- package/lib/commands.js +83 -0
- package/lib/commands.js.map +1 -0
- package/lib/config.d.ts +125 -0
- package/lib/config.d.ts.map +1 -0
- package/lib/config.js +97 -0
- package/lib/config.js.map +1 -0
- package/lib/diagnostics.d.ts +58 -0
- package/lib/diagnostics.d.ts.map +1 -0
- package/lib/diagnostics.js +59 -0
- package/lib/diagnostics.js.map +1 -0
- package/lib/failures.d.ts +71 -0
- package/lib/failures.d.ts.map +1 -0
- package/lib/failures.js +139 -0
- package/lib/failures.js.map +1 -0
- package/lib/harness/host.d.ts +106 -0
- package/lib/harness/host.d.ts.map +1 -0
- package/lib/harness/host.js +142 -0
- package/lib/harness/host.js.map +1 -0
- package/lib/harness/message.d.ts +45 -0
- package/lib/harness/message.d.ts.map +1 -0
- package/lib/harness/message.js +28 -0
- package/lib/harness/message.js.map +1 -0
- package/lib/harness/model-selection.d.ts +82 -0
- package/lib/harness/model-selection.d.ts.map +1 -0
- package/lib/harness/model-selection.js +103 -0
- package/lib/harness/model-selection.js.map +1 -0
- package/lib/harness/questions-seam.d.ts +34 -0
- package/lib/harness/questions-seam.d.ts.map +1 -0
- package/lib/harness/questions-seam.js +45 -0
- package/lib/harness/questions-seam.js.map +1 -0
- package/lib/harness/types.d.ts +108 -0
- package/lib/harness/types.d.ts.map +1 -0
- package/lib/harness/types.js +23 -0
- package/lib/harness/types.js.map +1 -0
- package/lib/index.d.ts +65 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +977 -0
- package/lib/index.js.map +1 -0
- package/lib/interact/approvals.d.ts +59 -0
- package/lib/interact/approvals.d.ts.map +1 -0
- package/lib/interact/approvals.js +132 -0
- package/lib/interact/approvals.js.map +1 -0
- package/lib/interact/pending.d.ts +56 -0
- package/lib/interact/pending.d.ts.map +1 -0
- package/lib/interact/pending.js +89 -0
- package/lib/interact/pending.js.map +1 -0
- package/lib/interact/questions.d.ts +100 -0
- package/lib/interact/questions.d.ts.map +1 -0
- package/lib/interact/questions.js +255 -0
- package/lib/interact/questions.js.map +1 -0
- package/lib/interact/surface.d.ts +33 -0
- package/lib/interact/surface.d.ts.map +1 -0
- package/lib/interact/surface.js +39 -0
- package/lib/interact/surface.js.map +1 -0
- package/lib/interact/text-capture.d.ts +38 -0
- package/lib/interact/text-capture.d.ts.map +1 -0
- package/lib/interact/text-capture.js +75 -0
- package/lib/interact/text-capture.js.map +1 -0
- package/lib/media/collect.d.ts +157 -0
- package/lib/media/collect.d.ts.map +1 -0
- package/lib/media/collect.js +235 -0
- package/lib/media/collect.js.map +1 -0
- package/lib/media/extractor.d.ts +117 -0
- package/lib/media/extractor.d.ts.map +1 -0
- package/lib/media/extractor.js +207 -0
- package/lib/media/extractor.js.map +1 -0
- package/lib/media/intake.d.ts +57 -0
- package/lib/media/intake.d.ts.map +1 -0
- package/lib/media/intake.js +115 -0
- package/lib/media/intake.js.map +1 -0
- package/lib/media/limits.d.ts +69 -0
- package/lib/media/limits.d.ts.map +1 -0
- package/lib/media/limits.js +97 -0
- package/lib/media/limits.js.map +1 -0
- package/lib/media/ocr.d.ts +66 -0
- package/lib/media/ocr.d.ts.map +1 -0
- package/lib/media/ocr.js +131 -0
- package/lib/media/ocr.js.map +1 -0
- package/lib/media/screenshot.d.ts +57 -0
- package/lib/media/screenshot.d.ts.map +1 -0
- package/lib/media/screenshot.js +101 -0
- package/lib/media/screenshot.js.map +1 -0
- package/lib/media/vision.d.ts +60 -0
- package/lib/media/vision.d.ts.map +1 -0
- package/lib/media/vision.js +74 -0
- package/lib/media/vision.js.map +1 -0
- package/lib/render/clamp.d.ts +34 -0
- package/lib/render/clamp.d.ts.map +1 -0
- package/lib/render/clamp.js +65 -0
- package/lib/render/clamp.js.map +1 -0
- package/lib/render/escape.d.ts +15 -0
- package/lib/render/escape.d.ts.map +1 -0
- package/lib/render/escape.js +17 -0
- package/lib/render/escape.js.map +1 -0
- package/lib/reply/activity.d.ts +31 -0
- package/lib/reply/activity.d.ts.map +1 -0
- package/lib/reply/activity.js +88 -0
- package/lib/reply/activity.js.map +1 -0
- package/lib/reply/rich-stream.d.ts +173 -0
- package/lib/reply/rich-stream.d.ts.map +1 -0
- package/lib/reply/rich-stream.js +286 -0
- package/lib/reply/rich-stream.js.map +1 -0
- package/lib/reply/split-markdown.d.ts +21 -0
- package/lib/reply/split-markdown.d.ts.map +1 -0
- package/lib/reply/split-markdown.js +87 -0
- package/lib/reply/split-markdown.js.map +1 -0
- package/lib/reply/turn-bridge.d.ts +143 -0
- package/lib/reply/turn-bridge.d.ts.map +1 -0
- package/lib/reply/turn-bridge.js +182 -0
- package/lib/reply/turn-bridge.js.map +1 -0
- package/lib/router.d.ts +415 -0
- package/lib/router.d.ts.map +1 -0
- package/lib/router.js +663 -0
- package/lib/router.js.map +1 -0
- package/lib/secrets.d.ts +30 -0
- package/lib/secrets.d.ts.map +1 -0
- package/lib/secrets.js +51 -0
- package/lib/secrets.js.map +1 -0
- package/lib/session/bindings.d.ts +81 -0
- package/lib/session/bindings.d.ts.map +1 -0
- package/lib/session/bindings.js +170 -0
- package/lib/session/bindings.js.map +1 -0
- package/lib/session/history.d.ts +50 -0
- package/lib/session/history.d.ts.map +1 -0
- package/lib/session/history.js +127 -0
- package/lib/session/history.js.map +1 -0
- package/lib/session/models.d.ts +99 -0
- package/lib/session/models.d.ts.map +1 -0
- package/lib/session/models.js +123 -0
- package/lib/session/models.js.map +1 -0
- package/lib/session/permission.d.ts +83 -0
- package/lib/session/permission.d.ts.map +1 -0
- package/lib/session/permission.js +107 -0
- package/lib/session/permission.js.map +1 -0
- package/lib/session/picker.d.ts +49 -0
- package/lib/session/picker.d.ts.map +1 -0
- package/lib/session/picker.js +107 -0
- package/lib/session/picker.js.map +1 -0
- package/lib/session/preferences.d.ts +55 -0
- package/lib/session/preferences.d.ts.map +1 -0
- package/lib/session/preferences.js +102 -0
- package/lib/session/preferences.js.map +1 -0
- package/lib/session/recovery.d.ts +66 -0
- package/lib/session/recovery.d.ts.map +1 -0
- package/lib/session/recovery.js +112 -0
- package/lib/session/recovery.js.map +1 -0
- package/lib/session/runner.d.ts +223 -0
- package/lib/session/runner.d.ts.map +1 -0
- package/lib/session/runner.js +260 -0
- package/lib/session/runner.js.map +1 -0
- package/lib/session/workspaces.d.ts +28 -0
- package/lib/session/workspaces.d.ts.map +1 -0
- package/lib/session/workspaces.js +53 -0
- package/lib/session/workspaces.js.map +1 -0
- package/lib/telegram/addressing.d.ts +39 -0
- package/lib/telegram/addressing.d.ts.map +1 -0
- package/lib/telegram/addressing.js +81 -0
- package/lib/telegram/addressing.js.map +1 -0
- package/lib/telegram/albums.d.ts +46 -0
- package/lib/telegram/albums.d.ts.map +1 -0
- package/lib/telegram/albums.js +104 -0
- package/lib/telegram/albums.js.map +1 -0
- package/lib/telegram/api.d.ts +238 -0
- package/lib/telegram/api.d.ts.map +1 -0
- package/lib/telegram/api.js +518 -0
- package/lib/telegram/api.js.map +1 -0
- package/lib/telegram/poller.d.ts +59 -0
- package/lib/telegram/poller.d.ts.map +1 -0
- package/lib/telegram/poller.js +94 -0
- package/lib/telegram/poller.js.map +1 -0
- package/lib/telegram/types.d.ts +130 -0
- package/lib/telegram/types.d.ts.map +1 -0
- package/lib/telegram/types.js +9 -0
- package/lib/telegram/types.js.map +1 -0
- package/lib/telegram/typing.d.ts +47 -0
- package/lib/telegram/typing.d.ts.map +1 -0
- package/lib/telegram/typing.js +91 -0
- package/lib/telegram/typing.js.map +1 -0
- package/lib/versions.d.ts +63 -0
- package/lib/versions.d.ts.map +1 -0
- package/lib/versions.js +135 -0
- package/lib/versions.js.map +1 -0
- package/package.json +94 -10
package/lib/access.d.ts
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Who is allowed to drive the agent.
|
|
3
|
+
*
|
|
4
|
+
* This is the plugin's most security-sensitive decision. A Telegram bot is
|
|
5
|
+
* reachable by anyone who knows its handle, and the agent behind it can run
|
|
6
|
+
* shell commands on the operator's machine. So the default is closed: an
|
|
7
|
+
* unconfigured bot answers nobody until it is claimed once, with a code that
|
|
8
|
+
* is printed to the operator's own console and never sent over Telegram.
|
|
9
|
+
*
|
|
10
|
+
* Ownership is durable and single-shot. Once claimed, a later claim — even
|
|
11
|
+
* with the right code — is refused, so a code that leaks after the fact grants
|
|
12
|
+
* nothing.
|
|
13
|
+
*/
|
|
14
|
+
/** The three answers to "may this user talk to the agent?". */
|
|
15
|
+
export type AccessDecision =
|
|
16
|
+
/** On the allowlist, or the recorded owner. */
|
|
17
|
+
'allowed'
|
|
18
|
+
/** Someone else owns this bot, or an allowlist excludes this user. */
|
|
19
|
+
| 'denied'
|
|
20
|
+
/** Nobody owns the bot yet; this user may claim it with the code. */
|
|
21
|
+
| 'unclaimed';
|
|
22
|
+
/** Construction options. */
|
|
23
|
+
export interface AccessPolicyOptions {
|
|
24
|
+
/** Telegram user ids admitted without claiming. Empty enables the claim flow. */
|
|
25
|
+
readonly allowFrom: readonly number[];
|
|
26
|
+
/** The one-time code that transfers ownership; printed to the operator's console. */
|
|
27
|
+
readonly claimCode: string;
|
|
28
|
+
/**
|
|
29
|
+
* Where to also drop the claim code while the bot is unowned.
|
|
30
|
+
*
|
|
31
|
+
* The console is not always readable — a harness started detached, or a
|
|
32
|
+
* profile whose logger has no console sink, swallows it — and a claim code
|
|
33
|
+
* nobody can read makes the bot permanently unusable. The file is written
|
|
34
|
+
* owner-only and removed the moment the bot is claimed.
|
|
35
|
+
*/
|
|
36
|
+
readonly claimCodeFile?: string;
|
|
37
|
+
}
|
|
38
|
+
export declare class AccessPolicy {
|
|
39
|
+
private readonly file;
|
|
40
|
+
private readonly options;
|
|
41
|
+
private ownerId;
|
|
42
|
+
private constructor();
|
|
43
|
+
/**
|
|
44
|
+
* Load recorded ownership, or start unowned.
|
|
45
|
+
*
|
|
46
|
+
* @param file - absolute path to the ownership record.
|
|
47
|
+
* @param options - allowlist and this process's claim code.
|
|
48
|
+
*/
|
|
49
|
+
static open(file: string, options: AccessPolicyOptions): Promise<AccessPolicy>;
|
|
50
|
+
/**
|
|
51
|
+
* Decide whether a user may drive the agent.
|
|
52
|
+
*
|
|
53
|
+
* @param userId - the Telegram user id from the update.
|
|
54
|
+
*/
|
|
55
|
+
check(userId: number): AccessDecision;
|
|
56
|
+
/** The recorded owner, when the bot has been claimed. */
|
|
57
|
+
owner(): number | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Take ownership of an unowned bot.
|
|
60
|
+
*
|
|
61
|
+
* @param userId - the claiming Telegram user.
|
|
62
|
+
* @param code - the code they supplied, from an untrusted message.
|
|
63
|
+
* @returns whether ownership was transferred.
|
|
64
|
+
*/
|
|
65
|
+
claim(userId: number, code: string): Promise<boolean>;
|
|
66
|
+
/**
|
|
67
|
+
* Drop the claim code where the operator can read it, while it is still
|
|
68
|
+
* needed. Owner-only permissions: anyone who can read it can take the bot.
|
|
69
|
+
*/
|
|
70
|
+
private publishClaimCode;
|
|
71
|
+
/** Remove the published code; it grants nothing now and should not linger. */
|
|
72
|
+
private retractClaimCode;
|
|
73
|
+
/** Record ownership atomically. */
|
|
74
|
+
private persist;
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=access.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"access.d.ts","sourceRoot":"","sources":["../src/access.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAMH,+DAA+D;AAC/D,MAAM,MAAM,cAAc;AACxB,+CAA+C;AAC7C,SAAS;AACX,sEAAsE;GACpE,QAAQ;AACV,qEAAqE;GACnE,WAAW,CAAA;AAEf,4BAA4B;AAC5B,MAAM,WAAW,mBAAmB;IAClC,iFAAiF;IACjF,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAA;IACrC,qFAAqF;IACrF,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B;;;;;;;OAOG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAChC;AAED,qBAAa,YAAY;IAIrB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAJ1B,OAAO,CAAC,OAAO,CAAoB;IAEnC,OAAO;IAKP;;;;;OAKG;WACU,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,YAAY,CAAC;IAOpF;;;;OAIG;IACH,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc;IAQrC,yDAAyD;IACzD,KAAK,IAAI,MAAM,GAAG,SAAS;IAI3B;;;;;;OAMG;IACG,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAW3D;;;OAGG;YACW,gBAAgB;IAoB9B,8EAA8E;YAChE,gBAAgB;IAM9B,mCAAmC;YACrB,OAAO;CAQtB"}
|
package/lib/access.js
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Who is allowed to drive the agent.
|
|
3
|
+
*
|
|
4
|
+
* This is the plugin's most security-sensitive decision. A Telegram bot is
|
|
5
|
+
* reachable by anyone who knows its handle, and the agent behind it can run
|
|
6
|
+
* shell commands on the operator's machine. So the default is closed: an
|
|
7
|
+
* unconfigured bot answers nobody until it is claimed once, with a code that
|
|
8
|
+
* is printed to the operator's own console and never sent over Telegram.
|
|
9
|
+
*
|
|
10
|
+
* Ownership is durable and single-shot. Once claimed, a later claim — even
|
|
11
|
+
* with the right code — is refused, so a code that leaks after the fact grants
|
|
12
|
+
* nothing.
|
|
13
|
+
*/
|
|
14
|
+
import { timingSafeEqual } from 'node:crypto';
|
|
15
|
+
import { mkdir, readFile, rename, rm, writeFile } from 'node:fs/promises';
|
|
16
|
+
import { dirname } from 'node:path';
|
|
17
|
+
export class AccessPolicy {
|
|
18
|
+
file;
|
|
19
|
+
options;
|
|
20
|
+
ownerId;
|
|
21
|
+
constructor(file, options) {
|
|
22
|
+
this.file = file;
|
|
23
|
+
this.options = options;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Load recorded ownership, or start unowned.
|
|
27
|
+
*
|
|
28
|
+
* @param file - absolute path to the ownership record.
|
|
29
|
+
* @param options - allowlist and this process's claim code.
|
|
30
|
+
*/
|
|
31
|
+
static async open(file, options) {
|
|
32
|
+
const policy = new AccessPolicy(file, options);
|
|
33
|
+
policy.ownerId = await readOwner(file);
|
|
34
|
+
await policy.publishClaimCode();
|
|
35
|
+
return policy;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Decide whether a user may drive the agent.
|
|
39
|
+
*
|
|
40
|
+
* @param userId - the Telegram user id from the update.
|
|
41
|
+
*/
|
|
42
|
+
check(userId) {
|
|
43
|
+
if (this.options.allowFrom.includes(userId))
|
|
44
|
+
return 'allowed';
|
|
45
|
+
if (this.ownerId === userId)
|
|
46
|
+
return 'allowed';
|
|
47
|
+
if (this.ownerId !== undefined)
|
|
48
|
+
return 'denied';
|
|
49
|
+
if (this.options.allowFrom.length > 0)
|
|
50
|
+
return 'denied';
|
|
51
|
+
return 'unclaimed';
|
|
52
|
+
}
|
|
53
|
+
/** The recorded owner, when the bot has been claimed. */
|
|
54
|
+
owner() {
|
|
55
|
+
return this.ownerId;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Take ownership of an unowned bot.
|
|
59
|
+
*
|
|
60
|
+
* @param userId - the claiming Telegram user.
|
|
61
|
+
* @param code - the code they supplied, from an untrusted message.
|
|
62
|
+
* @returns whether ownership was transferred.
|
|
63
|
+
*/
|
|
64
|
+
async claim(userId, code) {
|
|
65
|
+
if (this.ownerId !== undefined)
|
|
66
|
+
return false;
|
|
67
|
+
if (this.options.allowFrom.length > 0)
|
|
68
|
+
return false;
|
|
69
|
+
if (!matches(code, this.options.claimCode))
|
|
70
|
+
return false;
|
|
71
|
+
this.ownerId = userId;
|
|
72
|
+
await this.persist();
|
|
73
|
+
await this.retractClaimCode();
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Drop the claim code where the operator can read it, while it is still
|
|
78
|
+
* needed. Owner-only permissions: anyone who can read it can take the bot.
|
|
79
|
+
*/
|
|
80
|
+
async publishClaimCode() {
|
|
81
|
+
const path = this.options.claimCodeFile;
|
|
82
|
+
if (path === undefined)
|
|
83
|
+
return;
|
|
84
|
+
if (this.ownerId !== undefined || this.options.allowFrom.length > 0) {
|
|
85
|
+
return await this.retractClaimCode();
|
|
86
|
+
}
|
|
87
|
+
try {
|
|
88
|
+
await mkdir(dirname(path), { recursive: true });
|
|
89
|
+
await writeFile(path, `Send this to your bot to take ownership of it:\n\n /claim ${this.options.claimCode}\n\n` +
|
|
90
|
+
`It changes on every restart, and this file disappears once the bot is claimed.\n`, { encoding: 'utf8', mode: 0o600 });
|
|
91
|
+
}
|
|
92
|
+
catch {
|
|
93
|
+
// Best effort: the log still carries the code.
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
/** Remove the published code; it grants nothing now and should not linger. */
|
|
97
|
+
async retractClaimCode() {
|
|
98
|
+
const path = this.options.claimCodeFile;
|
|
99
|
+
if (path === undefined)
|
|
100
|
+
return;
|
|
101
|
+
await rm(path, { force: true }).catch(() => undefined);
|
|
102
|
+
}
|
|
103
|
+
/** Record ownership atomically. */
|
|
104
|
+
async persist() {
|
|
105
|
+
const temporary = `${this.file}.${process.pid}.tmp`;
|
|
106
|
+
const document = { ownerId: this.ownerId, claimedAt: Date.now() };
|
|
107
|
+
await mkdir(dirname(this.file), { recursive: true });
|
|
108
|
+
await writeFile(temporary, `${JSON.stringify(document, undefined, 2)}\n`, 'utf8');
|
|
109
|
+
await rename(temporary, this.file);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Constant-time comparison of a supplied code against the expected one.
|
|
114
|
+
* Lengths are compared through the same path so a wrong length leaks no more
|
|
115
|
+
* than a wrong byte does.
|
|
116
|
+
*/
|
|
117
|
+
function matches(supplied, expected) {
|
|
118
|
+
const a = Buffer.from(supplied);
|
|
119
|
+
const b = Buffer.from(expected);
|
|
120
|
+
if (a.length !== b.length) {
|
|
121
|
+
// Still do the work, so timing does not distinguish "wrong length".
|
|
122
|
+
timingSafeEqual(b, b);
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
return timingSafeEqual(a, b);
|
|
126
|
+
}
|
|
127
|
+
/** Read the recorded owner, treating anything unreadable as unowned. */
|
|
128
|
+
async function readOwner(file) {
|
|
129
|
+
try {
|
|
130
|
+
const parsed = JSON.parse(await readFile(file, 'utf8'));
|
|
131
|
+
return typeof parsed.ownerId === 'number' ? parsed.ownerId : undefined;
|
|
132
|
+
}
|
|
133
|
+
catch {
|
|
134
|
+
return undefined;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=access.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"access.js","sourceRoot":"","sources":["../src/access.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AA4BnC,MAAM,OAAO,YAAY;IAIJ;IACA;IAJX,OAA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