@uraiagent/react 0.0.5 → 0.0.7

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.
@@ -7,6 +7,15 @@ export type Meta = {
7
7
  has_next: boolean;
8
8
  has_previous: boolean;
9
9
  };
10
+ /** A file attached to a message (uploaded via POST /chat/upload). `url` is a permanent public URL
11
+ * (object stored public-read under an unguessable randomized key). */
12
+ export type AttachmentRef = {
13
+ id: string;
14
+ url: string;
15
+ filename: string;
16
+ mimeType: string;
17
+ size: number;
18
+ };
10
19
  export type AgentMessageProps<TData = Record<string, unknown>> = {
11
20
  _id: string;
12
21
  from: "agent";
@@ -14,20 +23,14 @@ export type AgentMessageProps<TData = Record<string, unknown>> = {
14
23
  data: TData;
15
24
  senderName?: string;
16
25
  senderAvatarUrl?: string;
17
- attachement?: {
18
- type: string;
19
- value: string;
20
- };
26
+ attachments?: AttachmentRef[];
21
27
  createdAt: string;
22
28
  };
23
29
  export type UserMessageProps = {
24
30
  _id: string;
25
31
  from: "user";
26
32
  message: string;
27
- attachement?: {
28
- type: string;
29
- value: string;
30
- };
33
+ attachments?: AttachmentRef[];
31
34
  createdAt: string;
32
35
  };
33
36
  export type EventMessageProps<TData = Record<string, unknown>> = {
@@ -2,6 +2,8 @@ import { FormFieldType } from '../interfaces/form';
2
2
  import { default as json } from '../../../package.json';
3
3
  import { z } from 'zod';
4
4
  export declare const isServer: boolean;
5
+ /** Up-to-two-letter initials from a display name (first + last word), for avatar fallbacks. */
6
+ export declare const initials: (name?: string) => string;
5
7
  declare const isEmpty: (value: string | object | any[] | undefined) => boolean;
6
8
  declare const getLast: <T>(arr: T[]) => T | undefined;
7
9
  declare const get: <K extends keyof typeof json>(key: K) => {