@shadowob/shared 1.1.3 → 1.1.5

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.
@@ -190,6 +190,7 @@ function uniqueValues(values) {
190
190
  function canonicalMentionToken(mention) {
191
191
  if (mention.kind === "channel") return `<#${mention.channelId ?? mention.targetId}>`;
192
192
  if (mention.kind === "server") return `<@server:${mention.serverId ?? mention.targetId}>`;
193
+ if (mention.kind === "app") return `<@app:${mention.appId ?? mention.targetId}>`;
193
194
  if (mention.kind === "here" || mention.kind === "everyone") {
194
195
  const scope = mention.serverId ?? mention.targetId;
195
196
  return scope ? `<!${mention.kind}:${scope}>` : `<!${mention.kind}>`;
@@ -197,6 +198,8 @@ function canonicalMentionToken(mention) {
197
198
  return `<@${mention.userId ?? mention.targetId}>`;
198
199
  }
199
200
  function parseCanonicalMentionToken(token) {
201
+ const app = token.match(/^<@app:([^>]+)>$/u);
202
+ if (app?.[1]) return { kind: "app", targetId: app[1] };
200
203
  const user = token.match(/^<@([^>:]+)>$/u);
201
204
  if (user?.[1]) return { kind: "user", targetId: user[1] };
202
205
  const server = token.match(/^<@server:([^>]+)>$/u);
@@ -4,7 +4,12 @@ var CLIENT_EVENTS = {
4
4
  CHANNEL_LEAVE: "channel:leave",
5
5
  MESSAGE_SEND: "message:send",
6
6
  MESSAGE_TYPING: "message:typing",
7
- PRESENCE_UPDATE: "presence:update"
7
+ PRESENCE_UPDATE: "presence:update",
8
+ VOICE_JOIN: "voice:join",
9
+ VOICE_LEAVE: "voice:leave",
10
+ VOICE_STATE_UPDATE: "voice:state:update",
11
+ VOICE_TOKEN_RENEW: "voice:token:renew",
12
+ VOICE_HEARTBEAT: "voice:heartbeat"
8
13
  };
9
14
  var SERVER_EVENTS = {
10
15
  MESSAGE_NEW: "message:new",
@@ -16,7 +21,12 @@ var SERVER_EVENTS = {
16
21
  PRESENCE_CHANGE: "presence:change",
17
22
  REACTION_ADD: "reaction:add",
18
23
  REACTION_REMOVE: "reaction:remove",
19
- NOTIFICATION_NEW: "notification:new"
24
+ NOTIFICATION_NEW: "notification:new",
25
+ VOICE_STATE: "voice:state",
26
+ VOICE_PARTICIPANT_JOINED: "voice:participant-joined",
27
+ VOICE_PARTICIPANT_LEFT: "voice:participant-left",
28
+ VOICE_PARTICIPANT_UPDATED: "voice:participant-updated",
29
+ VOICE_POLICY_UPDATED: "voice:policy-updated"
20
30
  };
21
31
 
22
32
  // src/constants/limits.ts
@@ -32,7 +32,12 @@ var CLIENT_EVENTS = {
32
32
  CHANNEL_LEAVE: "channel:leave",
33
33
  MESSAGE_SEND: "message:send",
34
34
  MESSAGE_TYPING: "message:typing",
35
- PRESENCE_UPDATE: "presence:update"
35
+ PRESENCE_UPDATE: "presence:update",
36
+ VOICE_JOIN: "voice:join",
37
+ VOICE_LEAVE: "voice:leave",
38
+ VOICE_STATE_UPDATE: "voice:state:update",
39
+ VOICE_TOKEN_RENEW: "voice:token:renew",
40
+ VOICE_HEARTBEAT: "voice:heartbeat"
36
41
  };
37
42
  var SERVER_EVENTS = {
38
43
  MESSAGE_NEW: "message:new",
@@ -44,7 +49,12 @@ var SERVER_EVENTS = {
44
49
  PRESENCE_CHANGE: "presence:change",
45
50
  REACTION_ADD: "reaction:add",
46
51
  REACTION_REMOVE: "reaction:remove",
47
- NOTIFICATION_NEW: "notification:new"
52
+ NOTIFICATION_NEW: "notification:new",
53
+ VOICE_STATE: "voice:state",
54
+ VOICE_PARTICIPANT_JOINED: "voice:participant-joined",
55
+ VOICE_PARTICIPANT_LEFT: "voice:participant-left",
56
+ VOICE_PARTICIPANT_UPDATED: "voice:participant-updated",
57
+ VOICE_POLICY_UPDATED: "voice:policy-updated"
48
58
  };
49
59
 
50
60
  // src/constants/limits.ts
@@ -4,6 +4,11 @@ declare const CLIENT_EVENTS: {
4
4
  readonly MESSAGE_SEND: "message:send";
5
5
  readonly MESSAGE_TYPING: "message:typing";
6
6
  readonly PRESENCE_UPDATE: "presence:update";
7
+ readonly VOICE_JOIN: "voice:join";
8
+ readonly VOICE_LEAVE: "voice:leave";
9
+ readonly VOICE_STATE_UPDATE: "voice:state:update";
10
+ readonly VOICE_TOKEN_RENEW: "voice:token:renew";
11
+ readonly VOICE_HEARTBEAT: "voice:heartbeat";
7
12
  };
8
13
  declare const SERVER_EVENTS: {
9
14
  readonly MESSAGE_NEW: "message:new";
@@ -16,6 +21,11 @@ declare const SERVER_EVENTS: {
16
21
  readonly REACTION_ADD: "reaction:add";
17
22
  readonly REACTION_REMOVE: "reaction:remove";
18
23
  readonly NOTIFICATION_NEW: "notification:new";
24
+ readonly VOICE_STATE: "voice:state";
25
+ readonly VOICE_PARTICIPANT_JOINED: "voice:participant-joined";
26
+ readonly VOICE_PARTICIPANT_LEFT: "voice:participant-left";
27
+ readonly VOICE_PARTICIPANT_UPDATED: "voice:participant-updated";
28
+ readonly VOICE_POLICY_UPDATED: "voice:policy-updated";
19
29
  };
20
30
  type ClientEvent = (typeof CLIENT_EVENTS)[keyof typeof CLIENT_EVENTS];
21
31
  type ServerEvent = (typeof SERVER_EVENTS)[keyof typeof SERVER_EVENTS];
@@ -4,6 +4,11 @@ declare const CLIENT_EVENTS: {
4
4
  readonly MESSAGE_SEND: "message:send";
5
5
  readonly MESSAGE_TYPING: "message:typing";
6
6
  readonly PRESENCE_UPDATE: "presence:update";
7
+ readonly VOICE_JOIN: "voice:join";
8
+ readonly VOICE_LEAVE: "voice:leave";
9
+ readonly VOICE_STATE_UPDATE: "voice:state:update";
10
+ readonly VOICE_TOKEN_RENEW: "voice:token:renew";
11
+ readonly VOICE_HEARTBEAT: "voice:heartbeat";
7
12
  };
8
13
  declare const SERVER_EVENTS: {
9
14
  readonly MESSAGE_NEW: "message:new";
@@ -16,6 +21,11 @@ declare const SERVER_EVENTS: {
16
21
  readonly REACTION_ADD: "reaction:add";
17
22
  readonly REACTION_REMOVE: "reaction:remove";
18
23
  readonly NOTIFICATION_NEW: "notification:new";
24
+ readonly VOICE_STATE: "voice:state";
25
+ readonly VOICE_PARTICIPANT_JOINED: "voice:participant-joined";
26
+ readonly VOICE_PARTICIPANT_LEFT: "voice:participant-left";
27
+ readonly VOICE_PARTICIPANT_UPDATED: "voice:participant-updated";
28
+ readonly VOICE_POLICY_UPDATED: "voice:policy-updated";
19
29
  };
20
30
  type ClientEvent = (typeof CLIENT_EVENTS)[keyof typeof CLIENT_EVENTS];
21
31
  type ServerEvent = (typeof SERVER_EVENTS)[keyof typeof SERVER_EVENTS];
@@ -2,7 +2,7 @@ import {
2
2
  CLIENT_EVENTS,
3
3
  LIMITS,
4
4
  SERVER_EVENTS
5
- } from "../chunk-DMUZB4WV.js";
5
+ } from "../chunk-J34E7LGB.js";
6
6
  export {
7
7
  CLIENT_EVENTS,
8
8
  LIMITS,
package/dist/index.cjs CHANGED
@@ -57,7 +57,12 @@ var CLIENT_EVENTS = {
57
57
  CHANNEL_LEAVE: "channel:leave",
58
58
  MESSAGE_SEND: "message:send",
59
59
  MESSAGE_TYPING: "message:typing",
60
- PRESENCE_UPDATE: "presence:update"
60
+ PRESENCE_UPDATE: "presence:update",
61
+ VOICE_JOIN: "voice:join",
62
+ VOICE_LEAVE: "voice:leave",
63
+ VOICE_STATE_UPDATE: "voice:state:update",
64
+ VOICE_TOKEN_RENEW: "voice:token:renew",
65
+ VOICE_HEARTBEAT: "voice:heartbeat"
61
66
  };
62
67
  var SERVER_EVENTS = {
63
68
  MESSAGE_NEW: "message:new",
@@ -69,7 +74,12 @@ var SERVER_EVENTS = {
69
74
  PRESENCE_CHANGE: "presence:change",
70
75
  REACTION_ADD: "reaction:add",
71
76
  REACTION_REMOVE: "reaction:remove",
72
- NOTIFICATION_NEW: "notification:new"
77
+ NOTIFICATION_NEW: "notification:new",
78
+ VOICE_STATE: "voice:state",
79
+ VOICE_PARTICIPANT_JOINED: "voice:participant-joined",
80
+ VOICE_PARTICIPANT_LEFT: "voice:participant-left",
81
+ VOICE_PARTICIPANT_UPDATED: "voice:participant-updated",
82
+ VOICE_POLICY_UPDATED: "voice:policy-updated"
73
83
  };
74
84
 
75
85
  // src/constants/limits.ts
@@ -718,6 +728,7 @@ function uniqueValues(values) {
718
728
  function canonicalMentionToken(mention) {
719
729
  if (mention.kind === "channel") return `<#${mention.channelId ?? mention.targetId}>`;
720
730
  if (mention.kind === "server") return `<@server:${mention.serverId ?? mention.targetId}>`;
731
+ if (mention.kind === "app") return `<@app:${mention.appId ?? mention.targetId}>`;
721
732
  if (mention.kind === "here" || mention.kind === "everyone") {
722
733
  const scope = mention.serverId ?? mention.targetId;
723
734
  return scope ? `<!${mention.kind}:${scope}>` : `<!${mention.kind}>`;
@@ -725,6 +736,8 @@ function canonicalMentionToken(mention) {
725
736
  return `<@${mention.userId ?? mention.targetId}>`;
726
737
  }
727
738
  function parseCanonicalMentionToken(token) {
739
+ const app = token.match(/^<@app:([^>]+)>$/u);
740
+ if (app?.[1]) return { kind: "app", targetId: app[1] };
728
741
  const user = token.match(/^<@([^>:]+)>$/u);
729
742
  if (user?.[1]) return { kind: "user", targetId: user[1] };
730
743
  const server = token.match(/^<@server:([^>]+)>$/u);
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { CLIENT_EVENTS, ClientEvent, LIMITS, SERVER_EVENTS, ServerEvent } from './constants/index.cjs';
2
2
  export { DEFAULT_HOMEPLAY_CATALOG, SHADOW_PLAY_SERVER_TEMPLATE, ShadowHomePlayCatalogItem, ShadowPlayAction, ShadowPlayAvailability, ShadowPlayServerTemplate, getDefaultHomePlay, getPlayBuddyEmail, getPlayBuddyUsername } from './play-catalog/index.cjs';
3
- 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';
4
- 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';
3
+ 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';
4
+ 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';
5
5
  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';
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export { CLIENT_EVENTS, ClientEvent, LIMITS, SERVER_EVENTS, ServerEvent } from './constants/index.js';
2
2
  export { DEFAULT_HOMEPLAY_CATALOG, SHADOW_PLAY_SERVER_TEMPLATE, ShadowHomePlayCatalogItem, ShadowPlayAction, ShadowPlayAvailability, ShadowPlayServerTemplate, getDefaultHomePlay, getPlayBuddyEmail, getPlayBuddyUsername } from './play-catalog/index.js';
3
- 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';
4
- 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';
3
+ 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';
4
+ 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';
5
5
  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';
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  CLIENT_EVENTS,
3
3
  LIMITS,
4
4
  SERVER_EVENTS
5
- } from "./chunk-DMUZB4WV.js";
5
+ } from "./chunk-J34E7LGB.js";
6
6
  import {
7
7
  DEFAULT_HOMEPLAY_CATALOG,
8
8
  SHADOW_PLAY_SERVER_TEMPLATE,
@@ -32,7 +32,7 @@ import {
32
32
  renderCatSvg,
33
33
  segmentTextByMentions,
34
34
  slugify
35
- } from "./chunk-E3UBH4AI.js";
35
+ } from "./chunk-44D7I4ZW.js";
36
36
  export {
37
37
  CAT_AVATAR_COUNT,
38
38
  CLIENT_EVENTS,
@@ -20,7 +20,7 @@ interface Message {
20
20
  reactions?: ReactionGroup[];
21
21
  metadata?: MessageMetadata | null;
22
22
  }
23
- type MessageMentionKind = 'user' | 'buddy' | 'channel' | 'server' | 'here' | 'everyone';
23
+ type MessageMentionKind = 'user' | 'buddy' | 'app' | 'channel' | 'server' | 'here' | 'everyone';
24
24
  interface MessageMentionRange {
25
25
  start: number;
26
26
  end: number;
@@ -42,6 +42,10 @@ interface MessageMention {
42
42
  serverName?: string | null;
43
43
  channelId?: string;
44
44
  channelName?: string | null;
45
+ appId?: string;
46
+ appKey?: string;
47
+ appName?: string | null;
48
+ iconUrl?: string | null;
45
49
  userId?: string;
46
50
  username?: string | null;
47
51
  displayName?: string | null;
@@ -57,6 +61,7 @@ interface MessageMetadata {
57
61
  interactiveState?: Record<string, unknown>;
58
62
  commerceCards?: CommerceMessageCard[];
59
63
  paidFileCards?: PaidFileCard[];
64
+ oauthLinkCards?: OAuthLinkCard[];
60
65
  [key: string]: unknown;
61
66
  }
62
67
  interface CommerceOfferCardInput {
@@ -80,6 +85,8 @@ interface CommerceProductCard {
80
85
  name: string;
81
86
  summary?: string | null;
82
87
  imageUrl?: string | null;
88
+ shopName?: string | null;
89
+ deliveryPromise?: string | null;
83
90
  price: number;
84
91
  currency: string;
85
92
  productType: 'physical' | 'entitlement';
@@ -110,6 +117,30 @@ interface PaidFileCard {
110
117
  mode: 'open_paid_file';
111
118
  };
112
119
  }
120
+ interface OAuthLinkCard {
121
+ id: string;
122
+ kind: 'oauth_link';
123
+ appId: string;
124
+ clientId?: string | null;
125
+ title: string;
126
+ description?: string | null;
127
+ iconUrl?: string | null;
128
+ meta?: {
129
+ appName?: string | null;
130
+ avatarUrl?: string | null;
131
+ iconUrl?: string | null;
132
+ coverUrl?: string | null;
133
+ homepageUrl?: string | null;
134
+ origin?: string | null;
135
+ };
136
+ url: string;
137
+ embedUrl?: string | null;
138
+ fallbackUrl?: string | null;
139
+ scopes?: string[];
140
+ action: {
141
+ mode: 'open_iframe' | 'open_external';
142
+ };
143
+ }
113
144
  type MentionSuggestionTrigger = '@' | '#';
114
145
  interface MentionSuggestion {
115
146
  id: string;
@@ -123,6 +154,10 @@ interface MentionSuggestion {
123
154
  serverName?: string | null;
124
155
  channelId?: string;
125
156
  channelName?: string | null;
157
+ appId?: string;
158
+ appKey?: string;
159
+ appName?: string | null;
160
+ iconUrl?: string | null;
126
161
  userId?: string;
127
162
  username?: string | null;
128
163
  displayName?: string | null;
@@ -179,4 +214,4 @@ interface Notification {
179
214
  createdAt: string;
180
215
  }
181
216
 
182
- 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 };
217
+ 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 };
@@ -20,7 +20,7 @@ interface Message {
20
20
  reactions?: ReactionGroup[];
21
21
  metadata?: MessageMetadata | null;
22
22
  }
23
- type MessageMentionKind = 'user' | 'buddy' | 'channel' | 'server' | 'here' | 'everyone';
23
+ type MessageMentionKind = 'user' | 'buddy' | 'app' | 'channel' | 'server' | 'here' | 'everyone';
24
24
  interface MessageMentionRange {
25
25
  start: number;
26
26
  end: number;
@@ -42,6 +42,10 @@ interface MessageMention {
42
42
  serverName?: string | null;
43
43
  channelId?: string;
44
44
  channelName?: string | null;
45
+ appId?: string;
46
+ appKey?: string;
47
+ appName?: string | null;
48
+ iconUrl?: string | null;
45
49
  userId?: string;
46
50
  username?: string | null;
47
51
  displayName?: string | null;
@@ -57,6 +61,7 @@ interface MessageMetadata {
57
61
  interactiveState?: Record<string, unknown>;
58
62
  commerceCards?: CommerceMessageCard[];
59
63
  paidFileCards?: PaidFileCard[];
64
+ oauthLinkCards?: OAuthLinkCard[];
60
65
  [key: string]: unknown;
61
66
  }
62
67
  interface CommerceOfferCardInput {
@@ -80,6 +85,8 @@ interface CommerceProductCard {
80
85
  name: string;
81
86
  summary?: string | null;
82
87
  imageUrl?: string | null;
88
+ shopName?: string | null;
89
+ deliveryPromise?: string | null;
83
90
  price: number;
84
91
  currency: string;
85
92
  productType: 'physical' | 'entitlement';
@@ -110,6 +117,30 @@ interface PaidFileCard {
110
117
  mode: 'open_paid_file';
111
118
  };
112
119
  }
120
+ interface OAuthLinkCard {
121
+ id: string;
122
+ kind: 'oauth_link';
123
+ appId: string;
124
+ clientId?: string | null;
125
+ title: string;
126
+ description?: string | null;
127
+ iconUrl?: string | null;
128
+ meta?: {
129
+ appName?: string | null;
130
+ avatarUrl?: string | null;
131
+ iconUrl?: string | null;
132
+ coverUrl?: string | null;
133
+ homepageUrl?: string | null;
134
+ origin?: string | null;
135
+ };
136
+ url: string;
137
+ embedUrl?: string | null;
138
+ fallbackUrl?: string | null;
139
+ scopes?: string[];
140
+ action: {
141
+ mode: 'open_iframe' | 'open_external';
142
+ };
143
+ }
113
144
  type MentionSuggestionTrigger = '@' | '#';
114
145
  interface MentionSuggestion {
115
146
  id: string;
@@ -123,6 +154,10 @@ interface MentionSuggestion {
123
154
  serverName?: string | null;
124
155
  channelId?: string;
125
156
  channelName?: string | null;
157
+ appId?: string;
158
+ appKey?: string;
159
+ appName?: string | null;
160
+ iconUrl?: string | null;
126
161
  userId?: string;
127
162
  username?: string | null;
128
163
  displayName?: string | null;
@@ -179,4 +214,4 @@ interface Notification {
179
214
  createdAt: string;
180
215
  }
181
216
 
182
- 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 };
217
+ 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,4 +1,4 @@
1
- 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';
1
+ 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';
2
2
 
3
3
  type AgentStatus = 'running' | 'stopped' | 'error';
4
4
  type AgentKernelType = 'claude-code' | 'cursor' | 'mcp-server' | 'custom';
@@ -64,6 +64,60 @@ interface ChannelSortOptions {
64
64
  by: ChannelSortBy;
65
65
  direction: ChannelSortDirection;
66
66
  }
67
+ interface VoiceParticipant {
68
+ id: string;
69
+ channelId: string;
70
+ userId: string;
71
+ uid: number;
72
+ screenUid: number;
73
+ username: string;
74
+ displayName: string | null;
75
+ avatarUrl: string | null;
76
+ isBot: boolean;
77
+ isMuted: boolean;
78
+ isDeafened: boolean;
79
+ isSpeaking: boolean;
80
+ isScreenSharing: boolean;
81
+ joinedAt: string;
82
+ updatedAt: string;
83
+ clientId: string | null;
84
+ }
85
+ interface VoiceChannelCredentials {
86
+ appId: string;
87
+ channelId: string;
88
+ agoraChannelName: string;
89
+ uid: number;
90
+ screenUid: number;
91
+ token: string | null;
92
+ screenToken: string | null;
93
+ expiresAt: string | null;
94
+ }
95
+ interface VoiceChannelState {
96
+ channelId: string;
97
+ agoraChannelName: string;
98
+ participants: VoiceParticipant[];
99
+ participantCount: number;
100
+ emptySince: string | null;
101
+ graceEndsAt: string | null;
102
+ }
103
+ interface VoiceChannelJoinResult {
104
+ credentials: VoiceChannelCredentials;
105
+ participant: VoiceParticipant;
106
+ state: VoiceChannelState;
107
+ }
108
+ interface VoiceChannelLeaveResult {
109
+ participant: VoiceParticipant | null;
110
+ state: VoiceChannelState;
111
+ }
112
+ interface VoiceChannelPolicy {
113
+ agentId: string;
114
+ channelId: string;
115
+ listen: boolean;
116
+ autoJoin: boolean;
117
+ consumeAudio: boolean;
118
+ consumeScreenShare: boolean;
119
+ screenshotIntervalSeconds: number | null;
120
+ }
67
121
 
68
122
  type FriendshipStatus = 'pending' | 'accepted' | 'blocked';
69
123
  interface Friendship {
@@ -178,4 +232,4 @@ interface UserMembership {
178
232
  capabilities: string[];
179
233
  }
180
234
 
181
- 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 };
235
+ 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,4 +1,4 @@
1
- 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';
1
+ 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';
2
2
 
3
3
  type AgentStatus = 'running' | 'stopped' | 'error';
4
4
  type AgentKernelType = 'claude-code' | 'cursor' | 'mcp-server' | 'custom';
@@ -64,6 +64,60 @@ interface ChannelSortOptions {
64
64
  by: ChannelSortBy;
65
65
  direction: ChannelSortDirection;
66
66
  }
67
+ interface VoiceParticipant {
68
+ id: string;
69
+ channelId: string;
70
+ userId: string;
71
+ uid: number;
72
+ screenUid: number;
73
+ username: string;
74
+ displayName: string | null;
75
+ avatarUrl: string | null;
76
+ isBot: boolean;
77
+ isMuted: boolean;
78
+ isDeafened: boolean;
79
+ isSpeaking: boolean;
80
+ isScreenSharing: boolean;
81
+ joinedAt: string;
82
+ updatedAt: string;
83
+ clientId: string | null;
84
+ }
85
+ interface VoiceChannelCredentials {
86
+ appId: string;
87
+ channelId: string;
88
+ agoraChannelName: string;
89
+ uid: number;
90
+ screenUid: number;
91
+ token: string | null;
92
+ screenToken: string | null;
93
+ expiresAt: string | null;
94
+ }
95
+ interface VoiceChannelState {
96
+ channelId: string;
97
+ agoraChannelName: string;
98
+ participants: VoiceParticipant[];
99
+ participantCount: number;
100
+ emptySince: string | null;
101
+ graceEndsAt: string | null;
102
+ }
103
+ interface VoiceChannelJoinResult {
104
+ credentials: VoiceChannelCredentials;
105
+ participant: VoiceParticipant;
106
+ state: VoiceChannelState;
107
+ }
108
+ interface VoiceChannelLeaveResult {
109
+ participant: VoiceParticipant | null;
110
+ state: VoiceChannelState;
111
+ }
112
+ interface VoiceChannelPolicy {
113
+ agentId: string;
114
+ channelId: string;
115
+ listen: boolean;
116
+ autoJoin: boolean;
117
+ consumeAudio: boolean;
118
+ consumeScreenShare: boolean;
119
+ screenshotIntervalSeconds: number | null;
120
+ }
67
121
 
68
122
  type FriendshipStatus = 'pending' | 'accepted' | 'blocked';
69
123
  interface Friendship {
@@ -178,4 +232,4 @@ interface UserMembership {
178
232
  capabilities: string[];
179
233
  }
180
234
 
181
- 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 };
235
+ 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 };
@@ -233,6 +233,7 @@ function uniqueValues(values) {
233
233
  function canonicalMentionToken(mention) {
234
234
  if (mention.kind === "channel") return `<#${mention.channelId ?? mention.targetId}>`;
235
235
  if (mention.kind === "server") return `<@server:${mention.serverId ?? mention.targetId}>`;
236
+ if (mention.kind === "app") return `<@app:${mention.appId ?? mention.targetId}>`;
236
237
  if (mention.kind === "here" || mention.kind === "everyone") {
237
238
  const scope = mention.serverId ?? mention.targetId;
238
239
  return scope ? `<!${mention.kind}:${scope}>` : `<!${mention.kind}>`;
@@ -240,6 +241,8 @@ function canonicalMentionToken(mention) {
240
241
  return `<@${mention.userId ?? mention.targetId}>`;
241
242
  }
242
243
  function parseCanonicalMentionToken(token) {
244
+ const app = token.match(/^<@app:([^>]+)>$/u);
245
+ if (app?.[1]) return { kind: "app", targetId: app[1] };
243
246
  const user = token.match(/^<@([^>:]+)>$/u);
244
247
  if (user?.[1]) return { kind: "user", targetId: user[1] };
245
248
  const server = token.match(/^<@server:([^>]+)>$/u);
@@ -1,4 +1,4 @@
1
- import { g as MessageMentionRange, e as MessageMention } from '../message.types-lG4qBSus.cjs';
1
+ import { g as MessageMentionRange, e as MessageMention } from '../message.types-TGJmaffM.cjs';
2
2
 
3
3
  type CatPattern = 'none' | 'tabby' | 'tuxedo' | 'siamese' | 'calico' | 'bicolor';
4
4
  type CatExpression = 'smile' | 'open' | 'flat' | 'sad' | 'surprised' | 'kawaii' | 'winking' | 'smirk';
@@ -30,6 +30,9 @@ declare function canonicalMentionToken(mention: Pick<MessageMention, 'kind' | 't
30
30
  declare function parseCanonicalMentionToken(token: string): {
31
31
  kind: 'user';
32
32
  targetId: string;
33
+ } | {
34
+ kind: 'app';
35
+ targetId: string;
33
36
  } | {
34
37
  kind: 'channel';
35
38
  targetId: string;
@@ -1,4 +1,4 @@
1
- import { g as MessageMentionRange, e as MessageMention } from '../message.types-lG4qBSus.js';
1
+ import { g as MessageMentionRange, e as MessageMention } from '../message.types-TGJmaffM.js';
2
2
 
3
3
  type CatPattern = 'none' | 'tabby' | 'tuxedo' | 'siamese' | 'calico' | 'bicolor';
4
4
  type CatExpression = 'smile' | 'open' | 'flat' | 'sad' | 'surprised' | 'kawaii' | 'winking' | 'smirk';
@@ -30,6 +30,9 @@ declare function canonicalMentionToken(mention: Pick<MessageMention, 'kind' | 't
30
30
  declare function parseCanonicalMentionToken(token: string): {
31
31
  kind: 'user';
32
32
  targetId: string;
33
+ } | {
34
+ kind: 'app';
35
+ targetId: string;
33
36
  } | {
34
37
  kind: 'channel';
35
38
  targetId: string;
@@ -19,7 +19,7 @@ import {
19
19
  renderCatSvg,
20
20
  segmentTextByMentions,
21
21
  slugify
22
- } from "../chunk-E3UBH4AI.js";
22
+ } from "../chunk-44D7I4ZW.js";
23
23
  export {
24
24
  CAT_AVATAR_COUNT,
25
25
  assignMentionRanges,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shadowob/shared",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",