Skip to content

Commit 06304fd

Browse files
Added TeamsContent to copilot.sidePanel Interface (#2846)
* adding changefile * changed tstSelection source * adding composeType * added fileURL in the fileContent * adding teams prefix * linting
1 parent 64a6fd7 commit 06304fd

File tree

3 files changed

+198
-11
lines changed

3 files changed

+198
-11
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "minor",
3+
"comment": "Added `TeamsContent` interface for `{copilot.sidePanel}` capability.",
4+
"packageName": "@microsoft/teams-js",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

packages/teams-js/src/internal/validOrigins.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ function validateOriginWithValidOriginsList(messageOrigin: URL, validOriginsList
165165
/**
166166
* @internal
167167
* Limited to Microsoft-internal use
168-
*
168+
*
169169
* This function is only used for testing to reset the valid origins cache and ignore prefetched values.
170170
*/
171171
export function resetValidOriginsCache(): void {

packages/teams-js/src/private/copilot/sidePanelInterfaces.ts

Lines changed: 190 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ export enum ContentItemType {
1313
CALENDAR_INVITE = 'calendarInvite',
1414
WEB_PAGE = 'webPage',
1515
MIXED = 'mixed',
16+
TEAMS = 'teams', // Represents Teams-related content, such as chat or channel messages
17+
FILE = 'file', // Represents file content, such as documents or attachments
1618
}
1719

1820
/**
@@ -60,16 +62,9 @@ export interface ServerEmailContent extends BaseEmailContent {
6062
export interface DraftEmailContent extends BaseEmailContent {
6163
responseToEmailId?: string; // Optional, if this is a response to another email
6264
savedTime?: Date;
65+
composeType?: 'new' | 'reply' | 'replyAll' | 'forward'; // Type of compose action
6366
}
6467

65-
/**
66-
* @hidden
67-
*
68-
* Interface for draft email content (no id, times optional)
69-
*
70-
* @internal
71-
* Limited to Microsoft-internal use
72-
*/
7368
// Union type for usage elsewhere
7469
export type EmailContent = ServerEmailContent | DraftEmailContent;
7570

@@ -94,6 +89,7 @@ export interface CalendarInviteContent {
9489
attachments?: string[]; // List of attachment file names or URLs
9590
// Add other calendar event properties
9691
}
92+
9793
/**
9894
* @hidden
9995
*
@@ -122,7 +118,7 @@ export interface WebPageContent {
122118
*/
123119
export interface TextSelection {
124120
content: string;
125-
source?: EmailContent | WebPageContent | CalendarInviteContent;
121+
source?: EmailContent | WebPageContent | CalendarInviteContent | TeamsContent | FileContent;
126122
}
127123

128124
/**
@@ -203,7 +199,186 @@ export interface MediaSelection {
203199
type: MediaSelectionType;
204200
altText?: string;
205201
content: ImageContent | AudioContent | VideoContent;
206-
source?: EmailContent | WebPageContent | CalendarInviteContent;
202+
source?: EmailContent | WebPageContent | CalendarInviteContent | TeamsContent | FileContent;
203+
}
204+
/**
205+
* @hidden
206+
*
207+
* Interface representing the context of a Microsoft Teams chat.
208+
* Contains identifying information for a specific Teams chat session.
209+
*
210+
* @internal
211+
* Limited to Microsoft-internal use
212+
*/
213+
export interface TeamsChatContext {
214+
chatId: string; // Unique identifier for the chat
215+
}
216+
/**
217+
* @hidden
218+
*
219+
* Interface representing the context of a Microsoft Teams channel.
220+
* Contains identifying information for a specific Teams channel and related content.
221+
*
222+
* @internal
223+
* Limited to Microsoft-internal use
224+
*/
225+
export interface TeamsChannelContext {
226+
channelId: string; // Unique identifier for the channel
227+
teamId: string; // Unique identifier for the team
228+
channelName?: string; // Name of the channel
229+
postId?: string; // Unique identifier for the post in the channel
230+
replyChainId?: string; // Unique identifier for the reply chain in the channel
231+
clientConversationId?: string; // Unique identifier for the client conversation
232+
}
233+
234+
/**
235+
* @hidden
236+
*
237+
* Interface representing the context of a Microsoft Teams meeting.
238+
* Contains configuration and identifying information for Teams meeting sessions including Copilot features.
239+
*
240+
* @internal
241+
* Limited to Microsoft-internal use
242+
*/
243+
export interface TeamsMeetingContext {
244+
callId: string;
245+
threadId: string;
246+
organizerId: string;
247+
messageId?: string;
248+
groupId?: string;
249+
sessionType?: TeamsSessionType;
250+
vroomId?: string;
251+
iCalUid?: string;
252+
conversationId?: string;
253+
locale?: string;
254+
disableHistory?: boolean;
255+
Dimensions?: TeamsDimension[];
256+
UtteranceInfo?: TeamsUtteranceInfo;
257+
copilotMode?: CopilotMode;
258+
transcriptState?: TranscriptState;
259+
enableMeetingCopilotResponseHandoff?: boolean;
260+
enableCopilotResponseCopyRestriction?: boolean;
261+
enableMeetingCopilotVisualInsights?: boolean;
262+
enableMeetingCopilotCitation?: boolean;
263+
}
264+
265+
/**
266+
* @hidden
267+
*
268+
* Enum representing different types of Teams session contexts.
269+
* Defines the various meeting and chat session types within Microsoft Teams.
270+
*
271+
* @internal
272+
* Limited to Microsoft-internal use
273+
*/
274+
275+
export enum TeamsSessionType {
276+
Private = 'Private',
277+
Shared = 'Shared',
278+
Recap = 'Recap',
279+
RecapCall = 'RecapCall',
280+
PrivateViewCall = 'PrivateViewCall',
281+
Chat = 'Chat',
282+
Compose = 'Compose',
283+
}
284+
/**
285+
* @hidden
286+
*
287+
* Interface for telemetry dimension data used in analytics and reporting.
288+
* Contains dimension name-value pairs for categorizing telemetry data.
289+
*
290+
* @internal
291+
* Limited to Microsoft-internal use
292+
*/
293+
export interface TeamsDimension {
294+
DimensionName: TeamsDimensionName;
295+
DimensionValue: string;
296+
}
297+
/**
298+
* @hidden
299+
*
300+
* Enum defining telemetry dimension names for categorizing analytics data.
301+
* Used to specify the type of dimension being tracked in telemetry systems.
302+
*
303+
* @internal
304+
* Limited to Microsoft-internal use
305+
*/
306+
export enum TeamsDimensionName {
307+
ClientDeviceType = 'ClientDeviceType',
308+
ClientRing = 'ClientRing',
309+
ClientScenarioName = 'ClientScenarioName',
310+
}
311+
/**
312+
* @hidden
313+
*
314+
* Interface for utterance identification information used in conversation tracking.
315+
* Contains unique identifiers for individual utterances in chat or meeting contexts.
316+
*
317+
* @internal
318+
* Limited to Microsoft-internal use
319+
*/
320+
export interface TeamsUtteranceInfo {
321+
utteranceId?: string;
322+
}
323+
/**
324+
* @hidden
325+
*
326+
* Enum defining different Copilot operational modes.
327+
* Specifies whether Copilot is enabled and how it should function in Teams contexts.
328+
*
329+
* @internal
330+
* Limited to Microsoft-internal use
331+
*/
332+
export enum CopilotMode {
333+
Enabled = 'enabled',
334+
Disabled = 'disabled',
335+
EnabledWithTranscript = 'enabledWithTranscript',
336+
}
337+
/**
338+
* @hidden
339+
*
340+
* Enum defining different transcript states for meeting recordings.
341+
* Indicates the current status of transcript generation and availability.
342+
*
343+
* @internal
344+
* Limited to Microsoft-internal use
345+
*/
346+
export enum TranscriptState {
347+
NotStarted = 'notStarted',
348+
Active = 'active',
349+
Inactive = 'inactive',
350+
UnknownFutureValue = 'unknownFutureValue',
351+
}
352+
/**
353+
* @hidden
354+
*
355+
* Interface for Teams-related content data including app information and context.
356+
* Contains metadata about Teams applications and their execution contexts.
357+
*
358+
* @internal
359+
* Limited to Microsoft-internal use
360+
*/
361+
export interface TeamsContent {
362+
appName?: string;
363+
appVersion?: string;
364+
appPlatform?: string;
365+
appRingInfo?: string;
366+
chatContext?: TeamsChatContext;
367+
channelContext?: TeamsChannelContext;
368+
meetingContext?: TeamsMeetingContext;
369+
}
370+
371+
/**
372+
* @hidden
373+
*
374+
* Interface for file content data including URLs and metadata.
375+
* Represents file attachments and documents referenced in content.
376+
*
377+
* @internal
378+
* Limited to Microsoft-internal use
379+
*/
380+
export interface FileContent {
381+
fileUrl?: string; // URL of the file
207382
}
208383

209384
/**
@@ -220,6 +395,7 @@ export interface MixedContent {
220395
media?: (ImageContent | AudioContent | VideoContent)[];
221396
calendarInvites?: CalendarInviteContent[];
222397
webPages?: WebPageContent[];
398+
files?: FileContent[];
223399
otherContent?: Array<Record<string, unknown>> | undefined; // Other content types that don't fit into the above categories
224400
}
225401

@@ -237,6 +413,8 @@ export type ContentItem =
237413
| MediaSelection
238414
| CalendarInviteContent
239415
| WebPageContent
416+
| TeamsContent
417+
| FileContent
240418
| MixedContent;
241419

242420
/**
@@ -255,6 +433,8 @@ export interface Content {
255433
| ContentItemType.EMAIL
256434
| ContentItemType.MEDIA
257435
| ContentItemType.TEXT
436+
| ContentItemType.TEAMS
437+
| ContentItemType.FILE
258438
| ContentItemType.WEB_PAGE
259439
| ContentItemType.MIXED;
260440
formCode?: string; // Unique identifier for the content

0 commit comments

Comments
 (0)