@raybase/agent-ui 0.0.2 → 0.3.2

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Itself & Co
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 all
13
+ 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 THE
21
+ SOFTWARE.
@@ -0,0 +1,403 @@
1
+ import { type ReactNode, type Ref } from "react";
2
+ import { AssistantRuntimeProvider, type ThreadMessageLike } from "@assistant-ui/react";
3
+ import { type RaybaseAgentDataChanged, type RaybaseAgentSource, type RaybaseAgentSupportRequestCreated, type RaybaseAgentTurnError } from "@raybase/core";
4
+ import { type VoiceRecording } from "./voice-recorder.js";
5
+ export type RaybaseAgentMessagePart = {
6
+ type: string;
7
+ id?: string;
8
+ text?: string;
9
+ data?: any;
10
+ [key: string]: unknown;
11
+ };
12
+ export type RaybaseAgentMessageSnapshot = {
13
+ id: string;
14
+ role: "user" | "assistant";
15
+ parts: RaybaseAgentMessagePart[];
16
+ createdAt: string;
17
+ author: {
18
+ kind: "user" | "agent" | "app";
19
+ userId: string | null;
20
+ name: string | null;
21
+ };
22
+ editedAt: string | null;
23
+ removed: boolean;
24
+ reactions: Record<string, string>;
25
+ };
26
+ export type RaybaseAgentConversationSummary = {
27
+ agentName: string;
28
+ conversationId: string;
29
+ runtime: "ai-chat";
30
+ triggerType: "chat";
31
+ title: string | null;
32
+ agentTitle: string;
33
+ route: string | null;
34
+ surface: string;
35
+ status: string;
36
+ createdAt: string;
37
+ updatedAt: string;
38
+ lastActiveAt: string;
39
+ expiresAt: string | null;
40
+ pinnedAt: string | null;
41
+ archived: boolean;
42
+ lastRunId: string | null;
43
+ lastRunStatus: string | null;
44
+ kind?: "room" | null;
45
+ lastReadAt?: string | null;
46
+ };
47
+ export type RaybaseAgentRoomPresenceMember = {
48
+ userId: string;
49
+ name: string;
50
+ connectionId: string;
51
+ joinedAt: string;
52
+ };
53
+ /**
54
+ * A closed chapter whose verbatim transcript is unavailable on the paged-in
55
+ * span — never archived, pending a redaction rewrite, or unreadable. It
56
+ * stands in for the span it covers, carrying the chapter's timespan so the
57
+ * UI can place it chronologically among messages.
58
+ */
59
+ export type RaybaseAgentChatChapterMarker = {
60
+ chapterId: string;
61
+ ordinal: number;
62
+ title: string;
63
+ summary: string;
64
+ messageCount: number;
65
+ startedAt: string;
66
+ endedAt: string;
67
+ reason: "summary-only" | "pending-rewrite" | "unavailable";
68
+ };
69
+ export type RaybaseAgentRoomMember = {
70
+ userId: string;
71
+ name: string;
72
+ role: "owner" | "member";
73
+ status: string;
74
+ joinedAt: string;
75
+ lastReadAt: string | null;
76
+ };
77
+ export type RaybaseAgentChatSnapshot = {
78
+ agentName: string;
79
+ conversationId: string | null;
80
+ conversations: RaybaseAgentConversationSummary[];
81
+ messages: RaybaseAgentMessageSnapshot[];
82
+ runs: Array<{
83
+ id: string;
84
+ status: "queued" | "running" | "completed" | "cancelled" | "failed";
85
+ }>;
86
+ currentUserId: string | null;
87
+ presence: RaybaseAgentRoomPresenceMember[];
88
+ roomMembers: RaybaseAgentRoomMember[];
89
+ voiceNotes: RaybaseAgentVoiceNotesCapability;
90
+ /** Where committed attachments are addressed from; empty when the Agent takes none. */
91
+ attachments: RaybaseAgentAttachmentsCapability;
92
+ voiceNotePending: boolean;
93
+ status: "idle" | "loading" | "ready" | "running" | "error";
94
+ isLoading: boolean;
95
+ isRunning: boolean;
96
+ /** The active run whose durable assistant message has reached this client. */
97
+ committedResponseRunId?: string | null;
98
+ /**
99
+ * False until the thread first settles — the initial `load()` resolving
100
+ * (with messages, empty, or an error), or an earlier user action that
101
+ * settles it (submit, new/open/delete conversation). Never goes back to
102
+ * false. Distinguishes "initial load not yet settled" from "settled with
103
+ * no conversation": `load()` can resume the latest server conversation
104
+ * even without a stored id, so until this is true an empty `messages`
105
+ * array says nothing about whether messages are about to arrive. Gate
106
+ * empty-state UI (greetings, prompts) on `hasLoaded` — and read it from
107
+ * this snapshot, not from thread state derived via assistant-ui's
108
+ * external-store runtime, which ingests `messages` one frame after the
109
+ * snapshot updates (a `ThreadPrimitive.Empty` empty state repaints for
110
+ * one frame when a loaded conversation arrives).
111
+ */
112
+ hasLoaded: boolean;
113
+ error: Error | null;
114
+ /** True while an archived span older than the loaded transcript remains pageable. */
115
+ hasOlder: boolean;
116
+ /** True while `loadOlder()` has a page in flight. */
117
+ loadingOlder: boolean;
118
+ /** Chapter stand-ins for spans whose verbatim transcript is unavailable. */
119
+ markers: RaybaseAgentChatChapterMarker[];
120
+ /** The last `loadOlder()` failure; cleared by the next successful page. */
121
+ olderError?: string | null;
122
+ };
123
+ export type RaybaseAgentVoiceNotesCapability = {
124
+ enabled: boolean;
125
+ maxSeconds: number;
126
+ bucket: string | null;
127
+ };
128
+ export type RaybaseAgentAttachmentsCapability = {
129
+ enabled: boolean;
130
+ bucket: string | null;
131
+ maxPerMessage: number;
132
+ mediaTypes: string[];
133
+ };
134
+ /** True only after the server has committed an assistant message to this turn. */
135
+ export declare function raybaseAgentHasCommittedResponse(snapshot: RaybaseAgentChatSnapshot): boolean;
136
+ export type RaybaseAgentChatOptions = {
137
+ agentName: string;
138
+ conversationId?: string;
139
+ route?: string;
140
+ surface?: string;
141
+ /** Stored as the conversation's title when a new conversation is created. Never sent on resume. */
142
+ initialConversationTitle?: string;
143
+ /**
144
+ * @deprecated Use `initialConversationTitle` for seeding new conversations, or the
145
+ * widget/panel `title` prop for the header label. This option read like a widget
146
+ * header label but was persisted as EVERY conversation's stored title on create
147
+ * and resume; it now only seeds newly created conversations.
148
+ */
149
+ title?: string;
150
+ baseUrl?: string;
151
+ agentBasePath?: string;
152
+ fetch?: typeof fetch;
153
+ storageKey?: string;
154
+ persistConversation?: boolean;
155
+ onDataChanged?: (event: RaybaseAgentDataChangedEvent) => void | Promise<void>;
156
+ /** Overrides the browser WebSocket constructor, primarily for custom runtimes and tests. */
157
+ webSocket?: typeof WebSocket;
158
+ };
159
+ export type RaybaseAgentDataChangedEvent = RaybaseAgentDataChanged & {
160
+ agentName: string;
161
+ conversationId: string | null;
162
+ route: string;
163
+ surface: string;
164
+ };
165
+ declare global {
166
+ interface WindowEventMap {
167
+ "raybase:data-changed": CustomEvent<RaybaseAgentDataChangedEvent>;
168
+ }
169
+ }
170
+ export type RaybaseAgentChatSubmitInput = {
171
+ message?: string;
172
+ parts?: RaybaseAgentMessagePart[];
173
+ /**
174
+ * Told the moment the server has taken the message — the 202, before any
175
+ * response part lands. `submit()` itself resolves only once the whole turn
176
+ * has settled, which is the wrong seam for a caller that sends in order:
177
+ * serialising on the returned promise makes every later send wait out the
178
+ * earlier one's model turn, so nothing the member does mid-turn reaches the
179
+ * transcript until it ends. Acceptance is where the order is already
180
+ * decided, and it is the point such a caller wants to release the next one.
181
+ */
182
+ onAccepted?: () => void;
183
+ /** Receives a send failure that happened before acceptance. */
184
+ onAcceptanceError?: (error: Error) => void;
185
+ };
186
+ export type RaybaseAgentVoiceNoteInput = Pick<VoiceRecording, "bytes" | "durationSeconds">;
187
+ export type RaybaseAgentChat = {
188
+ load(): Promise<RaybaseAgentChatSnapshot>;
189
+ connect(): Promise<RaybaseAgentChatSnapshot>;
190
+ listConversations(query?: string): Promise<RaybaseAgentConversationSummary[]>;
191
+ openConversation(conversationId: string): Promise<RaybaseAgentChatSnapshot>;
192
+ newConversation(): Promise<RaybaseAgentChatSnapshot>;
193
+ renameConversation(conversationId: string, title: string | null): Promise<RaybaseAgentChatSnapshot>;
194
+ pinConversation(conversationId: string, pinned: boolean): Promise<RaybaseAgentChatSnapshot>;
195
+ deleteConversation(conversationId?: string): Promise<RaybaseAgentChatSnapshot>;
196
+ submit(input: RaybaseAgentChatSubmitInput): Promise<RaybaseAgentChatSnapshot>;
197
+ submitVoiceNote(input: RaybaseAgentVoiceNoteInput): Promise<RaybaseAgentChatSnapshot>;
198
+ /**
199
+ * Re-runs the conversation's failed last turn server-side. The stored user
200
+ * message is not duplicated; the failed assistant message is superseded and
201
+ * hidden. Refused by the server (409) while a run is active or when the last
202
+ * turn did not fail.
203
+ */
204
+ retry(): Promise<RaybaseAgentChatSnapshot>;
205
+ cancel(runId?: string): Promise<RaybaseAgentChatSnapshot>;
206
+ /**
207
+ * Pages the next-older archived span into the front of `messages`. A no-op
208
+ * without a stored cursor, while a page is already in flight, or after
209
+ * close. Archived pages never touch the WebSocket replay cursor.
210
+ */
211
+ loadOlder(): Promise<void>;
212
+ markRead(): Promise<RaybaseAgentChatSnapshot>;
213
+ /**
214
+ * The three message changes reject with `RaybaseAgentRequestError` when they
215
+ * do not land, and leave `status`/`error` alone either way — landing does
216
+ * not clear a failed turn any more than failing declares one: a change to
217
+ * one message is the caller's to report, not the conversation's turn.
218
+ * Each resolves with the updated snapshot, or with the current one unchanged
219
+ * when there is no open conversation to change a message in.
220
+ */
221
+ editMessage(messageId: string, text: string): Promise<RaybaseAgentChatSnapshot>;
222
+ removeMessage(messageId: string): Promise<RaybaseAgentChatSnapshot>;
223
+ setReaction(messageId: string, emoji: string | null): Promise<RaybaseAgentChatSnapshot>;
224
+ close(): void;
225
+ getSnapshot(): RaybaseAgentChatSnapshot;
226
+ subscribe(listener: () => void): () => void;
227
+ };
228
+ export type RaybaseAgentRuntimeProviderProps = {
229
+ chat: RaybaseAgentChat;
230
+ children: ReactNode;
231
+ disabled?: boolean;
232
+ sendDisabled?: boolean;
233
+ };
234
+ export type RaybaseAgentPanelProps = RaybaseAgentChatOptions & {
235
+ autoFocus?: boolean;
236
+ /** Shown once the thread has settled empty (`hasLoaded` with no messages) — never during the initial load. */
237
+ emptyContent?: ReactNode;
238
+ title?: string;
239
+ placeholder?: string;
240
+ viewportClassName?: string;
241
+ };
242
+ export type RaybaseAgentWidgetLabels = {
243
+ cancel: string;
244
+ close: string;
245
+ conversationFallback: string;
246
+ conversations: string;
247
+ deleteConversation: string;
248
+ empty: string;
249
+ newConversation: string;
250
+ noConversations: string;
251
+ open: string;
252
+ placeholder: string;
253
+ send: string;
254
+ syncing: string;
255
+ thinking: string;
256
+ tryAgain: string;
257
+ };
258
+ export type RaybaseAgentWidgetProps = RaybaseAgentChatOptions & {
259
+ defaultOpen?: boolean;
260
+ enabled?: boolean;
261
+ /** Return false to hide the widget for the resolved surface and current route. */
262
+ isSurfaceEnabled?: (surface: string, route: string) => boolean;
263
+ labels?: Partial<RaybaseAgentWidgetLabels>;
264
+ open?: boolean;
265
+ onOpenChange?: (open: boolean) => void;
266
+ /** Maps the current browser route to an Agent surface hint. Defaults to "app". */
267
+ resolveSurface?: (route: string) => string;
268
+ };
269
+ /**
270
+ * A Raybase agent request that did not land. `status` is the HTTP status the
271
+ * server answered with, or 0 when the request never reached a response at all
272
+ * (offline, aborted transport, a fetch that threw).
273
+ */
274
+ export declare class RaybaseAgentRequestError extends Error {
275
+ readonly status: number;
276
+ constructor(message: string, status: number, options?: ErrorOptions);
277
+ }
278
+ export declare function createRaybaseAgentChat(options: RaybaseAgentChatOptions): RaybaseAgentChat;
279
+ export declare function useRaybaseAgentChat(options: RaybaseAgentChatOptions): RaybaseAgentChat;
280
+ export declare function useRaybaseAgentRuntime(props: RaybaseAgentRuntimeProviderProps): import("@assistant-ui/react").AssistantRuntime;
281
+ export declare function RaybaseAgentRuntimeProvider(props: RaybaseAgentRuntimeProviderProps): import("react").FunctionComponentElement<AssistantRuntimeProvider.Props>;
282
+ export declare function RaybaseAgentPanel(props: RaybaseAgentPanelProps): import("react").ReactElement<{
283
+ "data-raybase-agent": string;
284
+ }, string | import("react").JSXElementConstructor<any>>;
285
+ export declare function RaybaseAgentWidget(props: RaybaseAgentWidgetProps): import("react").FunctionComponentElement<RaybaseAgentChatOptions & {
286
+ labels: RaybaseAgentWidgetLabels;
287
+ open: boolean;
288
+ setOpen: (open: boolean) => void;
289
+ title: string;
290
+ }> | null;
291
+ export declare const RaybaseAgentFloatingWidget: typeof RaybaseAgentWidget;
292
+ type RaybaseAgentScrollbackContextValue = {
293
+ markers: RaybaseAgentChatChapterMarker[];
294
+ messages: RaybaseAgentMessageSnapshot[];
295
+ };
296
+ export declare function RaybaseAgentChatSurface(props: {
297
+ autoFocus?: boolean;
298
+ /** Shown once the thread has settled empty (`hasLoaded` with no messages) — never during the initial load. */
299
+ emptyContent?: ReactNode;
300
+ chat?: RaybaseAgentChat;
301
+ inputRef?: Ref<HTMLTextAreaElement>;
302
+ labels?: Partial<Pick<RaybaseAgentWidgetLabels, "cancel" | "send" | "syncing" | "thinking" | "tryAgain">>;
303
+ onRetry?: () => void;
304
+ onRoomRead?: () => void;
305
+ placeholder: string;
306
+ snapshot: RaybaseAgentChatSnapshot;
307
+ viewportClassName?: string;
308
+ }): import("react").FunctionComponentElement<import("react").ProviderProps<RaybaseAgentScrollbackContextValue | null>>;
309
+ export declare function isRaybaseVoiceNoteAvailable(snapshot: Pick<RaybaseAgentChatSnapshot, "voiceNotes">, recorderSupported?: boolean): boolean;
310
+ export declare function voiceNoteDurationLabel(durationSeconds: number): string;
311
+ export declare function raybaseVoiceNoteFailure(error: Error): {
312
+ retryable: boolean;
313
+ message: string;
314
+ };
315
+ export declare function isVisibleRaybaseAgentMessagePart(part: {
316
+ type: string;
317
+ }): boolean;
318
+ export declare function isRenderableRaybaseAgentMessagePart(part: RaybaseAgentMessagePart): boolean;
319
+ /** The turn-error marker of a message, or null when the message is a normal turn. */
320
+ export declare function raybaseAgentMessageTurnError(message: Pick<RaybaseAgentMessageSnapshot, "role" | "parts">): RaybaseAgentTurnError | null;
321
+ /**
322
+ * The failed last turn a "Try again" affordance should offer to retry, or null.
323
+ * Superseded failures (already retried) and mid-run snapshots never qualify —
324
+ * this is the single error surface for both live and reloaded conversations.
325
+ */
326
+ export declare function raybaseAgentRetryableTurnError(snapshot: RaybaseAgentChatSnapshot): RaybaseAgentTurnError | null;
327
+ export type RaybaseAgentVoiceNote = {
328
+ durationSeconds: number;
329
+ fileId: string;
330
+ transcript: string;
331
+ };
332
+ export declare function raybaseVoiceNoteFromParts(parts: RaybaseAgentMessagePart[]): RaybaseAgentVoiceNote | null;
333
+ /** The bucket's normal file route; it authorizes the read on its own. */
334
+ export declare function raybaseAttachmentDownloadUrl(bucket: string, fileId: string): string;
335
+ export declare function voiceNoteDownloadUrl(bucket: string, fileId: string): string;
336
+ export declare function raybaseVoiceNotePlaybackState(input: {
337
+ attachmentBucket: string | null;
338
+ durationSeconds: number;
339
+ expired: boolean;
340
+ showTranscript: boolean;
341
+ }): {
342
+ expired: boolean;
343
+ label: string;
344
+ transcriptVisible: boolean;
345
+ };
346
+ export declare function RaybaseAgentMessagePartView(props: {
347
+ part: RaybaseAgentMessagePart;
348
+ role?: RaybaseAgentMessageSnapshot["role"];
349
+ attachmentBucket?: string;
350
+ }): import("react").FunctionComponentElement<{
351
+ sources: RaybaseAgentSource[];
352
+ }> | import("react").FunctionComponentElement<{
353
+ supportRequest: RaybaseAgentSupportRequestCreated;
354
+ }> | import("react").FunctionComponentElement<{
355
+ turnError: RaybaseAgentTurnError;
356
+ }> | import("react").FunctionComponentElement<{
357
+ markdown: string;
358
+ }> | import("react").FunctionComponentElement<{
359
+ text: string;
360
+ }> | import("react").ReactElement<{
361
+ controls: boolean;
362
+ preload: string;
363
+ src: string;
364
+ }, string | import("react").JSXElementConstructor<any>> | import("react").DetailedReactHTMLElement<{
365
+ alt: string;
366
+ className: string;
367
+ loading: string;
368
+ src: string;
369
+ }, HTMLElement> | null;
370
+ export declare function RaybaseTurnErrorNotice(props: {
371
+ turnError: RaybaseAgentTurnError;
372
+ }): import("react").DetailedReactHTMLElement<{
373
+ "data-raybase-turn-error": boolean;
374
+ role: "alert";
375
+ className: string;
376
+ }, HTMLElement>;
377
+ export declare const RaybaseAgentMarkdown: import("react").NamedExoticComponent<{
378
+ markdown: string;
379
+ }>;
380
+ export declare function RaybaseAgentPlainText(props: {
381
+ text: string;
382
+ }): ReactNode;
383
+ export declare function RaybaseSourceChips(props: {
384
+ sources: RaybaseAgentSource[];
385
+ }): import("react").ReactElement<{
386
+ "data-raybase-sources": boolean;
387
+ }, string | import("react").JSXElementConstructor<any>> | null;
388
+ export declare function RaybaseSupportRequestCard(props: {
389
+ supportRequest: RaybaseAgentSupportRequestCreated;
390
+ }): import("react").ReactElement<{
391
+ "data-raybase-support-request": string;
392
+ }, string | import("react").JSXElementConstructor<any>>;
393
+ export declare function raybaseMessageToThreadMessage(message: RaybaseAgentMessageSnapshot, currentUserId?: string | null, attachmentBucket?: string | null): ThreadMessageLike;
394
+ export type RaybaseAgentThreadPartOptions = {
395
+ /** The Agent's attachment bucket; without it an image cannot be addressed. */
396
+ attachmentBucket?: string | null;
397
+ role?: RaybaseAgentMessageSnapshot["role"];
398
+ };
399
+ export declare function raybaseMessagePartsToThreadParts(parts: RaybaseAgentMessagePart[], options?: RaybaseAgentThreadPartOptions): Array<Record<string, unknown>>;
400
+ export declare function raybaseMessagePartToThreadPart(part: RaybaseAgentMessagePart, options?: RaybaseAgentThreadPartOptions): Array<Record<string, unknown>>;
401
+ export declare function snapshotMessages(snapshot: RaybaseAgentChatSnapshot): RaybaseAgentMessageSnapshot[];
402
+ export {};
403
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4I,KAAK,SAAS,EAAE,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AAC3L,OAAO,EACL,wBAAwB,EAWxB,KAAK,iBAAiB,EAEvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAKL,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,KAAK,iCAAiC,EACtC,KAAK,qBAAqB,EAC3B,MAAM,eAAe,CAAC;AAKvB,OAAO,EAKL,KAAK,cAAc,EACpB,MAAM,qBAAqB,CAAC;AAE7B,MAAM,MAAM,uBAAuB,GAAG;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,KAAK,EAAE,uBAAuB,EAAE,CAAC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC;QAC/B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;QACtB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;KACrB,CAAC;IACF,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG;IAC5C,SAAS,EAA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