🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@shadowob/shared

Package Overview
Dependencies
Maintainers
1
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shadowob/shared - npm Package Compare versions

Comparing version
1.1.3-dev.251
to
1.1.3-dev.261
+207
dist/message.types-Cyp3tmIX.d.cts
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' | '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;
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;
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' | '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;
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;
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 };
+1
-1
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, P as PaidFileCard, R as ReactionGroup, S as SendMessageRequest, T as Thread, U as UpdateMessageRequest } from './message.types-lG4qBSus.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-Cyp3tmIX.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';
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, P as PaidFileCard, R as ReactionGroup, S as SendMessageRequest, T as Thread, U as UpdateMessageRequest } from './message.types-lG4qBSus.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-Cyp3tmIX.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';

@@ -6,2 +6,3 @@ import {

} from "./chunk-DMUZB4WV.js";
import "./chunk-6H4LIJZC.js";
import {

@@ -14,3 +15,2 @@ DEFAULT_HOMEPLAY_CATALOG,

} from "./chunk-EXZEQO5X.js";
import "./chunk-6H4LIJZC.js";
import {

@@ -17,0 +17,0 @@ CAT_AVATAR_COUNT,

@@ -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, P as PaidFileCard, R as ReactionGroup, S as SendMessageRequest, T as Thread, U as UpdateMessageRequest } from '../message.types-lG4qBSus.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-Cyp3tmIX.cjs';

@@ -3,0 +3,0 @@ type AgentStatus = 'running' | 'stopped' | 'error';

@@ -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, P as PaidFileCard, R as ReactionGroup, S as SendMessageRequest, T as Thread, U as UpdateMessageRequest } from '../message.types-lG4qBSus.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-Cyp3tmIX.js';

@@ -3,0 +3,0 @@ type AgentStatus = 'running' | 'stopped' | 'error';

@@ -1,2 +0,2 @@

import { g as MessageMentionRange, e as MessageMention } from '../message.types-lG4qBSus.cjs';
import { g as MessageMentionRange, e as MessageMention } from '../message.types-Cyp3tmIX.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-lG4qBSus.js';
import { g as MessageMentionRange, e as MessageMention } from '../message.types-Cyp3tmIX.js';

@@ -3,0 +3,0 @@ type CatPattern = 'none' | 'tabby' | 'tuxedo' | 'siamese' | 'calico' | 'bicolor';

{
"name": "@shadowob/shared",
"version": "1.1.3-dev.251",
"version": "1.1.3-dev.261",
"type": "module",

@@ -5,0 +5,0 @@ "main": "./dist/index.js",

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' | '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;
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[];
[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';
};
}
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;
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, 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' | '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;
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[];
[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';
};
}
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;
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, 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 };