File tree Expand file tree Collapse file tree 3 files changed +95
-4
lines changed
types/powerapps-component-framework Expand file tree Collapse file tree 3 files changed +95
-4
lines changed Original file line number Diff line number Diff line change @@ -2834,4 +2834,64 @@ declare namespace ComponentFramework {
28342834 }
28352835 }
28362836 }
2837+
2838+ /**
2839+ * Interface for Copilot functionality
2840+ */
2841+ interface Copilot {
2842+ /**
2843+ * Executes a Microsoft Copilot Studio Agent's topic based on the registered event name. Returns an array of type MCSResponse.
2844+ * @param eventName Name of the event to execute
2845+ * @param parameters Parameters for the event, such as an ID
2846+ * @returns Promise that resolves with the event result
2847+ */
2848+ executeEvent ( eventName : string , parameters : Record < string , unknown > ) : Promise < MCSResponse [ ] > ;
2849+
2850+ /**
2851+ * Executes a Microsoft Copilot Studio Agent's topic based on registered triggered phrases. Returns an array of MCSResponse.
2852+ * @param promptText The text that is registered as a trigger query in the MCS topic.
2853+ */
2854+ executePrompt ( promptText : string ) : Promise < MCSResponse [ ] > ;
2855+ }
2856+
2857+ /**
2858+ * Interface for Copilot attachment layout types
2859+ */
2860+ type AttachmentLayout = "list" | "carousel" ;
2861+
2862+ /**
2863+ * Interface for Copilot attachments
2864+ */
2865+ interface Attachment {
2866+ content ?: unknown ;
2867+ contentType ?: string ;
2868+ }
2869+
2870+ /**
2871+ * Interface for Copilot text formats
2872+ */
2873+ type TextFormat = "plain" | "markdown" | "xml" ;
2874+
2875+ /*
2876+ * Interface for Copilot response
2877+ */
2878+ interface MCSResponse {
2879+ type : string ;
2880+ id ?: string ;
2881+ locale ?: string ;
2882+ replyToId ?: string ;
2883+ timestamp ?: string ;
2884+ speak ?: string ;
2885+ text ?: string ;
2886+ textFormat ?: TextFormat ;
2887+ suggestedActions ?: {
2888+ actions : unknown [ ] ;
2889+ to ?: string [ ] ;
2890+ } ;
2891+ value ?: unknown ;
2892+ valueType ?: string ;
2893+ name ?: string ;
2894+ attachmentLayout ?: AttachmentLayout ;
2895+ attachments ?: Attachment [ ] ;
2896+ }
28372897}
Original file line number Diff line number Diff line change 4141 {
4242 "name" : " Alex Tran" ,
4343 "githubUsername" : " Alex-MSFT"
44- },
45- {
46- "name" : " Michael Pena" ,
47- "githubUsername" : " mikepenaMS"
4844 }
4945 ]
5046}
Original file line number Diff line number Diff line change @@ -687,3 +687,38 @@ const entityFormOptionsTest: ComponentFramework.NavigationApi.EntityFormOptions
687687 entityType : "" ,
688688 } ,
689689} ;
690+
691+ const mcsResponseTest : ComponentFramework . MCSResponse = {
692+ type : "message" ,
693+ id : "19e7c095-4b6d-47b5-bc15-1c0ba3d5718d" ,
694+ timestamp : "2025-04-21T20:52:17.9125027+00:00" ,
695+ replyToId : "d0289e39-6192-4197-9fe2-9be66cb5127b" ,
696+ textFormat : "markdown" ,
697+ value : `Hello, here's **today's weather**` ,
698+ attachmentLayout : "list" ,
699+ attachments : [
700+ {
701+ contentType : "application/vnd.microsoft.card.adaptive" ,
702+ content : {
703+ type : "AdaptiveCard" ,
704+ $schema : "https://adaptivecards.io/schemas/adaptive-card.json" ,
705+ version : "1.6" ,
706+ body : [
707+ {
708+ type : "TextBlock" ,
709+ text : "Redmond, WA" ,
710+ size : "Large" ,
711+ isSubtle : true ,
712+ wrap : true ,
713+ style : "heading" ,
714+ } ,
715+ ] ,
716+ } ,
717+ } ,
718+ ] ,
719+ } ;
720+
721+ const copilotTest : ComponentFramework . Copilot = {
722+ executeEvent : ( eventName : string , eventData ?: any ) => Promise . resolve ( [ mcsResponseTest ] ) ,
723+ executePrompt : ( promptText : string ) => Promise . resolve ( [ mcsResponseTest ] ) ,
724+ } ;
You can’t perform that action at this time.
0 commit comments