@shadowob/shared
Advanced tools
| // src/constants/events.ts | ||
| var CLIENT_EVENTS = { | ||
| CHANNEL_JOIN: "channel:join", | ||
| CHANNEL_LEAVE: "channel:leave", | ||
| MESSAGE_SEND: "message:send", | ||
| MESSAGE_TYPING: "message:typing", | ||
| PRESENCE_UPDATE: "presence:update", | ||
| VOICE_JOIN: "voice:join", | ||
| VOICE_LEAVE: "voice:leave", | ||
| VOICE_STATE_UPDATE: "voice:state:update", | ||
| VOICE_TOKEN_RENEW: "voice:token:renew", | ||
| VOICE_HEARTBEAT: "voice:heartbeat" | ||
| }; | ||
| var SERVER_EVENTS = { | ||
| MESSAGE_NEW: "message:new", | ||
| MESSAGE_UPDATE: "message:update", | ||
| MESSAGE_DELETE: "message:delete", | ||
| MEMBER_TYPING: "member:typing", | ||
| MEMBER_JOIN: "member:join", | ||
| MEMBER_LEAVE: "member:leave", | ||
| PRESENCE_CHANGE: "presence:change", | ||
| REACTION_ADD: "reaction:add", | ||
| REACTION_REMOVE: "reaction:remove", | ||
| NOTIFICATION_NEW: "notification:new", | ||
| VOICE_STATE: "voice:state", | ||
| VOICE_PARTICIPANT_JOINED: "voice:participant-joined", | ||
| VOICE_PARTICIPANT_LEFT: "voice:participant-left", | ||
| VOICE_PARTICIPANT_UPDATED: "voice:participant-updated", | ||
| VOICE_POLICY_UPDATED: "voice:policy-updated" | ||
| }; | ||
| // src/constants/limits.ts | ||
| var LIMITS = { | ||
| /** Max message content length (16KB — enough for detailed agent responses) */ | ||
| MESSAGE_CONTENT_MAX: 16e3, | ||
| /** Max username length */ | ||
| USERNAME_MAX: 32, | ||
| /** Min username length */ | ||
| USERNAME_MIN: 3, | ||
| /** Max display name length */ | ||
| DISPLAY_NAME_MAX: 64, | ||
| /** Max server name length */ | ||
| SERVER_NAME_MAX: 100, | ||
| /** Max channel name length */ | ||
| CHANNEL_NAME_MAX: 100, | ||
| /** Max thread name length */ | ||
| THREAD_NAME_MAX: 100, | ||
| /** Max file upload size (10MB) */ | ||
| FILE_UPLOAD_MAX_SIZE: 10 * 1024 * 1024, | ||
| /** Messages per page (cursor pagination) */ | ||
| MESSAGES_PER_PAGE: 50, | ||
| /** Max servers per user */ | ||
| SERVERS_PER_USER_MAX: 100, | ||
| /** Max channels per server */ | ||
| CHANNELS_PER_SERVER_MAX: 200, | ||
| /** Invite code length */ | ||
| INVITE_CODE_LENGTH: 8, | ||
| /** Password min length */ | ||
| PASSWORD_MIN: 8, | ||
| /** Max reactions per message per user */ | ||
| REACTIONS_PER_MESSAGE_MAX: 20 | ||
| }; | ||
| export { | ||
| CLIENT_EVENTS, | ||
| SERVER_EVENTS, | ||
| LIMITS | ||
| }; |
| interface Message { | ||
| id: string; | ||
| content: string; | ||
| channelId: string; | ||
| authorId: string; | ||
| threadId: string | null; | ||
| replyToId: string | null; | ||
| isEdited: boolean; | ||
| isPinned: boolean; | ||
| createdAt: string; | ||
| updatedAt: string; | ||
| author?: { | ||
| id: string; | ||
| username: string; | ||
| displayName: string; | ||
| avatarUrl: string | null; | ||
| isBot: boolean; | ||
| }; | ||
| attachments?: Attachment[]; | ||
| reactions?: ReactionGroup[]; | ||
| metadata?: MessageMetadata | null; | ||
| } | ||
| type MessageMentionKind = 'user' | 'buddy' | 'app' | 'channel' | 'server' | 'here' | 'everyone'; | ||
| interface MessageMentionRange { | ||
| start: number; | ||
| end: number; | ||
| } | ||
| interface MessageMention { | ||
| kind: MessageMentionKind; | ||
| /** Canonical target id. For users this is userId, for channels channelId, for servers serverId. */ | ||
| targetId: string; | ||
| /** Canonical text persisted in message content, e.g. <@userId>, <#channelId>. */ | ||
| token: string; | ||
| /** Optional display text selected or typed by the sender before canonicalization. */ | ||
| sourceToken?: string; | ||
| /** Human-readable label used by renderers. */ | ||
| label: string; | ||
| /** Optional source range in content. Clients may omit it; servers may recompute later. */ | ||
| range?: MessageMentionRange; | ||
| serverId?: string; | ||
| serverSlug?: string | null; | ||
| serverName?: string | null; | ||
| channelId?: string; | ||
| channelName?: string | null; | ||
| appId?: string; | ||
| appKey?: string; | ||
| appName?: string | null; | ||
| iconUrl?: string | null; | ||
| userId?: string; | ||
| username?: string | null; | ||
| displayName?: string | null; | ||
| avatarUrl?: string | null; | ||
| isBot?: boolean; | ||
| isPrivate?: boolean; | ||
| } | ||
| interface MessageMetadata { | ||
| mentions?: MessageMention[]; | ||
| agentChain?: Record<string, unknown>; | ||
| interactive?: Record<string, unknown>; | ||
| interactiveResponse?: Record<string, unknown>; | ||
| interactiveState?: Record<string, unknown>; | ||
| commerceCards?: CommerceMessageCard[]; | ||
| paidFileCards?: PaidFileCard[]; | ||
| oauthLinkCards?: OAuthLinkCard[]; | ||
| [key: string]: unknown; | ||
| } | ||
| interface CommerceOfferCardInput { | ||
| id?: string; | ||
| kind: 'offer'; | ||
| offerId: string; | ||
| } | ||
| type CommerceMessageCard = CommerceProductCard | CommerceOfferCardInput; | ||
| interface CommerceProductCard { | ||
| id: string; | ||
| kind: 'offer' | 'product'; | ||
| offerId?: string; | ||
| shopId: string; | ||
| shopScope: { | ||
| kind: 'server' | 'user'; | ||
| id: string; | ||
| }; | ||
| productId: string; | ||
| skuId?: string; | ||
| snapshot: { | ||
| name: string; | ||
| summary?: string | null; | ||
| imageUrl?: string | null; | ||
| shopName?: string | null; | ||
| deliveryPromise?: string | null; | ||
| price: number; | ||
| currency: string; | ||
| productType: 'physical' | 'entitlement'; | ||
| billingMode?: 'one_time' | 'fixed_duration' | 'subscription'; | ||
| durationSeconds?: number | null; | ||
| resourceType?: string; | ||
| resourceId?: string; | ||
| capability?: string; | ||
| }; | ||
| purchase: { | ||
| mode: 'direct' | 'select_sku' | 'open_detail'; | ||
| }; | ||
| } | ||
| interface PaidFileCard { | ||
| id: string; | ||
| kind: 'paid_file'; | ||
| fileId: string; | ||
| entitlementId?: string | null; | ||
| deliverableId?: string; | ||
| snapshot: { | ||
| name: string; | ||
| summary?: string | null; | ||
| mime?: string | null; | ||
| sizeBytes?: number | null; | ||
| previewUrl?: string | null; | ||
| }; | ||
| action: { | ||
| mode: 'open_paid_file'; | ||
| }; | ||
| } | ||
| interface OAuthLinkCard { | ||
| id: string; | ||
| kind: 'oauth_link'; | ||
| appId: string; | ||
| clientId?: string | null; | ||
| title: string; | ||
| description?: string | null; | ||
| iconUrl?: string | null; | ||
| meta?: { | ||
| appName?: string | null; | ||
| avatarUrl?: string | null; | ||
| iconUrl?: string | null; | ||
| coverUrl?: string | null; | ||
| homepageUrl?: string | null; | ||
| origin?: string | null; | ||
| }; | ||
| url: string; | ||
| embedUrl?: string | null; | ||
| fallbackUrl?: string | null; | ||
| scopes?: string[]; | ||
| action: { | ||
| mode: 'open_iframe' | 'open_external'; | ||
| }; | ||
| } | ||
| type MentionSuggestionTrigger = '@' | '#'; | ||
| interface MentionSuggestion { | ||
| id: string; | ||
| kind: MessageMentionKind; | ||
| targetId: string; | ||
| token: string; | ||
| label: string; | ||
| description?: string | null; | ||
| serverId?: string; | ||
| serverSlug?: string | null; | ||
| serverName?: string | null; | ||
| channelId?: string; | ||
| channelName?: string | null; | ||
| appId?: string; | ||
| appKey?: string; | ||
| appName?: string | null; | ||
| iconUrl?: string | null; | ||
| userId?: string; | ||
| username?: string | null; | ||
| displayName?: string | null; | ||
| avatarUrl?: string | null; | ||
| isBot?: boolean; | ||
| isPrivate?: boolean; | ||
| } | ||
| interface Attachment { | ||
| id: string; | ||
| messageId: string; | ||
| filename: string; | ||
| url: string; | ||
| contentType: string; | ||
| size: number; | ||
| width: number | null; | ||
| height: number | null; | ||
| createdAt: string; | ||
| } | ||
| interface ReactionGroup { | ||
| emoji: string; | ||
| count: number; | ||
| userIds: string[]; | ||
| } | ||
| interface Thread { | ||
| id: string; | ||
| name: string; | ||
| channelId: string; | ||
| parentMessageId: string; | ||
| creatorId: string; | ||
| isArchived: boolean; | ||
| createdAt: string; | ||
| updatedAt: string; | ||
| } | ||
| interface SendMessageRequest { | ||
| content: string; | ||
| threadId?: string; | ||
| replyToId?: string; | ||
| mentions?: MessageMention[]; | ||
| metadata?: MessageMetadata; | ||
| } | ||
| interface UpdateMessageRequest { | ||
| content: string; | ||
| } | ||
| type NotificationType = 'mention' | 'reply' | 'dm' | 'system'; | ||
| interface Notification { | ||
| id: string; | ||
| userId: string; | ||
| type: NotificationType; | ||
| title: string; | ||
| body: string | null; | ||
| referenceId: string | null; | ||
| referenceType: string | null; | ||
| isRead: boolean; | ||
| createdAt: string; | ||
| } | ||
| export type { Attachment as A, CommerceMessageCard as C, MentionSuggestion as M, Notification as N, OAuthLinkCard as O, PaidFileCard as P, ReactionGroup as R, SendMessageRequest as S, Thread as T, UpdateMessageRequest as U, CommerceOfferCardInput as a, CommerceProductCard as b, MentionSuggestionTrigger as c, Message as d, MessageMention as e, MessageMentionKind as f, MessageMentionRange as g, MessageMetadata as h, NotificationType as i }; |
| interface Message { | ||
| id: string; | ||
| content: string; | ||
| channelId: string; | ||
| authorId: string; | ||
| threadId: string | null; | ||
| replyToId: string | null; | ||
| isEdited: boolean; | ||
| isPinned: boolean; | ||
| createdAt: string; | ||
| updatedAt: string; | ||
| author?: { | ||
| id: string; | ||
| username: string; | ||
| displayName: string; | ||
| avatarUrl: string | null; | ||
| isBot: boolean; | ||
| }; | ||
| attachments?: Attachment[]; | ||
| reactions?: ReactionGroup[]; | ||
| metadata?: MessageMetadata | null; | ||
| } | ||
| type MessageMentionKind = 'user' | 'buddy' | 'app' | 'channel' | 'server' | 'here' | 'everyone'; | ||
| interface MessageMentionRange { | ||
| start: number; | ||
| end: number; | ||
| } | ||
| interface MessageMention { | ||
| kind: MessageMentionKind; | ||
| /** Canonical target id. For users this is userId, for channels channelId, for servers serverId. */ | ||
| targetId: string; | ||
| /** Canonical text persisted in message content, e.g. <@userId>, <#channelId>. */ | ||
| token: string; | ||
| /** Optional display text selected or typed by the sender before canonicalization. */ | ||
| sourceToken?: string; | ||
| /** Human-readable label used by renderers. */ | ||
| label: string; | ||
| /** Optional source range in content. Clients may omit it; servers may recompute later. */ | ||
| range?: MessageMentionRange; | ||
| serverId?: string; | ||
| serverSlug?: string | null; | ||
| serverName?: string | null; | ||
| channelId?: string; | ||
| channelName?: string | null; | ||
| appId?: string; | ||
| appKey?: string; | ||
| appName?: string | null; | ||
| iconUrl?: string | null; | ||
| userId?: string; | ||
| username?: string | null; | ||
| displayName?: string | null; | ||
| avatarUrl?: string | null; | ||
| isBot?: boolean; | ||
| isPrivate?: boolean; | ||
| } | ||
| interface MessageMetadata { | ||
| mentions?: MessageMention[]; | ||
| agentChain?: Record<string, unknown>; | ||
| interactive?: Record<string, unknown>; | ||
| interactiveResponse?: Record<string, unknown>; | ||
| interactiveState?: Record<string, unknown>; | ||
| commerceCards?: CommerceMessageCard[]; | ||
| paidFileCards?: PaidFileCard[]; | ||
| oauthLinkCards?: OAuthLinkCard[]; | ||
| [key: string]: unknown; | ||
| } | ||
| interface CommerceOfferCardInput { | ||
| id?: string; | ||
| kind: 'offer'; | ||
| offerId: string; | ||
| } | ||
| type CommerceMessageCard = CommerceProductCard | CommerceOfferCardInput; | ||
| interface CommerceProductCard { | ||
| id: string; | ||
| kind: 'offer' | 'product'; | ||
| offerId?: string; | ||
| shopId: string; | ||
| shopScope: { | ||
| kind: 'server' | 'user'; | ||
| id: string; | ||
| }; | ||
| productId: string; | ||
| skuId?: string; | ||
| snapshot: { | ||
| name: string; | ||
| summary?: string | null; | ||
| imageUrl?: string | null; | ||
| shopName?: string | null; | ||
| deliveryPromise?: string | null; | ||
| price: number; | ||
| currency: string; | ||
| productType: 'physical' | 'entitlement'; | ||
| billingMode?: 'one_time' | 'fixed_duration' | 'subscription'; | ||
| durationSeconds?: number | null; | ||
| resourceType?: string; | ||
| resourceId?: string; | ||
| capability?: string; | ||
| }; | ||
| purchase: { | ||
| mode: 'direct' | 'select_sku' | 'open_detail'; | ||
| }; | ||
| } | ||
| interface PaidFileCard { | ||
| id: string; | ||
| kind: 'paid_file'; | ||
| fileId: string; | ||
| entitlementId?: string | null; | ||
| deliverableId?: string; | ||
| snapshot: { | ||
| name: string; | ||
| summary?: string | null; | ||
| mime?: string | null; | ||
| sizeBytes?: number | null; | ||
| previewUrl?: string | null; | ||
| }; | ||
| action: { | ||
| mode: 'open_paid_file'; | ||
| }; | ||
| } | ||
| interface OAuthLinkCard { | ||
| id: string; | ||
| kind: 'oauth_link'; | ||
| appId: string; | ||
| clientId?: string | null; | ||
| title: string; | ||
| description?: string | null; | ||
| iconUrl?: string | null; | ||
| meta?: { | ||
| appName?: string | null; | ||
| avatarUrl?: string | null; | ||
| iconUrl?: string | null; | ||
| coverUrl?: string | null; | ||
| homepageUrl?: string | null; | ||
| origin?: string | null; | ||
| }; | ||
| url: string; | ||
| embedUrl?: string | null; | ||
| fallbackUrl?: string | null; | ||
| scopes?: string[]; | ||
| action: { | ||
| mode: 'open_iframe' | 'open_external'; | ||
| }; | ||
| } | ||
| type MentionSuggestionTrigger = '@' | '#'; | ||
| interface MentionSuggestion { | ||
| id: string; | ||
| kind: MessageMentionKind; | ||
| targetId: string; | ||
| token: string; | ||
| label: string; | ||
| description?: string | null; | ||
| serverId?: string; | ||
| serverSlug?: string | null; | ||
| serverName?: string | null; | ||
| channelId?: string; | ||
| channelName?: string | null; | ||
| appId?: string; | ||
| appKey?: string; | ||
| appName?: string | null; | ||
| iconUrl?: string | null; | ||
| userId?: string; | ||
| username?: string | null; | ||
| displayName?: string | null; | ||
| avatarUrl?: string | null; | ||
| isBot?: boolean; | ||
| isPrivate?: boolean; | ||
| } | ||
| interface Attachment { | ||
| id: string; | ||
| messageId: string; | ||
| filename: string; | ||
| url: string; | ||
| contentType: string; | ||
| size: number; | ||
| width: number | null; | ||
| height: number | null; | ||
| createdAt: string; | ||
| } | ||
| interface ReactionGroup { | ||
| emoji: string; | ||
| count: number; | ||
| userIds: string[]; | ||
| } | ||
| interface Thread { | ||
| id: string; | ||
| name: string; | ||
| channelId: string; | ||
| parentMessageId: string; | ||
| creatorId: string; | ||
| isArchived: boolean; | ||
| createdAt: string; | ||
| updatedAt: string; | ||
| } | ||
| interface SendMessageRequest { | ||
| content: string; | ||
| threadId?: string; | ||
| replyToId?: string; | ||
| mentions?: MessageMention[]; | ||
| metadata?: MessageMetadata; | ||
| } | ||
| interface UpdateMessageRequest { | ||
| content: string; | ||
| } | ||
| type NotificationType = 'mention' | 'reply' | 'dm' | 'system'; | ||
| interface Notification { | ||
| id: string; | ||
| userId: string; | ||
| type: NotificationType; | ||
| title: string; | ||
| body: string | null; | ||
| referenceId: string | null; | ||
| referenceType: string | null; | ||
| isRead: boolean; | ||
| createdAt: string; | ||
| } | ||
| export type { Attachment as A, CommerceMessageCard as C, MentionSuggestion as M, Notification as N, OAuthLinkCard as O, PaidFileCard as P, ReactionGroup as R, SendMessageRequest as S, Thread as T, UpdateMessageRequest as U, CommerceOfferCardInput as a, CommerceProductCard as b, MentionSuggestionTrigger as c, Message as d, MessageMention as e, MessageMentionKind as f, MessageMentionRange as g, MessageMetadata as h, NotificationType as i }; |
@@ -35,3 +35,8 @@ "use strict"; | ||
| MESSAGE_TYPING: "message:typing", | ||
| PRESENCE_UPDATE: "presence:update" | ||
| PRESENCE_UPDATE: "presence:update", | ||
| VOICE_JOIN: "voice:join", | ||
| VOICE_LEAVE: "voice:leave", | ||
| VOICE_STATE_UPDATE: "voice:state:update", | ||
| VOICE_TOKEN_RENEW: "voice:token:renew", | ||
| VOICE_HEARTBEAT: "voice:heartbeat" | ||
| }; | ||
@@ -48,3 +53,8 @@ var SERVER_EVENTS = { | ||
| REACTION_REMOVE: "reaction:remove", | ||
| NOTIFICATION_NEW: "notification:new" | ||
| NOTIFICATION_NEW: "notification:new", | ||
| VOICE_STATE: "voice:state", | ||
| VOICE_PARTICIPANT_JOINED: "voice:participant-joined", | ||
| VOICE_PARTICIPANT_LEFT: "voice:participant-left", | ||
| VOICE_PARTICIPANT_UPDATED: "voice:participant-updated", | ||
| VOICE_POLICY_UPDATED: "voice:policy-updated" | ||
| }; | ||
@@ -51,0 +61,0 @@ |
@@ -7,2 +7,7 @@ declare const CLIENT_EVENTS: { | ||
| readonly PRESENCE_UPDATE: "presence:update"; | ||
| readonly VOICE_JOIN: "voice:join"; | ||
| readonly VOICE_LEAVE: "voice:leave"; | ||
| readonly VOICE_STATE_UPDATE: "voice:state:update"; | ||
| readonly VOICE_TOKEN_RENEW: "voice:token:renew"; | ||
| readonly VOICE_HEARTBEAT: "voice:heartbeat"; | ||
| }; | ||
@@ -20,2 +25,7 @@ declare const SERVER_EVENTS: { | ||
| readonly NOTIFICATION_NEW: "notification:new"; | ||
| readonly VOICE_STATE: "voice:state"; | ||
| readonly VOICE_PARTICIPANT_JOINED: "voice:participant-joined"; | ||
| readonly VOICE_PARTICIPANT_LEFT: "voice:participant-left"; | ||
| readonly VOICE_PARTICIPANT_UPDATED: "voice:participant-updated"; | ||
| readonly VOICE_POLICY_UPDATED: "voice:policy-updated"; | ||
| }; | ||
@@ -22,0 +32,0 @@ type ClientEvent = (typeof CLIENT_EVENTS)[keyof typeof CLIENT_EVENTS]; |
@@ -7,2 +7,7 @@ declare const CLIENT_EVENTS: { | ||
| readonly PRESENCE_UPDATE: "presence:update"; | ||
| readonly VOICE_JOIN: "voice:join"; | ||
| readonly VOICE_LEAVE: "voice:leave"; | ||
| readonly VOICE_STATE_UPDATE: "voice:state:update"; | ||
| readonly VOICE_TOKEN_RENEW: "voice:token:renew"; | ||
| readonly VOICE_HEARTBEAT: "voice:heartbeat"; | ||
| }; | ||
@@ -20,2 +25,7 @@ declare const SERVER_EVENTS: { | ||
| readonly NOTIFICATION_NEW: "notification:new"; | ||
| readonly VOICE_STATE: "voice:state"; | ||
| readonly VOICE_PARTICIPANT_JOINED: "voice:participant-joined"; | ||
| readonly VOICE_PARTICIPANT_LEFT: "voice:participant-left"; | ||
| readonly VOICE_PARTICIPANT_UPDATED: "voice:participant-updated"; | ||
| readonly VOICE_POLICY_UPDATED: "voice:policy-updated"; | ||
| }; | ||
@@ -22,0 +32,0 @@ type ClientEvent = (typeof CLIENT_EVENTS)[keyof typeof CLIENT_EVENTS]; |
@@ -5,3 +5,3 @@ import { | ||
| SERVER_EVENTS | ||
| } from "../chunk-DMUZB4WV.js"; | ||
| } from "../chunk-J34E7LGB.js"; | ||
| export { | ||
@@ -8,0 +8,0 @@ CLIENT_EVENTS, |
+12
-2
@@ -60,3 +60,8 @@ "use strict"; | ||
| MESSAGE_TYPING: "message:typing", | ||
| PRESENCE_UPDATE: "presence:update" | ||
| PRESENCE_UPDATE: "presence:update", | ||
| VOICE_JOIN: "voice:join", | ||
| VOICE_LEAVE: "voice:leave", | ||
| VOICE_STATE_UPDATE: "voice:state:update", | ||
| VOICE_TOKEN_RENEW: "voice:token:renew", | ||
| VOICE_HEARTBEAT: "voice:heartbeat" | ||
| }; | ||
@@ -73,3 +78,8 @@ var SERVER_EVENTS = { | ||
| REACTION_REMOVE: "reaction:remove", | ||
| NOTIFICATION_NEW: "notification:new" | ||
| NOTIFICATION_NEW: "notification:new", | ||
| VOICE_STATE: "voice:state", | ||
| VOICE_PARTICIPANT_JOINED: "voice:participant-joined", | ||
| VOICE_PARTICIPANT_LEFT: "voice:participant-left", | ||
| VOICE_PARTICIPANT_UPDATED: "voice:participant-updated", | ||
| VOICE_POLICY_UPDATED: "voice:policy-updated" | ||
| }; | ||
@@ -76,0 +86,0 @@ |
+2
-2
| export { CLIENT_EVENTS, ClientEvent, LIMITS, SERVER_EVENTS, ServerEvent } from './constants/index.cjs'; | ||
| export { DEFAULT_HOMEPLAY_CATALOG, SHADOW_PLAY_SERVER_TEMPLATE, ShadowHomePlayCatalogItem, ShadowPlayAction, ShadowPlayAvailability, ShadowPlayServerTemplate, getDefaultHomePlay, getPlayBuddyEmail, getPlayBuddyUsername } from './play-catalog/index.cjs'; | ||
| export { Agent, AgentCapability, AgentInfo, AgentKernelType, AgentStatus, AuthResponse, Channel, ChannelSortBy, ChannelSortDirection, ChannelSortOptions, ChannelType, CreateAgentRequest, CreateChannelRequest, CreateServerRequest, FriendEntry, FriendSource, Friendship, FriendshipStatus, LoginRequest, Member, MemberRole, RegisterRequest, Server, UpdateChannelRequest, UpdateServerRequest, User, UserMembership, UserMembershipTier, UserProfile, UserStatus } from './types/index.cjs'; | ||
| export { A as Attachment, C as CommerceMessageCard, a as CommerceOfferCardInput, b as CommerceProductCard, M as MentionSuggestion, c as MentionSuggestionTrigger, d as Message, e as MessageMention, f as MessageMentionKind, g as MessageMentionRange, h as MessageMetadata, N as Notification, i as NotificationType, O as OAuthLinkCard, P as PaidFileCard, R as ReactionGroup, S as SendMessageRequest, T as Thread, U as UpdateMessageRequest } from './message.types-Ca8col0f.cjs'; | ||
| export { Agent, AgentCapability, AgentInfo, AgentKernelType, AgentStatus, AuthResponse, Channel, ChannelSortBy, ChannelSortDirection, ChannelSortOptions, ChannelType, CreateAgentRequest, CreateChannelRequest, CreateServerRequest, FriendEntry, FriendSource, Friendship, FriendshipStatus, LoginRequest, Member, MemberRole, RegisterRequest, Server, UpdateChannelRequest, UpdateServerRequest, User, UserMembership, UserMembershipTier, UserProfile, UserStatus, VoiceChannelCredentials, VoiceChannelJoinResult, VoiceChannelLeaveResult, VoiceChannelPolicy, VoiceChannelState, VoiceParticipant } from './types/index.cjs'; | ||
| export { A as Attachment, C as CommerceMessageCard, a as CommerceOfferCardInput, b as CommerceProductCard, M as MentionSuggestion, c as MentionSuggestionTrigger, d as Message, e as MessageMention, f as MessageMentionKind, g as MessageMentionRange, h as MessageMetadata, N as Notification, i as NotificationType, O as OAuthLinkCard, P as PaidFileCard, R as ReactionGroup, S as SendMessageRequest, T as Thread, U as UpdateMessageRequest } from './message.types-TGJmaffM.cjs'; | ||
| export { BgPattern, CAT_AVATAR_COUNT, CatConfig, CatDecoration, CatExpression, CatPattern, MessageMentionTextSegment, assignMentionRanges, buildMentionMarkdownLinks, canonicalMentionToken, canonicalizeMentionContent, escapeMarkdownLinkLabel, formatDate, generateInviteCode, generateRandomCatConfig, getAllCatAvatars, getCatAvatar, getCatAvatarByUserId, getCatSvgString, isCanonicalMentionToken, isValidEmail, mentionDisplayText, parseCanonicalMentionToken, renderCatSvg, segmentTextByMentions, slugify } from './utils/index.cjs'; |
+2
-2
| export { CLIENT_EVENTS, ClientEvent, LIMITS, SERVER_EVENTS, ServerEvent } from './constants/index.js'; | ||
| export { DEFAULT_HOMEPLAY_CATALOG, SHADOW_PLAY_SERVER_TEMPLATE, ShadowHomePlayCatalogItem, ShadowPlayAction, ShadowPlayAvailability, ShadowPlayServerTemplate, getDefaultHomePlay, getPlayBuddyEmail, getPlayBuddyUsername } from './play-catalog/index.js'; | ||
| export { Agent, AgentCapability, AgentInfo, AgentKernelType, AgentStatus, AuthResponse, Channel, ChannelSortBy, ChannelSortDirection, ChannelSortOptions, ChannelType, CreateAgentRequest, CreateChannelRequest, CreateServerRequest, FriendEntry, FriendSource, Friendship, FriendshipStatus, LoginRequest, Member, MemberRole, RegisterRequest, Server, UpdateChannelRequest, UpdateServerRequest, User, UserMembership, UserMembershipTier, UserProfile, UserStatus } from './types/index.js'; | ||
| export { A as Attachment, C as CommerceMessageCard, a as CommerceOfferCardInput, b as CommerceProductCard, M as MentionSuggestion, c as MentionSuggestionTrigger, d as Message, e as MessageMention, f as MessageMentionKind, g as MessageMentionRange, h as MessageMetadata, N as Notification, i as NotificationType, O as OAuthLinkCard, P as PaidFileCard, R as ReactionGroup, S as SendMessageRequest, T as Thread, U as UpdateMessageRequest } from './message.types-Ca8col0f.js'; | ||
| export { Agent, AgentCapability, AgentInfo, AgentKernelType, AgentStatus, AuthResponse, Channel, ChannelSortBy, ChannelSortDirection, ChannelSortOptions, ChannelType, CreateAgentRequest, CreateChannelRequest, CreateServerRequest, FriendEntry, FriendSource, Friendship, FriendshipStatus, LoginRequest, Member, MemberRole, RegisterRequest, Server, UpdateChannelRequest, UpdateServerRequest, User, UserMembership, UserMembershipTier, UserProfile, UserStatus, VoiceChannelCredentials, VoiceChannelJoinResult, VoiceChannelLeaveResult, VoiceChannelPolicy, VoiceChannelState, VoiceParticipant } from './types/index.js'; | ||
| export { A as Attachment, C as CommerceMessageCard, a as CommerceOfferCardInput, b as CommerceProductCard, M as MentionSuggestion, c as MentionSuggestionTrigger, d as Message, e as MessageMention, f as MessageMentionKind, g as MessageMentionRange, h as MessageMetadata, N as Notification, i as NotificationType, O as OAuthLinkCard, P as PaidFileCard, R as ReactionGroup, S as SendMessageRequest, T as Thread, U as UpdateMessageRequest } from './message.types-TGJmaffM.js'; | ||
| export { BgPattern, CAT_AVATAR_COUNT, CatConfig, CatDecoration, CatExpression, CatPattern, MessageMentionTextSegment, assignMentionRanges, buildMentionMarkdownLinks, canonicalMentionToken, canonicalizeMentionContent, escapeMarkdownLinkLabel, formatDate, generateInviteCode, generateRandomCatConfig, getAllCatAvatars, getCatAvatar, getCatAvatarByUserId, getCatSvgString, isCanonicalMentionToken, isValidEmail, mentionDisplayText, parseCanonicalMentionToken, renderCatSvg, segmentTextByMentions, slugify } from './utils/index.js'; |
+1
-1
@@ -5,3 +5,3 @@ import { | ||
| SERVER_EVENTS | ||
| } from "./chunk-DMUZB4WV.js"; | ||
| } from "./chunk-J34E7LGB.js"; | ||
| import { | ||
@@ -8,0 +8,0 @@ DEFAULT_HOMEPLAY_CATALOG, |
@@ -1,2 +0,2 @@ | ||
| export { A as Attachment, C as CommerceMessageCard, a as CommerceOfferCardInput, b as CommerceProductCard, M as MentionSuggestion, c as MentionSuggestionTrigger, d as Message, e as MessageMention, f as MessageMentionKind, g as MessageMentionRange, h as MessageMetadata, N as Notification, i as NotificationType, O as OAuthLinkCard, P as PaidFileCard, R as ReactionGroup, S as SendMessageRequest, T as Thread, U as UpdateMessageRequest } from '../message.types-Ca8col0f.cjs'; | ||
| export { A as Attachment, C as CommerceMessageCard, a as CommerceOfferCardInput, b as CommerceProductCard, M as MentionSuggestion, c as MentionSuggestionTrigger, d as Message, e as MessageMention, f as MessageMentionKind, g as MessageMentionRange, h as MessageMetadata, N as Notification, i as NotificationType, O as OAuthLinkCard, P as PaidFileCard, R as ReactionGroup, S as SendMessageRequest, T as Thread, U as UpdateMessageRequest } from '../message.types-TGJmaffM.cjs'; | ||
@@ -67,2 +67,56 @@ type AgentStatus = 'running' | 'stopped' | 'error'; | ||
| } | ||
| interface VoiceParticipant { | ||
| id: string; | ||
| channelId: string; | ||
| userId: string; | ||
| uid: number; | ||
| screenUid: number; | ||
| username: string; | ||
| displayName: string | null; | ||
| avatarUrl: string | null; | ||
| isBot: boolean; | ||
| isMuted: boolean; | ||
| isDeafened: boolean; | ||
| isSpeaking: boolean; | ||
| isScreenSharing: boolean; | ||
| joinedAt: string; | ||
| updatedAt: string; | ||
| clientId: string | null; | ||
| } | ||
| interface VoiceChannelCredentials { | ||
| appId: string; | ||
| channelId: string; | ||
| agoraChannelName: string; | ||
| uid: number; | ||
| screenUid: number; | ||
| token: string | null; | ||
| screenToken: string | null; | ||
| expiresAt: string | null; | ||
| } | ||
| interface VoiceChannelState { | ||
| channelId: string; | ||
| agoraChannelName: string; | ||
| participants: VoiceParticipant[]; | ||
| participantCount: number; | ||
| emptySince: string | null; | ||
| graceEndsAt: string | null; | ||
| } | ||
| interface VoiceChannelJoinResult { | ||
| credentials: VoiceChannelCredentials; | ||
| participant: VoiceParticipant; | ||
| state: VoiceChannelState; | ||
| } | ||
| interface VoiceChannelLeaveResult { | ||
| participant: VoiceParticipant | null; | ||
| state: VoiceChannelState; | ||
| } | ||
| interface VoiceChannelPolicy { | ||
| agentId: string; | ||
| channelId: string; | ||
| listen: boolean; | ||
| autoJoin: boolean; | ||
| consumeAudio: boolean; | ||
| consumeScreenShare: boolean; | ||
| screenshotIntervalSeconds: number | null; | ||
| } | ||
@@ -182,2 +236,2 @@ type FriendshipStatus = 'pending' | 'accepted' | 'blocked'; | ||
| export type { Agent, AgentCapability, AgentInfo, AgentKernelType, AgentStatus, AuthResponse, Channel, ChannelSortBy, ChannelSortDirection, ChannelSortOptions, ChannelType, CreateAgentRequest, CreateChannelRequest, CreateServerRequest, FriendEntry, FriendSource, Friendship, FriendshipStatus, LoginRequest, Member, MemberRole, RegisterRequest, Server, UpdateChannelRequest, UpdateServerRequest, User, UserMembership, UserMembershipTier, UserProfile, UserStatus }; | ||
| export type { Agent, AgentCapability, AgentInfo, AgentKernelType, AgentStatus, AuthResponse, Channel, ChannelSortBy, ChannelSortDirection, ChannelSortOptions, ChannelType, CreateAgentRequest, CreateChannelRequest, CreateServerRequest, FriendEntry, FriendSource, Friendship, FriendshipStatus, LoginRequest, Member, MemberRole, RegisterRequest, Server, UpdateChannelRequest, UpdateServerRequest, User, UserMembership, UserMembershipTier, UserProfile, UserStatus, VoiceChannelCredentials, VoiceChannelJoinResult, VoiceChannelLeaveResult, VoiceChannelPolicy, VoiceChannelState, VoiceParticipant }; |
@@ -1,2 +0,2 @@ | ||
| export { A as Attachment, C as CommerceMessageCard, a as CommerceOfferCardInput, b as CommerceProductCard, M as MentionSuggestion, c as MentionSuggestionTrigger, d as Message, e as MessageMention, f as MessageMentionKind, g as MessageMentionRange, h as MessageMetadata, N as Notification, i as NotificationType, O as OAuthLinkCard, P as PaidFileCard, R as ReactionGroup, S as SendMessageRequest, T as Thread, U as UpdateMessageRequest } from '../message.types-Ca8col0f.js'; | ||
| export { A as Attachment, C as CommerceMessageCard, a as CommerceOfferCardInput, b as CommerceProductCard, M as MentionSuggestion, c as MentionSuggestionTrigger, d as Message, e as MessageMention, f as MessageMentionKind, g as MessageMentionRange, h as MessageMetadata, N as Notification, i as NotificationType, O as OAuthLinkCard, P as PaidFileCard, R as ReactionGroup, S as SendMessageRequest, T as Thread, U as UpdateMessageRequest } from '../message.types-TGJmaffM.js'; | ||
@@ -67,2 +67,56 @@ type AgentStatus = 'running' | 'stopped' | 'error'; | ||
| } | ||
| interface VoiceParticipant { | ||
| id: string; | ||
| channelId: string; | ||
| userId: string; | ||
| uid: number; | ||
| screenUid: number; | ||
| username: string; | ||
| displayName: string | null; | ||
| avatarUrl: string | null; | ||
| isBot: boolean; | ||
| isMuted: boolean; | ||
| isDeafened: boolean; | ||
| isSpeaking: boolean; | ||
| isScreenSharing: boolean; | ||
| joinedAt: string; | ||
| updatedAt: string; | ||
| clientId: string | null; | ||
| } | ||
| interface VoiceChannelCredentials { | ||
| appId: string; | ||
| channelId: string; | ||
| agoraChannelName: string; | ||
| uid: number; | ||
| screenUid: number; | ||
| token: string | null; | ||
| screenToken: string | null; | ||
| expiresAt: string | null; | ||
| } | ||
| interface VoiceChannelState { | ||
| channelId: string; | ||
| agoraChannelName: string; | ||
| participants: VoiceParticipant[]; | ||
| participantCount: number; | ||
| emptySince: string | null; | ||
| graceEndsAt: string | null; | ||
| } | ||
| interface VoiceChannelJoinResult { | ||
| credentials: VoiceChannelCredentials; | ||
| participant: VoiceParticipant; | ||
| state: VoiceChannelState; | ||
| } | ||
| interface VoiceChannelLeaveResult { | ||
| participant: VoiceParticipant | null; | ||
| state: VoiceChannelState; | ||
| } | ||
| interface VoiceChannelPolicy { | ||
| agentId: string; | ||
| channelId: string; | ||
| listen: boolean; | ||
| autoJoin: boolean; | ||
| consumeAudio: boolean; | ||
| consumeScreenShare: boolean; | ||
| screenshotIntervalSeconds: number | null; | ||
| } | ||
@@ -182,2 +236,2 @@ type FriendshipStatus = 'pending' | 'accepted' | 'blocked'; | ||
| export type { Agent, AgentCapability, AgentInfo, AgentKernelType, AgentStatus, AuthResponse, Channel, ChannelSortBy, ChannelSortDirection, ChannelSortOptions, ChannelType, CreateAgentRequest, CreateChannelRequest, CreateServerRequest, FriendEntry, FriendSource, Friendship, FriendshipStatus, LoginRequest, Member, MemberRole, RegisterRequest, Server, UpdateChannelRequest, UpdateServerRequest, User, UserMembership, UserMembershipTier, UserProfile, UserStatus }; | ||
| export type { Agent, AgentCapability, AgentInfo, AgentKernelType, AgentStatus, AuthResponse, Channel, ChannelSortBy, ChannelSortDirection, ChannelSortOptions, ChannelType, CreateAgentRequest, CreateChannelRequest, CreateServerRequest, FriendEntry, FriendSource, Friendship, FriendshipStatus, LoginRequest, Member, MemberRole, RegisterRequest, Server, UpdateChannelRequest, UpdateServerRequest, User, UserMembership, UserMembershipTier, UserProfile, UserStatus, VoiceChannelCredentials, VoiceChannelJoinResult, VoiceChannelLeaveResult, VoiceChannelPolicy, VoiceChannelState, VoiceParticipant }; |
@@ -1,2 +0,2 @@ | ||
| import { g as MessageMentionRange, e as MessageMention } from '../message.types-Ca8col0f.cjs'; | ||
| import { g as MessageMentionRange, e as MessageMention } from '../message.types-TGJmaffM.cjs'; | ||
@@ -3,0 +3,0 @@ type CatPattern = 'none' | 'tabby' | 'tuxedo' | 'siamese' | 'calico' | 'bicolor'; |
@@ -1,2 +0,2 @@ | ||
| import { g as MessageMentionRange, e as MessageMention } from '../message.types-Ca8col0f.js'; | ||
| import { g as MessageMentionRange, e as MessageMention } from '../message.types-TGJmaffM.js'; | ||
@@ -3,0 +3,0 @@ type CatPattern = 'none' | 'tabby' | 'tuxedo' | 'siamese' | 'calico' | 'bicolor'; |
+1
-1
| { | ||
| "name": "@shadowob/shared", | ||
| "version": "1.1.4", | ||
| "version": "1.1.5", | ||
| "type": "module", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
| // src/constants/events.ts | ||
| var CLIENT_EVENTS = { | ||
| CHANNEL_JOIN: "channel:join", | ||
| CHANNEL_LEAVE: "channel:leave", | ||
| MESSAGE_SEND: "message:send", | ||
| MESSAGE_TYPING: "message:typing", | ||
| PRESENCE_UPDATE: "presence:update" | ||
| }; | ||
| var SERVER_EVENTS = { | ||
| MESSAGE_NEW: "message:new", | ||
| MESSAGE_UPDATE: "message:update", | ||
| MESSAGE_DELETE: "message:delete", | ||
| MEMBER_TYPING: "member:typing", | ||
| MEMBER_JOIN: "member:join", | ||
| MEMBER_LEAVE: "member:leave", | ||
| PRESENCE_CHANGE: "presence:change", | ||
| REACTION_ADD: "reaction:add", | ||
| REACTION_REMOVE: "reaction:remove", | ||
| NOTIFICATION_NEW: "notification:new" | ||
| }; | ||
| // src/constants/limits.ts | ||
| var LIMITS = { | ||
| /** Max message content length (16KB — enough for detailed agent responses) */ | ||
| MESSAGE_CONTENT_MAX: 16e3, | ||
| /** Max username length */ | ||
| USERNAME_MAX: 32, | ||
| /** Min username length */ | ||
| USERNAME_MIN: 3, | ||
| /** Max display name length */ | ||
| DISPLAY_NAME_MAX: 64, | ||
| /** Max server name length */ | ||
| SERVER_NAME_MAX: 100, | ||
| /** Max channel name length */ | ||
| CHANNEL_NAME_MAX: 100, | ||
| /** Max thread name length */ | ||
| THREAD_NAME_MAX: 100, | ||
| /** Max file upload size (10MB) */ | ||
| FILE_UPLOAD_MAX_SIZE: 10 * 1024 * 1024, | ||
| /** Messages per page (cursor pagination) */ | ||
| MESSAGES_PER_PAGE: 50, | ||
| /** Max servers per user */ | ||
| SERVERS_PER_USER_MAX: 100, | ||
| /** Max channels per server */ | ||
| CHANNELS_PER_SERVER_MAX: 200, | ||
| /** Invite code length */ | ||
| INVITE_CODE_LENGTH: 8, | ||
| /** Password min length */ | ||
| PASSWORD_MIN: 8, | ||
| /** Max reactions per message per user */ | ||
| REACTIONS_PER_MESSAGE_MAX: 20 | ||
| }; | ||
| export { | ||
| CLIENT_EVENTS, | ||
| SERVER_EVENTS, | ||
| LIMITS | ||
| }; |
| interface Message { | ||
| id: string; | ||
| content: string; | ||
| channelId: string; | ||
| authorId: string; | ||
| threadId: string | null; | ||
| replyToId: string | null; | ||
| isEdited: boolean; | ||
| isPinned: boolean; | ||
| createdAt: string; | ||
| updatedAt: string; | ||
| author?: { | ||
| id: string; | ||
| username: string; | ||
| displayName: string; | ||
| avatarUrl: string | null; | ||
| isBot: boolean; | ||
| }; | ||
| attachments?: Attachment[]; | ||
| reactions?: ReactionGroup[]; | ||
| metadata?: MessageMetadata | null; | ||
| } | ||
| type MessageMentionKind = 'user' | 'buddy' | 'app' | 'channel' | 'server' | 'here' | 'everyone'; | ||
| interface MessageMentionRange { | ||
| start: number; | ||
| end: number; | ||
| } | ||
| interface MessageMention { | ||
| kind: MessageMentionKind; | ||
| /** Canonical target id. For users this is userId, for channels channelId, for servers serverId. */ | ||
| targetId: string; | ||
| /** Canonical text persisted in message content, e.g. <@userId>, <#channelId>. */ | ||
| token: string; | ||
| /** Optional display text selected or typed by the sender before canonicalization. */ | ||
| sourceToken?: string; | ||
| /** Human-readable label used by renderers. */ | ||
| label: string; | ||
| /** Optional source range in content. Clients may omit it; servers may recompute later. */ | ||
| range?: MessageMentionRange; | ||
| serverId?: string; | ||
| serverSlug?: string | null; | ||
| serverName?: string | null; | ||
| channelId?: string; | ||
| channelName?: string | null; | ||
| appId?: string; | ||
| appKey?: string; | ||
| appName?: string | null; | ||
| iconUrl?: string | null; | ||
| userId?: string; | ||
| username?: string | null; | ||
| displayName?: string | null; | ||
| avatarUrl?: string | null; | ||
| isBot?: boolean; | ||
| isPrivate?: boolean; | ||
| } | ||
| interface MessageMetadata { | ||
| mentions?: MessageMention[]; | ||
| agentChain?: Record<string, unknown>; | ||
| interactive?: Record<string, unknown>; | ||
| interactiveResponse?: Record<string, unknown>; | ||
| interactiveState?: Record<string, unknown>; | ||
| commerceCards?: CommerceMessageCard[]; | ||
| paidFileCards?: PaidFileCard[]; | ||
| oauthLinkCards?: OAuthLinkCard[]; | ||
| [key: string]: unknown; | ||
| } | ||
| interface CommerceOfferCardInput { | ||
| id?: string; | ||
| kind: 'offer'; | ||
| offerId: string; | ||
| } | ||
| type CommerceMessageCard = CommerceProductCard | CommerceOfferCardInput; | ||
| interface CommerceProductCard { | ||
| id: string; | ||
| kind: 'offer' | 'product'; | ||
| offerId?: string; | ||
| shopId: string; | ||
| shopScope: { | ||
| kind: 'server' | 'user'; | ||
| id: string; | ||
| }; | ||
| productId: string; | ||
| skuId?: string; | ||
| snapshot: { | ||
| name: string; | ||
| summary?: string | null; | ||
| imageUrl?: string | null; | ||
| price: number; | ||
| currency: string; | ||
| productType: 'physical' | 'entitlement'; | ||
| billingMode?: 'one_time' | 'fixed_duration' | 'subscription'; | ||
| durationSeconds?: number | null; | ||
| resourceType?: string; | ||
| resourceId?: string; | ||
| capability?: string; | ||
| }; | ||
| purchase: { | ||
| mode: 'direct' | 'select_sku' | 'open_detail'; | ||
| }; | ||
| } | ||
| interface PaidFileCard { | ||
| id: string; | ||
| kind: 'paid_file'; | ||
| fileId: string; | ||
| entitlementId?: string | null; | ||
| deliverableId?: string; | ||
| snapshot: { | ||
| name: string; | ||
| summary?: string | null; | ||
| mime?: string | null; | ||
| sizeBytes?: number | null; | ||
| previewUrl?: string | null; | ||
| }; | ||
| action: { | ||
| mode: 'open_paid_file'; | ||
| }; | ||
| } | ||
| interface OAuthLinkCard { | ||
| id: string; | ||
| kind: 'oauth_link'; | ||
| appId: string; | ||
| clientId?: string | null; | ||
| title: string; | ||
| description?: string | null; | ||
| iconUrl?: string | null; | ||
| meta?: { | ||
| appName?: string | null; | ||
| avatarUrl?: string | null; | ||
| iconUrl?: string | null; | ||
| coverUrl?: string | null; | ||
| homepageUrl?: string | null; | ||
| origin?: string | null; | ||
| }; | ||
| url: string; | ||
| embedUrl?: string | null; | ||
| fallbackUrl?: string | null; | ||
| scopes?: string[]; | ||
| action: { | ||
| mode: 'open_iframe' | 'open_external'; | ||
| }; | ||
| } | ||
| type MentionSuggestionTrigger = '@' | '#'; | ||
| interface MentionSuggestion { | ||
| id: string; | ||
| kind: MessageMentionKind; | ||
| targetId: string; | ||
| token: string; | ||
| label: string; | ||
| description?: string | null; | ||
| serverId?: string; | ||
| serverSlug?: string | null; | ||
| serverName?: string | null; | ||
| channelId?: string; | ||
| channelName?: string | null; | ||
| appId?: string; | ||
| appKey?: string; | ||
| appName?: string | null; | ||
| iconUrl?: string | null; | ||
| userId?: string; | ||
| username?: string | null; | ||
| displayName?: string | null; | ||
| avatarUrl?: string | null; | ||
| isBot?: boolean; | ||
| isPrivate?: boolean; | ||
| } | ||
| interface Attachment { | ||
| id: string; | ||
| messageId: string; | ||
| filename: string; | ||
| url: string; | ||
| contentType: string; | ||
| size: number; | ||
| width: number | null; | ||
| height: number | null; | ||
| createdAt: string; | ||
| } | ||
| interface ReactionGroup { | ||
| emoji: string; | ||
| count: number; | ||
| userIds: string[]; | ||
| } | ||
| interface Thread { | ||
| id: string; | ||
| name: string; | ||
| channelId: string; | ||
| parentMessageId: string; | ||
| creatorId: string; | ||
| isArchived: boolean; | ||
| createdAt: string; | ||
| updatedAt: string; | ||
| } | ||
| interface SendMessageRequest { | ||
| content: string; | ||
| threadId?: string; | ||
| replyToId?: string; | ||
| mentions?: MessageMention[]; | ||
| metadata?: MessageMetadata; | ||
| } | ||
| interface UpdateMessageRequest { | ||
| content: string; | ||
| } | ||
| type NotificationType = 'mention' | 'reply' | 'dm' | 'system'; | ||
| interface Notification { | ||
| id: string; | ||
| userId: string; | ||
| type: NotificationType; | ||
| title: string; | ||
| body: string | null; | ||
| referenceId: string | null; | ||
| referenceType: string | null; | ||
| isRead: boolean; | ||
| createdAt: string; | ||
| } | ||
| export type { Attachment as A, CommerceMessageCard as C, MentionSuggestion as M, Notification as N, OAuthLinkCard as O, PaidFileCard as P, ReactionGroup as R, SendMessageRequest as S, Thread as T, UpdateMessageRequest as U, CommerceOfferCardInput as a, CommerceProductCard as b, MentionSuggestionTrigger as c, Message as d, MessageMention as e, MessageMentionKind as f, MessageMentionRange as g, MessageMetadata as h, NotificationType as i }; |
| interface Message { | ||
| id: string; | ||
| content: string; | ||
| channelId: string; | ||
| authorId: string; | ||
| threadId: string | null; | ||
| replyToId: string | null; | ||
| isEdited: boolean; | ||
| isPinned: boolean; | ||
| createdAt: string; | ||
| updatedAt: string; | ||
| author?: { | ||
| id: string; | ||
| username: string; | ||
| displayName: string; | ||
| avatarUrl: string | null; | ||
| isBot: boolean; | ||
| }; | ||
| attachments?: Attachment[]; | ||
| reactions?: ReactionGroup[]; | ||
| metadata?: MessageMetadata | null; | ||
| } | ||
| type MessageMentionKind = 'user' | 'buddy' | 'app' | 'channel' | 'server' | 'here' | 'everyone'; | ||
| interface MessageMentionRange { | ||
| start: number; | ||
| end: number; | ||
| } | ||
| interface MessageMention { | ||
| kind: MessageMentionKind; | ||
| /** Canonical target id. For users this is userId, for channels channelId, for servers serverId. */ | ||
| targetId: string; | ||
| /** Canonical text persisted in message content, e.g. <@userId>, <#channelId>. */ | ||
| token: string; | ||
| /** Optional display text selected or typed by the sender before canonicalization. */ | ||
| sourceToken?: string; | ||
| /** Human-readable label used by renderers. */ | ||
| label: string; | ||
| /** Optional source range in content. Clients may omit it; servers may recompute later. */ | ||
| range?: MessageMentionRange; | ||
| serverId?: string; | ||
| serverSlug?: string | null; | ||
| serverName?: string | null; | ||
| channelId?: string; | ||
| channelName?: string | null; | ||
| appId?: string; | ||
| appKey?: string; | ||
| appName?: string | null; | ||
| iconUrl?: string | null; | ||
| userId?: string; | ||
| username?: string | null; | ||
| displayName?: string | null; | ||
| avatarUrl?: string | null; | ||
| isBot?: boolean; | ||
| isPrivate?: boolean; | ||
| } | ||
| interface MessageMetadata { | ||
| mentions?: MessageMention[]; | ||
| agentChain?: Record<string, unknown>; | ||
| interactive?: Record<string, unknown>; | ||
| interactiveResponse?: Record<string, unknown>; | ||
| interactiveState?: Record<string, unknown>; | ||
| commerceCards?: CommerceMessageCard[]; | ||
| paidFileCards?: PaidFileCard[]; | ||
| oauthLinkCards?: OAuthLinkCard[]; | ||
| [key: string]: unknown; | ||
| } | ||
| interface CommerceOfferCardInput { | ||
| id?: string; | ||
| kind: 'offer'; | ||
| offerId: string; | ||
| } | ||
| type CommerceMessageCard = CommerceProductCard | CommerceOfferCardInput; | ||
| interface CommerceProductCard { | ||
| id: string; | ||
| kind: 'offer' | 'product'; | ||
| offerId?: string; | ||
| shopId: string; | ||
| shopScope: { | ||
| kind: 'server' | 'user'; | ||
| id: string; | ||
| }; | ||
| productId: string; | ||
| skuId?: string; | ||
| snapshot: { | ||
| name: string; | ||
| summary?: string | null; | ||
| imageUrl?: string | null; | ||
| price: number; | ||
| currency: string; | ||
| productType: 'physical' | 'entitlement'; | ||
| billingMode?: 'one_time' | 'fixed_duration' | 'subscription'; | ||
| durationSeconds?: number | null; | ||
| resourceType?: string; | ||
| resourceId?: string; | ||
| capability?: string; | ||
| }; | ||
| purchase: { | ||
| mode: 'direct' | 'select_sku' | 'open_detail'; | ||
| }; | ||
| } | ||
| interface PaidFileCard { | ||
| id: string; | ||
| kind: 'paid_file'; | ||
| fileId: string; | ||
| entitlementId?: string | null; | ||
| deliverableId?: string; | ||
| snapshot: { | ||
| name: string; | ||
| summary?: string | null; | ||
| mime?: string | null; | ||
| sizeBytes?: number | null; | ||
| previewUrl?: string | null; | ||
| }; | ||
| action: { | ||
| mode: 'open_paid_file'; | ||
| }; | ||
| } | ||
| interface OAuthLinkCard { | ||
| id: string; | ||
| kind: 'oauth_link'; | ||
| appId: string; | ||
| clientId?: string | null; | ||
| title: string; | ||
| description?: string | null; | ||
| iconUrl?: string | null; | ||
| meta?: { | ||
| appName?: string | null; | ||
| avatarUrl?: string | null; | ||
| iconUrl?: string | null; | ||
| coverUrl?: string | null; | ||
| homepageUrl?: string | null; | ||
| origin?: string | null; | ||
| }; | ||
| url: string; | ||
| embedUrl?: string | null; | ||
| fallbackUrl?: string | null; | ||
| scopes?: string[]; | ||
| action: { | ||
| mode: 'open_iframe' | 'open_external'; | ||
| }; | ||
| } | ||
| type MentionSuggestionTrigger = '@' | '#'; | ||
| interface MentionSuggestion { | ||
| id: string; | ||
| kind: MessageMentionKind; | ||
| targetId: string; | ||
| token: string; | ||
| label: string; | ||
| description?: string | null; | ||
| serverId?: string; | ||
| serverSlug?: string | null; | ||
| serverName?: string | null; | ||
| channelId?: string; | ||
| channelName?: string | null; | ||
| appId?: string; | ||
| appKey?: string; | ||
| appName?: string | null; | ||
| iconUrl?: string | null; | ||
| userId?: string; | ||
| username?: string | null; | ||
| displayName?: string | null; | ||
| avatarUrl?: string | null; | ||
| isBot?: boolean; | ||
| isPrivate?: boolean; | ||
| } | ||
| interface Attachment { | ||
| id: string; | ||
| messageId: string; | ||
| filename: string; | ||
| url: string; | ||
| contentType: string; | ||
| size: number; | ||
| width: number | null; | ||
| height: number | null; | ||
| createdAt: string; | ||
| } | ||
| interface ReactionGroup { | ||
| emoji: string; | ||
| count: number; | ||
| userIds: string[]; | ||
| } | ||
| interface Thread { | ||
| id: string; | ||
| name: string; | ||
| channelId: string; | ||
| parentMessageId: string; | ||
| creatorId: string; | ||
| isArchived: boolean; | ||
| createdAt: string; | ||
| updatedAt: string; | ||
| } | ||
| interface SendMessageRequest { | ||
| content: string; | ||
| threadId?: string; | ||
| replyToId?: string; | ||
| mentions?: MessageMention[]; | ||
| metadata?: MessageMetadata; | ||
| } | ||
| interface UpdateMessageRequest { | ||
| content: string; | ||
| } | ||
| type NotificationType = 'mention' | 'reply' | 'dm' | 'system'; | ||
| interface Notification { | ||
| id: string; | ||
| userId: string; | ||
| type: NotificationType; | ||
| title: string; | ||
| body: string | null; | ||
| referenceId: string | null; | ||
| referenceType: string | null; | ||
| isRead: boolean; | ||
| createdAt: string; | ||
| } | ||
| export type { Attachment as A, CommerceMessageCard as C, MentionSuggestion as M, Notification as N, OAuthLinkCard as O, PaidFileCard as P, ReactionGroup as R, SendMessageRequest as S, Thread as T, UpdateMessageRequest as U, CommerceOfferCardInput as a, CommerceProductCard as b, MentionSuggestionTrigger as c, Message as d, MessageMention as e, MessageMentionKind as f, MessageMentionRange as g, MessageMetadata as h, NotificationType as i }; |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
219463
2.67%4017
2.5%