@memberjunction/messaging-adapters 0.0.1 → 5.17.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.
Files changed (58) hide show
  1. package/README.md +231 -43
  2. package/dist/base/BaseMessagingAdapter.d.ts +428 -0
  3. package/dist/base/BaseMessagingAdapter.d.ts.map +1 -0
  4. package/dist/base/BaseMessagingAdapter.js +934 -0
  5. package/dist/base/BaseMessagingAdapter.js.map +1 -0
  6. package/dist/base/message-formatter.d.ts +70 -0
  7. package/dist/base/message-formatter.d.ts.map +1 -0
  8. package/dist/base/message-formatter.js +201 -0
  9. package/dist/base/message-formatter.js.map +1 -0
  10. package/dist/base/types.d.ts +211 -0
  11. package/dist/base/types.d.ts.map +1 -0
  12. package/dist/base/types.js +6 -0
  13. package/dist/base/types.js.map +1 -0
  14. package/dist/index.d.ts +72 -0
  15. package/dist/index.d.ts.map +1 -0
  16. package/dist/index.js +76 -0
  17. package/dist/index.js.map +1 -0
  18. package/dist/slack/SlackAdapter.d.ts +141 -0
  19. package/dist/slack/SlackAdapter.d.ts.map +1 -0
  20. package/dist/slack/SlackAdapter.js +291 -0
  21. package/dist/slack/SlackAdapter.js.map +1 -0
  22. package/dist/slack/SlackMessagingExtension.d.ts +148 -0
  23. package/dist/slack/SlackMessagingExtension.d.ts.map +1 -0
  24. package/dist/slack/SlackMessagingExtension.js +433 -0
  25. package/dist/slack/SlackMessagingExtension.js.map +1 -0
  26. package/dist/slack/slack-block-builder.d.ts +133 -0
  27. package/dist/slack/slack-block-builder.d.ts.map +1 -0
  28. package/dist/slack/slack-block-builder.js +748 -0
  29. package/dist/slack/slack-block-builder.js.map +1 -0
  30. package/dist/slack/slack-formatter.d.ts +37 -0
  31. package/dist/slack/slack-formatter.d.ts.map +1 -0
  32. package/dist/slack/slack-formatter.js +116 -0
  33. package/dist/slack/slack-formatter.js.map +1 -0
  34. package/dist/slack/slack-interactivity.d.ts +38 -0
  35. package/dist/slack/slack-interactivity.d.ts.map +1 -0
  36. package/dist/slack/slack-interactivity.js +414 -0
  37. package/dist/slack/slack-interactivity.js.map +1 -0
  38. package/dist/slack/slack-routes.d.ts +35 -0
  39. package/dist/slack/slack-routes.d.ts.map +1 -0
  40. package/dist/slack/slack-routes.js +98 -0
  41. package/dist/slack/slack-routes.js.map +1 -0
  42. package/dist/teams/TeamsAdapter.d.ts +155 -0
  43. package/dist/teams/TeamsAdapter.d.ts.map +1 -0
  44. package/dist/teams/TeamsAdapter.js +383 -0
  45. package/dist/teams/TeamsAdapter.js.map +1 -0
  46. package/dist/teams/TeamsMessagingExtension.d.ts +75 -0
  47. package/dist/teams/TeamsMessagingExtension.d.ts.map +1 -0
  48. package/dist/teams/TeamsMessagingExtension.js +176 -0
  49. package/dist/teams/TeamsMessagingExtension.js.map +1 -0
  50. package/dist/teams/teams-card-builder.d.ts +94 -0
  51. package/dist/teams/teams-card-builder.d.ts.map +1 -0
  52. package/dist/teams/teams-card-builder.js +648 -0
  53. package/dist/teams/teams-card-builder.js.map +1 -0
  54. package/dist/teams/teams-formatter.d.ts +39 -0
  55. package/dist/teams/teams-formatter.d.ts.map +1 -0
  56. package/dist/teams/teams-formatter.js +107 -0
  57. package/dist/teams/teams-formatter.js.map +1 -0
  58. package/package.json +40 -7
@@ -0,0 +1,428 @@
1
+ /**
2
+ * @module @memberjunction/messaging-adapters
3
+ * @description Abstract base class for messaging platform adapters.
4
+ *
5
+ * Handles the common flow: receive message -> resolve user -> fetch thread history
6
+ * -> run agent -> stream updates -> send final response.
7
+ *
8
+ * Platform subclasses (Slack, Teams) implement the abstract methods for
9
+ * platform-specific operations like sending messages and fetching threads.
10
+ */
11
+ import { ExecuteAgentResult, MJAIAgentEntityExtended } from '@memberjunction/ai-core-plus';
12
+ import { UserInfo } from '@memberjunction/core';
13
+ import { MessagingAdapterSettings, IncomingMessage, FormattedResponse, AgentIdentity, AgentResponseMetadata } from './types.js';
14
+ /**
15
+ * Abstract base class for messaging platform adapters.
16
+ *
17
+ * Handles the common orchestration flow that is shared across all messaging
18
+ * platforms (Slack, Teams, Discord, etc.):
19
+ *
20
+ * 1. Receive an incoming message
21
+ * 2. Determine if the bot should respond (DM, @mention, etc.)
22
+ * 3. Resolve the platform user to an MJ UserInfo
23
+ * 4. Show a typing/thinking indicator
24
+ * 5. Fetch thread history for conversation context
25
+ * 6. Route to the correct agent (default or @mentioned)
26
+ * 7. Run the agent via `AgentRunner.RunAgent()` with streaming
27
+ * 8. Send progressive streaming updates to the platform
28
+ * 9. Send the final formatted response
29
+ *
30
+ * Platform subclasses implement the abstract methods for platform-specific
31
+ * operations (sending messages, fetching threads, formatting responses).
32
+ *
33
+ * This class is NOT a `BaseServerExtension` itself — the platform-specific
34
+ * Extension classes (e.g., `SlackMessagingExtension`) own the Express route
35
+ * registration and delegate message handling to their adapter instance.
36
+ *
37
+ * ## Multi-Agent Routing
38
+ *
39
+ * Users can @mention different agents in different messages within the same
40
+ * thread. Each message routes to exactly one agent. If multiple agents are
41
+ * mentioned in a single message, the first one is used and a note is included
42
+ * in the response.
43
+ *
44
+ * ## Multi-Word Agent Names
45
+ *
46
+ * Agent names can be multi-word (e.g., "Research Agent"). At initialization,
47
+ * all active agents are loaded from the database. When parsing @mentions,
48
+ * known agent names are matched longest-first to avoid prefix collisions.
49
+ *
50
+ * ## User Identity Mapping
51
+ *
52
+ * The adapter resolves the platform user's email to an MJ `UserInfo` record.
53
+ * This gives proper per-user permission scoping without a separate auth flow.
54
+ * Falls back to the configured service account email if no MJ user matches.
55
+ */
56
+ export declare abstract class BaseMessagingAdapter {
57
+ /** Extension settings from `mj.config.cjs`. */
58
+ protected settings: MessagingAdapterSettings;
59
+ /** Fallback context user (service account) loaded from config email. */
60
+ protected fallbackContextUser: UserInfo | null;
61
+ /** Default agent loaded from config DefaultAgentName. */
62
+ protected defaultAgent: MJAIAgentEntityExtended | null;
63
+ /** All active agents, loaded at init for multi-word name matching. Sorted longest-name-first. */
64
+ protected availableAgents: MJAIAgentEntityExtended[];
65
+ /**
66
+ * Maps platform thread IDs to MJ Conversation IDs.
67
+ * Ensures all messages in the same Slack/Teams thread share a single MJ Conversation,
68
+ * preserving context across follow-up messages.
69
+ *
70
+ * Entries are evicted after 24 hours to prevent unbounded growth on long-running servers.
71
+ */
72
+ private threadConversationMap;
73
+ /** Max age for thread→conversation mappings (24 hours). */
74
+ private static readonly THREAD_MAP_TTL_MS;
75
+ /** Max entries in the thread map before forced eviction of oldest entries. */
76
+ private static readonly THREAD_MAP_MAX_SIZE;
77
+ constructor(settings: MessagingAdapterSettings);
78
+ /**
79
+ * Initialize the adapter: resolve the fallback context user, load the default
80
+ * MJ agent (using the fallback user as contextUser), load all available agents,
81
+ * then run platform init.
82
+ * Must be called before handling any messages.
83
+ *
84
+ * @throws Error if the configured agent or fallback user cannot be found.
85
+ */
86
+ Initialize(): Promise<void>;
87
+ /**
88
+ * Main entry point: handle an incoming message from the platform.
89
+ *
90
+ * Orchestrates the full flow from message receipt to response delivery.
91
+ * Errors are caught and reported as user-facing error messages — this
92
+ * method never throws.
93
+ *
94
+ * @param message - Normalized incoming message from the platform adapter.
95
+ */
96
+ HandleMessage(message: IncomingMessage): Promise<void>;
97
+ /**
98
+ * Get the list of available agent names, sorted longest-first.
99
+ * Useful for subclasses implementing multi-word agent name matching.
100
+ */
101
+ get AvailableAgentNames(): string[];
102
+ /**
103
+ * Platform-specific initialization (e.g., fetch bot user ID, open WebSocket).
104
+ * Called at the end of `Initialize()`.
105
+ */
106
+ protected abstract onInitialize(): Promise<void>;
107
+ /**
108
+ * Show a typing/thinking indicator in the channel.
109
+ * Some platforms (Teams) have explicit typing APIs; others (Slack) use a
110
+ * first streaming message as the "thinking" indicator.
111
+ *
112
+ * @param message - The incoming message triggering the indicator.
113
+ * @param agent - The agent that will respond (for per-agent identity).
114
+ */
115
+ protected abstract showTypingIndicator(message: IncomingMessage, agent?: MJAIAgentEntityExtended): Promise<void>;
116
+ /**
117
+ * Fetch the thread history for the given message from the platform API.
118
+ *
119
+ * @param channelId - Channel/conversation ID.
120
+ * @param threadId - Thread/reply chain ID.
121
+ * @returns Array of messages in the thread, oldest first.
122
+ */
123
+ protected abstract fetchThreadHistory(channelId: string, threadId: string): Promise<IncomingMessage[]>;
124
+ /**
125
+ * Send or update a streaming progress message. Returns the message ID.
126
+ *
127
+ * If `existingMessageId` is `null`, posts a new message.
128
+ * If `existingMessageId` is provided, updates the existing message in place.
129
+ *
130
+ * @param originalMessage - The message being responded to.
131
+ * @param currentContent - Accumulated streamed content so far.
132
+ * @param existingMessageId - ID of an existing progress message to update, or `null`.
133
+ * @param agent - The agent generating the response (for per-agent identity).
134
+ * @returns The message ID of the progress message (new or existing).
135
+ */
136
+ protected abstract sendOrUpdateStreamingMessage(originalMessage: IncomingMessage, currentContent: string, existingMessageId: string | null, agent?: MJAIAgentEntityExtended): Promise<string>;
137
+ /**
138
+ * Send the final formatted response as a new message in the thread.
139
+ */
140
+ protected abstract sendFinalMessage(originalMessage: IncomingMessage, response: FormattedResponse): Promise<void>;
141
+ /**
142
+ * Update an existing streaming message with the final formatted response.
143
+ */
144
+ protected abstract updateFinalMessage(originalMessage: IncomingMessage, messageId: string, response: FormattedResponse): Promise<void>;
145
+ /**
146
+ * Convert an agent execution result to the platform's rich format.
147
+ *
148
+ * @param result - The full agent execution result.
149
+ * @param agent - The agent that produced the result.
150
+ * @param responseText - Extracted human-readable response text.
151
+ * @param metadata - Optional metadata about the conversation/artifact for deep linking.
152
+ */
153
+ protected abstract formatResponse(result: ExecuteAgentResult | null, agent: MJAIAgentEntityExtended, responseText: string, metadata?: AgentResponseMetadata): Promise<FormattedResponse>;
154
+ /**
155
+ * Human-readable platform name (e.g., "Slack", "Teams") used in conversation names
156
+ * and log messages. Subclasses must return their platform identifier.
157
+ */
158
+ protected abstract get PlatformName(): string;
159
+ /**
160
+ * Get the bot's own user ID on this platform (to identify bot messages in thread history).
161
+ */
162
+ protected abstract getBotUserId(): string;
163
+ /**
164
+ * Strip the bot @mention from the message text so the agent sees clean input.
165
+ */
166
+ protected abstract stripBotMention(text: string): string;
167
+ /**
168
+ * Look up the email address for a platform user ID.
169
+ * Used for mapping platform identity to MJ user.
170
+ *
171
+ * @param platformUserId - Platform-specific user ID.
172
+ * @returns Email address, or `null` if not available.
173
+ */
174
+ protected abstract lookupUserEmail(platformUserId: string): Promise<string | null>;
175
+ /**
176
+ * Build an `AgentIdentity` from an agent entity.
177
+ * Only includes `IconURL` if it's a valid HTTPS URL.
178
+ */
179
+ protected buildAgentIdentity(agent: MJAIAgentEntityExtended): AgentIdentity;
180
+ /**
181
+ * Match agent names mentioned in the message text against known agents.
182
+ *
183
+ * Strips the bot's platform mention, then checks for known agent names
184
+ * preceded by `@` (case-insensitive). Names are checked longest-first
185
+ * to avoid prefix collisions (e.g., "Research Agent" before "Research").
186
+ *
187
+ * @param text - The raw message text.
188
+ * @returns Array of matched agent names.
189
+ */
190
+ protected matchAgentMentions(text: string): string[];
191
+ /**
192
+ * Match @mentions against full agent names (exact match, case-insensitive).
193
+ */
194
+ private matchExactAgentNames;
195
+ /**
196
+ * Match @mentions by first-word prefix — e.g., "@Codesmith" matches agent "Codesmith Agent".
197
+ *
198
+ * Extracts all `@word` tokens from the text and checks if any agent name starts with
199
+ * that word. Only matches if exactly one agent matches to avoid ambiguity.
200
+ */
201
+ private matchPrefixAgentNames;
202
+ /**
203
+ * Match agent names at the start of the message without an @ prefix.
204
+ *
205
+ * Handles the common Slack pattern where the user types `@Bot Marketing Agent help me`
206
+ * — the `@Bot` becomes `<@U123>` and gets stripped, leaving `Marketing Agent help me`.
207
+ * We check if the cleaned text starts with a known agent name (case-insensitive,
208
+ * longest-first to avoid prefix collisions).
209
+ */
210
+ private matchBareAgentNames;
211
+ /**
212
+ * Match agent names appearing anywhere in the message text.
213
+ *
214
+ * This is the lowest-priority matching pass. It handles cases like
215
+ * "write a blog for me marketing agent" where the agent name is at the
216
+ * end or middle of the message. Uses word boundary matching and checks
217
+ * longest names first to avoid false positives.
218
+ *
219
+ * Only returns a match if exactly one agent is found, to avoid ambiguity.
220
+ */
221
+ private matchAnywhereAgentNames;
222
+ /**
223
+ * Determine whether the bot should respond to this message.
224
+ *
225
+ * Responds to:
226
+ * - Direct messages (DMs)
227
+ * - Explicit @mentions (`app_mention` events)
228
+ * - Thread replies (any reply in a thread the bot is participating in)
229
+ *
230
+ * Thread replies are included because the bot only has threads it started
231
+ * (via slash commands or @mention responses), so a reply in such a thread
232
+ * is implicitly directed at the bot.
233
+ *
234
+ * Subclasses can override for platform-specific logic.
235
+ */
236
+ protected shouldRespond(message: IncomingMessage): boolean;
237
+ /**
238
+ * Resolve the MJ user for the platform sender.
239
+ *
240
+ * Flow:
241
+ * 1. If IncomingMessage has SenderEmail, look up in UserCache
242
+ * 2. If not, call `lookupUserEmail()` (platform API) then look up
243
+ * 3. Fall back to the configured service account
244
+ */
245
+ protected resolveContextUser(message: IncomingMessage): Promise<UserInfo>;
246
+ /**
247
+ * Resolve which agent to use for this message.
248
+ *
249
+ * Priority:
250
+ * 1. Explicit @mention in the current message
251
+ * 2. Thread affinity — if this is a reply in a thread, use the same agent
252
+ * that was originally @mentioned in the thread's first message
253
+ * 3. Fall back to the default agent from config
254
+ *
255
+ * If the mentioned agent is not found, responds with available agents.
256
+ */
257
+ protected resolveAgent(message: IncomingMessage, contextUser: UserInfo, threadHistory?: IncomingMessage[]): Promise<{
258
+ agent: MJAIAgentEntityExtended;
259
+ multiAgentNote: string | null;
260
+ }>;
261
+ /**
262
+ * Look through the thread history to find the agent that was originally invoked.
263
+ *
264
+ * Checks the first user message in the thread for @agent mentions. This provides
265
+ * thread affinity — follow-up messages in a thread continue with the same agent
266
+ * without requiring the user to @mention it again, matching MJ Explorer behavior.
267
+ *
268
+ * @returns The agent from the thread's first message, or `null` if none found.
269
+ */
270
+ private resolveThreadAgent;
271
+ /** Maximum number of delegation hops to prevent infinite loops. */
272
+ private static readonly MAX_DELEGATION_HOPS;
273
+ /**
274
+ * Execute the agent and send the response, with streaming support.
275
+ * Handles delegation automatically: when the agent returns `payload.invokeAgent`,
276
+ * the target agent is auto-executed (matching MJ Explorer behavior).
277
+ */
278
+ /**
279
+ * Get the thread key for conversation mapping.
280
+ * Uses ThreadID if in a thread, otherwise MessageID (for thread-root messages).
281
+ */
282
+ private getThreadKey;
283
+ private executeAgentAndRespond;
284
+ /**
285
+ * Run an agent within a conversation context, with streaming progress updates.
286
+ *
287
+ * Uses `AgentRunner.RunAgentInConversation()` so that:
288
+ * - An MJ Conversation is created (or reused) for the interaction
289
+ * - Artifacts are automatically created from the agent's payload
290
+ * - The artifact ID is returned for deep-linking into MJ Explorer
291
+ *
292
+ * @returns The agent result plus conversation/artifact metadata.
293
+ */
294
+ private runAgentWithStreaming;
295
+ /**
296
+ * Detect if an agent result contains a delegation request.
297
+ *
298
+ * Three detection strategies, tried in order:
299
+ * 1. `payload.invokeAgent` — formal delegation field (same as MJ Explorer)
300
+ * 2. `agentRun.FinalPayload` — serialized payload fallback (in case in-memory payload is empty)
301
+ * 3. Message text pattern matching — detects "I'll have the {Agent Name}..." phrasing
302
+ * when the agent describes delegation intent without formally setting the payload
303
+ *
304
+ * @returns The target agent name, or null if no delegation.
305
+ */
306
+ private detectDelegation;
307
+ /**
308
+ * Extract `invokeAgent` from the in-memory payload object.
309
+ */
310
+ private extractInvokeAgentFromPayload;
311
+ /**
312
+ * Extract `invokeAgent` from the serialized FinalPayload string on the agentRun.
313
+ * Fallback for cases where the in-memory payload is empty but FinalPayload was persisted.
314
+ */
315
+ private extractInvokeAgentFromFinalPayload;
316
+ /**
317
+ * Detect delegation intent from the agent's message text.
318
+ *
319
+ * Matches patterns like:
320
+ * - "I'll have the Marketing Agent write..."
321
+ * - "I'll delegate to the Research Agent..."
322
+ * - "Routing to Marketing Agent"
323
+ * - "Let me have the Codesmith Agent handle this"
324
+ *
325
+ * Only matches against known agent names from `availableAgents` to avoid false positives.
326
+ */
327
+ private extractDelegationFromMessage;
328
+ /**
329
+ * Handle agent delegation: send a delegation note, then auto-execute the target agent.
330
+ *
331
+ * Mirrors MJ Explorer's `handleSubAgentInvocation()`:
332
+ * 1. Show the delegating agent's message (e.g., "Delegating to Marketing Agent")
333
+ * 2. Find the target agent in availableAgents
334
+ * 3. Execute the target agent with the same conversation context
335
+ * 4. Send the target agent's result
336
+ *
337
+ * Supports chained delegation up to MAX_DELEGATION_HOPS.
338
+ */
339
+ private handleDelegation;
340
+ /**
341
+ * Extract response text, format it, and send the final message.
342
+ */
343
+ private sendAgentResult;
344
+ /**
345
+ * Extract the user-facing response text from an `ExecuteAgentResult`.
346
+ *
347
+ * Mirrors MJ Explorer's approach: the data model itself tells us what's user-facing.
348
+ * `agentRun.Message` is the field agents explicitly set for the user. Everything
349
+ * else (payload, FinalPayload, step outputs) is internal agent state.
350
+ *
351
+ * We do NOT mine payloads for content — that approach requires hardcoding
352
+ * agent-specific payload shapes and inevitably leaks internal LLM state
353
+ * (research plans, orchestration metadata, etc.) to the user.
354
+ *
355
+ * When `Message` is a JSON blob (some agents dump structured payloads there),
356
+ * we don't try to extract content from it. If an artifact exists, the
357
+ * "View in MJ Explorer" link handles rendering. If not, we fall through
358
+ * to a generic message rather than showing raw JSON.
359
+ *
360
+ * Fallback chain (only when Message is absent or is raw JSON):
361
+ * 1. `agentRun.Message` — the primary human-readable field (skipped if JSON)
362
+ * 2. `agentRun.Result` — simple string result (skipped if JSON)
363
+ * 3. Generic fallback message
364
+ */
365
+ private extractResponseText;
366
+ /**
367
+ * Quick check: does this string look like a JSON object or array?
368
+ * Used to avoid showing raw JSON to users when agents dump structured
369
+ * payloads into the Message field instead of human-readable text.
370
+ */
371
+ private looksLikeJSON;
372
+ /**
373
+ * Extract error text from a failed agent result.
374
+ */
375
+ private extractErrorText;
376
+ /**
377
+ * Fetch thread history with error handling. Returns empty array on failure.
378
+ */
379
+ private safeGetThreadHistory;
380
+ /**
381
+ * Show typing indicator with error handling. Failures are silently ignored.
382
+ * Now passes the resolved agent for per-agent identity on the indicator.
383
+ */
384
+ private safeShowTypingIndicator;
385
+ /**
386
+ * Convert thread history + current message into `ChatMessage[]` for `AgentRunner`.
387
+ *
388
+ * Maps platform messages to roles:
389
+ * - Messages from the bot → `assistant`
390
+ * - Messages from anyone else → `user`
391
+ *
392
+ * Bot @mentions are stripped from user messages.
393
+ */
394
+ private buildConversationMessages;
395
+ /**
396
+ * Load the default MJ agent entity from database by name.
397
+ * Matches the pattern used by the conversation UI (ConversationAgentService).
398
+ * @throws Error if the configured agent name cannot be found.
399
+ */
400
+ private loadDefaultAgent;
401
+ /**
402
+ * Load all active agents for multi-word name matching.
403
+ * Sorted longest-name-first to avoid prefix collisions.
404
+ */
405
+ private loadAvailableAgents;
406
+ /**
407
+ * Resolve the fallback context user from the configured email.
408
+ * @throws Error if the configured email cannot be found.
409
+ */
410
+ private loadFallbackContextUser;
411
+ /**
412
+ * Get a conversation ID from the thread map, respecting TTL.
413
+ */
414
+ private getThreadConversationId;
415
+ /**
416
+ * Store a conversation ID in the thread map with TTL and max-size eviction.
417
+ */
418
+ private setThreadConversationId;
419
+ /**
420
+ * Evict expired and overflow entries from the thread conversation map.
421
+ */
422
+ private evictExpiredThreadEntries;
423
+ /**
424
+ * Escape special regex characters in a string.
425
+ */
426
+ private escapeRegex;
427
+ }
428
+ //# sourceMappingURL=BaseMessagingAdapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseMessagingAdapter.d.ts","sourceRoot":"","sources":["../../src/base/BaseMessagingAdapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EAAsB,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAC/G,OAAO,EAAW,QAAQ,EAAuB,MAAM,sBAAsB,CAAC;AAE9E,OAAO,EACH,wBAAwB,EACxB,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,qBAAqB,EACxB,MAAM,YAAY,CAAC;AAiBpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;G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