@copilotkit/channels-telegram 0.0.3

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 (48) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +250 -0
  3. package/dist/adapter.d.ts +117 -0
  4. package/dist/adapter.d.ts.map +1 -0
  5. package/dist/adapter.js +584 -0
  6. package/dist/built-in-context.d.ts +22 -0
  7. package/dist/built-in-context.d.ts.map +1 -0
  8. package/dist/built-in-context.js +77 -0
  9. package/dist/built-in-tools.d.ts +23 -0
  10. package/dist/built-in-tools.d.ts.map +1 -0
  11. package/dist/built-in-tools.js +46 -0
  12. package/dist/chunked-edit-stream.d.ts +70 -0
  13. package/dist/chunked-edit-stream.d.ts.map +1 -0
  14. package/dist/chunked-edit-stream.js +197 -0
  15. package/dist/conversation-store.d.ts +56 -0
  16. package/dist/conversation-store.d.ts.map +1 -0
  17. package/dist/conversation-store.js +98 -0
  18. package/dist/download-files.d.ts +68 -0
  19. package/dist/download-files.d.ts.map +1 -0
  20. package/dist/download-files.js +157 -0
  21. package/dist/event-renderer.d.ts +39 -0
  22. package/dist/event-renderer.d.ts.map +1 -0
  23. package/dist/event-renderer.js +295 -0
  24. package/dist/format-fallback.d.ts +6 -0
  25. package/dist/format-fallback.d.ts.map +1 -0
  26. package/dist/format-fallback.js +21 -0
  27. package/dist/index.d.ts +20 -0
  28. package/dist/index.d.ts.map +1 -0
  29. package/dist/index.js +14 -0
  30. package/dist/interaction.d.ts +65 -0
  31. package/dist/interaction.d.ts.map +1 -0
  32. package/dist/interaction.js +159 -0
  33. package/dist/listener.d.ts +16 -0
  34. package/dist/listener.d.ts.map +1 -0
  35. package/dist/listener.js +419 -0
  36. package/dist/render/budget.d.ts +18 -0
  37. package/dist/render/budget.d.ts.map +1 -0
  38. package/dist/render/budget.js +24 -0
  39. package/dist/render/telegram.d.ts +11 -0
  40. package/dist/render/telegram.d.ts.map +1 -0
  41. package/dist/render/telegram.js +429 -0
  42. package/dist/telegram-html.d.ts +22 -0
  43. package/dist/telegram-html.d.ts.map +1 -0
  44. package/dist/telegram-html.js +98 -0
  45. package/dist/types.d.ts +83 -0
  46. package/dist/types.d.ts.map +1 -0
  47. package/dist/types.js +2 -0
  48. package/package.json +57 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License
2
+
3
+ Copyright (c) Atai Barkai
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,250 @@
1
+ # @copilotkit/channels-telegram
2
+
3
+ The **Telegram `PlatformAdapter`** for [`@copilotkit/channels`](../channels). It connects
4
+ a Telegram bot to any AG-UI agent: ingress via grammY (long-polling or webhook),
5
+ egress as Telegram HTML rendered from the `@copilotkit/channels-ui` JSX vocabulary,
6
+ plus streaming via chunked message edits, opaque-id interactions, and HITL.
7
+
8
+ You write your UI as JSX once (`@copilotkit/channels-ui`) and drive the bot with
9
+ `@copilotkit/channels`; this package is the only one that talks to Telegram.
10
+
11
+ ## Install
12
+
13
+ ```sh
14
+ pnpm add @copilotkit/channels-telegram @copilotkit/channels @copilotkit/channels-ui
15
+ ```
16
+
17
+ ## Quickstart
18
+
19
+ > **File must be `.tsx`** — JSX in TypeScript requires the JSX factory to be
20
+ > configured. Point it at `@copilotkit/channels-ui` in your `tsconfig.json`:
21
+ >
22
+ > ```json
23
+ > {
24
+ > "compilerOptions": {
25
+ > "jsx": "react-jsx",
26
+ > "jsxImportSource": "@copilotkit/channels-ui"
27
+ > }
28
+ > }
29
+ > ```
30
+
31
+ ```tsx
32
+ import { createBot } from "@copilotkit/channels";
33
+ import {
34
+ telegram,
35
+ defaultTelegramTools,
36
+ defaultTelegramContext,
37
+ } from "@copilotkit/channels-telegram";
38
+ import { Message, Section } from "@copilotkit/channels-ui";
39
+
40
+ const bot = createBot({
41
+ adapters: [
42
+ telegram({
43
+ token: process.env.TELEGRAM_BOT_TOKEN!,
44
+ }),
45
+ ],
46
+ agent: (threadId) => makeAgent(threadId),
47
+ tools: [...defaultTelegramTools, ...appTools], // lookup_telegram_user + your tools
48
+ context: [...defaultTelegramContext, ...appContext], // tagging/HTML/thread guidance
49
+ });
50
+
51
+ bot.onMention(({ thread }) => thread.runAgent());
52
+
53
+ // Optional: greet users when they start a DM
54
+ bot.onThreadStarted(async ({ thread }) => {
55
+ await thread.post(
56
+ <Message>
57
+ <Section>Hi! How can I help?</Section>
58
+ </Message>,
59
+ );
60
+ });
61
+
62
+ await bot.start();
63
+ ```
64
+
65
+ `telegram(opts)` returns a `TelegramAdapter`. By default it runs in
66
+ **long-polling** mode — no public URL needed. Set `mode: "webhook"` (with
67
+ `webhook.domain`) to receive updates via HTTP, or `mode: "auto"` to let the
68
+ adapter pick based on environment variables (prefers webhook in Vercel/Lambda
69
+ environments, falls back to polling).
70
+
71
+ ### Required env
72
+
73
+ | Var | Purpose |
74
+ | -------------------- | ---------------------------------------------- |
75
+ | `TELEGRAM_BOT_TOKEN` | Bot token from @BotFather (e.g. `123:ABC-xyz`) |
76
+
77
+ ## What it provides
78
+
79
+ ### JSX → Telegram HTML rendering + limits
80
+
81
+ `renderTelegram(ir)` translates the `@copilotkit/channels-ui` vocabulary to a
82
+ Telegram Bot API payload (`text`, `parseMode: "HTML"`, optional
83
+ `inlineKeyboard`, optional `photos`): `Message → container`, `Header → <b>`,
84
+ `Section/Markdown → telegramHtml()`, `Field(s) → <b>label</b> value`,
85
+ `Context → <i>`, `Actions → inline keyboard rows`, `Select → inline keyboard
86
+ rows`, `Image → photo`, `Table → <pre> monospace grid`, `Divider → ──────`.
87
+
88
+ Telegram API limits are enforced via `TELEGRAM_LIMITS` and the helpers:
89
+
90
+ | Limit | Value | Element |
91
+ | ------------------- | ----- | ------------------------------- |
92
+ | `messageText` | 4096 | characters per message |
93
+ | `caption` | 1024 | caption characters |
94
+ | `callbackData` | 64 | bytes per callback_data |
95
+ | `buttonsPerRow` | 8 | buttons per inline keyboard row |
96
+ | `buttonsPerMessage` | 100 | total inline keyboard buttons |
97
+ | `buttonText` | 64 | button label characters |
98
+ | `photosPerMessage` | 10 | photos per message |
99
+
100
+ ### Streaming via chunked edits
101
+
102
+ Replies stream through `ChunkedEditStream`: the adapter posts a placeholder
103
+ message and edits it as tokens arrive, throttled to one edit per second. When a
104
+ reply approaches Telegram's 4 096-char limit (~4 000 characters) the stream
105
+ transparently mints a second message and continues — keeping each Telegram
106
+ message within limits with no reflow of already-frozen chunk boundaries.
107
+
108
+ ### Interactions (ack-first)
109
+
110
+ Every Telegram `callback_query` (inline keyboard button click) is acked
111
+ promptly via `answerCallbackQuery` — the adapter's `ackDeadlineMs` is 3 s so
112
+ the client spinner clears quickly, well within Telegram's ~30 s validity
113
+ window for `answerCallbackQuery`. After acking, `decodeInteraction` extracts
114
+ the conversation key and minted opaque id and hands an `InteractionEvent` to
115
+ the engine. Unrelated clicks decode to events the bot harmlessly ignores.
116
+
117
+ ### HITL via ActionStore
118
+
119
+ Use `thread.awaitChoice(<Picker .../>)` to post an interactive inline keyboard
120
+ and block until a click resolves it; the resolved value is the clicked button's
121
+ callback data. Agent interrupts (`on_interrupt`) are captured by the run renderer
122
+ and dispatched to your `onInterrupt` handler, which posts a picker; the click
123
+ resumes the agent via `thread.resume(value)`.
124
+
125
+ ### `/start` → `onThreadStarted`
126
+
127
+ The listener intercepts the Telegram `/start` command in private chats and
128
+ fires `onThreadStarted`, letting the bot post a greeting or configure the
129
+ conversation before the first turn.
130
+
131
+ ### Files in/out
132
+
133
+ Inbound file attachments (photos, audio, video, documents) can be downloaded
134
+ and delivered to the agent as multimodal AG-UI content parts via
135
+ `buildFileContentParts`. The adapter can post files back out via
136
+ `thread.postFile({ bytes, filename })` (sends as a `document`).
137
+
138
+ ### Built-ins
139
+
140
+ - `defaultTelegramTools` — ships `lookup_telegram_user` so the agent can
141
+ resolve a public `@username` handle to a Telegram user id for @-mentions.
142
+ The tool calls `getChat` with the supplied query and only works for public
143
+ `@username` handles; arbitrary display-name queries are not supported and
144
+ return undefined. Spread into `tools`.
145
+ - `defaultTelegramContext` — tagging procedure, Markdown-vs-HTML guidance, and
146
+ the Telegram DM / forum-topic / group-per-user conversation model. Spread into
147
+ `context`.
148
+
149
+ ### Commands via `setMyCommands`
150
+
151
+ `registerCommands(specs)` calls `bot.api.setMyCommands`, registering the
152
+ command menu visible in the Telegram UI. The listener forwards every bot
153
+ command to the engine's `onCommand` handlers.
154
+
155
+ ## Ingress modes
156
+
157
+ | Mode | How it works |
158
+ | --------- | -------------------------------------------------------------------------------- |
159
+ | `polling` | **Default.** grammY long-polling. No public URL needed. |
160
+ | `webhook` | grammY webhook + minimal Node HTTP server. Requires `webhook.domain`. |
161
+ | `auto` | Webhook when `VERCEL`/`AWS_LAMBDA_FUNCTION_NAME`/`NETLIFY` is set, else polling. |
162
+
163
+ ## Reactions
164
+
165
+ `message_reaction` updates are enabled automatically. The adapter exports
166
+ `TELEGRAM_ALLOWED_UPDATES` (the full update-type list it subscribes to) and
167
+ passes it to grammY's long-polling `start()` call.
168
+
169
+ **Group chats:** the bot must be an **administrator** to receive
170
+ `message_reaction` events. Private chats and channels work without any
171
+ extra permissions.
172
+
173
+ **Webhook deployments:** pass the same list to `setWebhook`:
174
+
175
+ ```ts
176
+ import { TELEGRAM_ALLOWED_UPDATES } from "@copilotkit/channels-telegram";
177
+
178
+ await bot.api.setWebhook(url, {
179
+ allowed_updates: [...TELEGRAM_ALLOWED_UPDATES],
180
+ });
181
+ ```
182
+
183
+ ## What's NOT in v1
184
+
185
+ - **Modals / native form submit** — Telegram has no modal surface; multi-step
186
+ forms must be conversation-driven. `openModal` resolves `{ ok: false }` on
187
+ this adapter — the engine gates the method off because `supportsModals` is
188
+ `false`.
189
+ - **Native ephemeral messages** — Telegram has no per-user-visible messages;
190
+ `supportsEphemeral` is `false`. Use `thread.postEphemeral(user, ui, { fallbackToDM: true })`
191
+ to send a private DM as a fallback instead. **DMing requires the user to have
192
+ previously started a DM with the bot** (sent it at least one message directly);
193
+ if they have not, the DM `sendMessage` call will fail and `postEphemeral`
194
+ resolves `{ ok: false }` rather than throwing.
195
+ - **Native streaming** — Telegram has no server-push streaming; streaming is
196
+ approximated via throttled `editMessageText` calls.
197
+ - **Durable (Redis/DB) conversation store** — `TelegramConversationStore` is
198
+ in-memory; sessions and message history are lost on restart.
199
+ - **Multi-bot install** — one bot token per adapter instance.
200
+ - **`<Select>` option-value round-trip** — Telegram `callback_data` is limited
201
+ to 64 bytes. If an option's `value` or `id` serializes to more than 64 bytes
202
+ the renderer silently drops (degrades) that option — the button simply does
203
+ not appear in the keyboard. Use short `id` strings on `<Option>` elements
204
+ when option values are large objects.
205
+
206
+ ## Known limitations
207
+
208
+ - **Group conversation model** — in ordinary (non-forum) group chats the bot
209
+ keys each conversation per-user-per-group (`user:<userId>`): each member's
210
+ @mentions form one ongoing conversation for that user, and button clicks
211
+ resolve to the clicking user's conversation. The bot does **not** maintain
212
+ a single shared group thread. Forum supergroups use per-topic threads
213
+ (`topic:<threadId>`); DMs are a single flat conversation (`dm`).
214
+ - **`update()` does not change media** — editing a previously-posted message
215
+ via `thread.update(ref, ir)` calls `editMessageText` and updates text plus
216
+ inline keyboard only. Photos attached to the original message are not
217
+ changed.
218
+ - **Inbound files** — file attachments (photos, audio, video, documents) are
219
+ downloaded and delivered to the agent as multimodal AG-UI content parts.
220
+ Large files that exceed Telegram's size cap for `getFile` are skipped with
221
+ a note in their place.
222
+ - **`lookup_telegram_user` is `@username`-only** — the tool resolves public
223
+ `@username` handles by calling `getChat`. Queries that do not start with
224
+ `@` return undefined immediately; arbitrary display-name or real-name
225
+ searches are not supported.
226
+ - **Group HITL (interactive buttons) are per-user** — because non-forum group
227
+ conversations are keyed per sender, an inline-keyboard prompt posted for one
228
+ user is only resolved when _that_ user clicks it. A different group member
229
+ clicking the same button is acked but does not resolve the original user's
230
+ pending choice.
231
+ - **Concurrency** — the in-memory conversation store does not serialize
232
+ concurrent turns for the same conversation. Rapid back-to-back messages in
233
+ one conversation may interleave. This is acceptable for typical use; a
234
+ durable/locking store is out of v1 scope.
235
+
236
+ ## Exports
237
+
238
+ `telegram`, `TelegramAdapter`, `TelegramAdapterOptions`;
239
+ `createRunRenderer`, `CreateRunRendererArgs`;
240
+ `decodeInteraction`, `conversationKeyOf`, `deriveConversationKey`, `toPlatformUser`;
241
+ `renderTelegram`; `TELEGRAM_LIMITS`, `truncateText`, `clampArray`, `byteLen`;
242
+ `defaultTelegramTools`, `lookupTelegramUserTool`;
243
+ `defaultTelegramContext`, `telegramTaggingContext`, `telegramFormattingContext`,
244
+ `telegramConversationModelContext`;
245
+ `telegramHtml`, `escapeHtml`; `withTelegramFormatFallback`, `stripHtml`;
246
+ `TelegramConversationStore`; `ChunkedEditStream`, `ChunkedEditStreamConfig`;
247
+ `attachTelegramListener`, `ListenerConfig`;
248
+ `buildFileContentParts`, `TelegramFileRef`, `AgentContentPart`, `FileDeliveryConfig`;
249
+ types: `ConversationKey`, `ReplyTarget`, `TelegramMessageRef`, `TelegramInlineButton`,
250
+ `TelegramPayload`; value `DM_SCOPE`.
@@ -0,0 +1,117 @@
1
+ import { Bot } from "grammy";
2
+ import type { PlatformAdapter, SurfaceCapabilities, IngressSink, InteractionEvent, RunRenderer, ReplyTarget as BotReplyTarget, ConversationStore, MessageRef, PlatformUser, UserQuery, CommandSpec } from "@copilotkit/channels";
3
+ import type { BotNode, ThreadMessage, EmojiValue, EphemeralResult } from "@copilotkit/channels-ui";
4
+ import type { TelegramAdapterOptions, TelegramPayload } from "./types.js";
5
+ /**
6
+ * Update types that the Telegram adapter subscribes to. Includes
7
+ * `message_reaction` so the bot receives emoji-reaction events.
8
+ *
9
+ * In **group** chats the bot must be an administrator to receive
10
+ * `message_reaction` updates; private chats and channels work without
11
+ * additional permissions.
12
+ *
13
+ * For **webhook** deployments pass this list to `setWebhook`:
14
+ * ```ts
15
+ * await bot.api.setWebhook(url, { allowed_updates: [...TELEGRAM_ALLOWED_UPDATES] });
16
+ * ```
17
+ * Long-polling (`start()`) passes it automatically.
18
+ */
19
+ export declare const TELEGRAM_ALLOWED_UPDATES: readonly ["message", "edited_message", "callback_query", "message_reaction"];
20
+ /**
21
+ * Telegram `PlatformAdapter`: ingress via grammY (long-polling or webhook),
22
+ * egress via the package's HTML renderer + chunked-edit streaming.
23
+ *
24
+ * Construction is side-effect-free — the grammY {@link Bot} is created but no
25
+ * network call is made until {@link start} (which owns `getMe` + ingress).
26
+ */
27
+ export declare class TelegramAdapter implements PlatformAdapter {
28
+ private readonly opts;
29
+ readonly platform = "telegram";
30
+ readonly capabilities: SurfaceCapabilities;
31
+ readonly ackDeadlineMs = 3000;
32
+ /** Public/assignable so tests can inject a fake (`adapter.bot = fake`). */
33
+ bot: Bot;
34
+ botUsername: string;
35
+ botUserId: number;
36
+ private readonly store;
37
+ /** In webhook mode, the Node HTTP server standing up the webhook endpoint. */
38
+ private webhookServer?;
39
+ constructor(opts: TelegramAdapterOptions);
40
+ /** Greeting text to post on conversation start (wired by the example's onThreadStarted). */
41
+ get greeting(): string | undefined;
42
+ /** Suggested prompt chips to surface on conversation start. */
43
+ get suggestedPrompts(): {
44
+ title: string;
45
+ message: string;
46
+ }[] | undefined;
47
+ start(sink: IngressSink): Promise<void>;
48
+ /** Resolve the effective ingress mode, expanding "auto" by environment. */
49
+ private resolveMode;
50
+ /**
51
+ * Register the webhook with Telegram and stand up a minimal Node HTTP server
52
+ * that feeds updates to grammY via {@link webhookCallback}. Requires
53
+ * `opts.webhook.domain`.
54
+ */
55
+ private startWebhook;
56
+ stop(): Promise<void>;
57
+ render(ir: BotNode[]): TelegramPayload;
58
+ post(target: BotReplyTarget, ir: BotNode[]): Promise<MessageRef>;
59
+ update(ref: MessageRef, ir: BotNode[]): Promise<void>;
60
+ stream(target: BotReplyTarget, chunks: AsyncIterable<string>): Promise<MessageRef>;
61
+ delete(ref: MessageRef): Promise<void>;
62
+ createRunRenderer(target: BotReplyTarget): RunRenderer;
63
+ decodeInteraction(raw: unknown): InteractionEvent | undefined;
64
+ lookupUser(q: UserQuery): Promise<PlatformUser | undefined>;
65
+ get conversationStore(): ConversationStore;
66
+ getMessages(target: BotReplyTarget): Promise<ThreadMessage[]>;
67
+ postFile(target: BotReplyTarget, { bytes, filename, }: {
68
+ bytes: Uint8Array;
69
+ filename: string;
70
+ title?: string;
71
+ altText?: string;
72
+ }): Promise<{
73
+ ok: boolean;
74
+ fileId?: string;
75
+ error?: string;
76
+ }>;
77
+ registerCommands(specs: readonly CommandSpec[]): Promise<void>;
78
+ setThreadTitle(target: BotReplyTarget, title: string): Promise<{
79
+ ok: boolean;
80
+ error?: string;
81
+ }>;
82
+ addReaction(target: BotReplyTarget, messageRef: MessageRef, emoji: EmojiValue): Promise<{
83
+ ok: boolean;
84
+ error?: string;
85
+ }>;
86
+ removeReaction(target: BotReplyTarget, messageRef: MessageRef, _emoji: EmojiValue): Promise<{
87
+ ok: boolean;
88
+ error?: string;
89
+ }>;
90
+ postEphemeral(_target: BotReplyTarget, user: PlatformUser | string, ir: BotNode[], opts: {
91
+ fallbackToDM: boolean;
92
+ }): Promise<EphemeralResult | null>;
93
+ setSuggestedPrompts(_target: BotReplyTarget, _prompts: ReadonlyArray<{
94
+ title: string;
95
+ message: string;
96
+ }>, _opts?: {
97
+ title?: string;
98
+ }): Promise<{
99
+ ok: boolean;
100
+ error?: string;
101
+ }>;
102
+ /**
103
+ * Return the store's conversation key for a {@link ReplyTarget}.
104
+ *
105
+ * Prefers the `conversationKey` field stamped at ingress (by the listener or
106
+ * `decodeInteraction`), which carries the exact key used for the live
107
+ * conversation — including the `user:<id>` scope that non-forum group chats
108
+ * require. Falls back to a best-effort derivation (covers DMs and forum
109
+ * topics, but cannot reproduce `user:` for plain group chats).
110
+ */
111
+ private conversationKeyForTarget;
112
+ /** Map the renderer's inline keyboard to grammY's `reply_markup` shape. */
113
+ private toReplyMarkup;
114
+ }
115
+ /** Construct a Telegram `PlatformAdapter`. */
116
+ export declare function telegram(opts: TelegramAdapterOptions): TelegramAdapter;
117
+ //# sourceMappingURL=adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAa,MAAM,QAAQ,CAAC;AAExC,OAAO,KAAK,EACV,eAAe,EACf,mBAAmB,EACnB,WAAW,EACX,gBAAgB,EAChB,WAAW,EACX,WAAW,IAAI,cAAc,EAC7B,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,SAAS,EACT,WAAW,EACZ,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EACV,OAAO,EACP,aAAa,EACb,UAAU,EACV,eAAe,EAChB,MAAM,yBAAyB,CAAC;AAWjC,OAAO,KAAK,EAGV,sBAAsB,EAGtB,eAAe,EAChB,MAAM,YAAY,CAAC;AAEpB;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,wBAAwB,8EAK3B,CAAC;AAEX;;;;;;GAMG;AACH,qBAAa,eA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