@microsoft/agents-activity 0.6.18 → 0.6.22

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.
@@ -52,135 +52,146 @@ export type ClientCitationIconName =
52
52
  /** PDF document icon */
53
53
  | 'PDF';
54
54
  /**
55
- * Represents a Teams client citation to be included in a message. [Learn more about Bot messages with AI-generated content](https://learn.microsoft.com/microsoftteams/platform/bots/how-to/bot-messages-ai-generated-content?tabs=before%2Cbotmessage)
55
+ * @summary Represents a Teams client citation to be included in a message.
56
+ * @remarks
57
+ * [Learn more about Bot messages with AI-generated content](https://learn.microsoft.com/microsoftteams/platform/bots/how-to/bot-messages-ai-generated-content?tabs=before%2Cbotmessage)
56
58
  */
57
59
  export interface ClientCitation {
58
60
  /**
59
- * Required; must be "Claim"
60
- */
61
+ * Required; must be "Claim"
62
+ */
61
63
  '@type': 'Claim';
62
64
  /**
63
- * Required. Number and position of the citation.
64
- */
65
+ * Required. Number and position of the citation.
66
+ */
65
67
  position: number;
68
+ /**
69
+ * Optional; if provided, the citation will be displayed in the message.
70
+ */
66
71
  appearance: {
67
72
  /**
68
- * Required; Must be 'DigitalDocument'
69
- */
73
+ * Required; Must be 'DigitalDocument'
74
+ */
70
75
  '@type': 'DigitalDocument';
71
76
  /**
72
- * Name of the document. (max length 80)
73
- */
77
+ * Name of the document. (max length 80)
78
+ */
74
79
  name: string;
75
80
  /**
76
- * Stringified adaptive card with additional information about the citation.
77
- * It is rendered within the modal.
78
- */
81
+ * Stringified adaptive card with additional information about the citation.
82
+ * It is rendered within the modal.
83
+ */
79
84
  text?: string;
80
85
  /**
81
- * URL of the document. This will make the name of the citation clickable and direct the user to the specified URL.
82
- */
86
+ * URL of the document. This will make the name of the citation clickable and direct the user to the specified URL.
87
+ */
83
88
  url?: string;
84
89
  /**
85
- * Extract of the referenced content. (max length 160)
86
- */
90
+ * Extract of the referenced content. (max length 160)
91
+ */
87
92
  abstract: string;
88
93
  /**
89
- * Encoding format of the `citation.appearance.text` field.
90
- */
94
+ * Encoding format of the `citation.appearance.text` field.
95
+ */
91
96
  encodingFormat?: 'application/vnd.microsoft.card.adaptive';
92
97
  /**
93
- * Information about the citation’s icon.
94
- */
98
+ * Information about the citation’s icon.
99
+ */
95
100
  image?: {
96
101
  '@type': 'ImageObject';
97
102
  /**
98
- * The image/icon name
99
- */
103
+ * The image/icon name
104
+ */
100
105
  name: ClientCitationIconName;
101
106
  };
102
107
  /**
103
- * Optional; set by developer. (max length 3) (max keyword length 28)
104
- */
108
+ * Optional; set by developer. (max length 3) (max keyword length 28)
109
+ */
105
110
  keywords?: string[];
106
111
  /**
107
- * Optional sensitivity content information.
108
- */
112
+ * Optional sensitivity content information.
113
+ */
109
114
  usageInfo?: SensitivityUsageInfo;
110
115
  };
111
116
  }
112
117
  /**
113
- * Sensitivity usage info for content sent to the user. This is used to provide information about the content to the user. See {@link ClientCitation} for more information.
118
+ * @summary Sensitivity usage info for content sent to the user.
119
+ * @remarks
120
+ * This is used to provide information about the content to the user. See {@link ClientCitation} for more information.
114
121
  */
115
122
  export interface SensitivityUsageInfo {
116
123
  /**
117
- * Must be "https://schema.org/Message"
118
- */
124
+ * Must be "https://schema.org/Message"
125
+ */
119
126
  type: 'https://schema.org/Message';
120
127
  /**
121
- * Required; Set to CreativeWork;
122
- */
128
+ * Required; Set to CreativeWork;
129
+ */
123
130
  '@type': 'CreativeWork';
124
131
  /**
125
- * Sensitivity description of the content
126
- */
132
+ * Sensitivity description of the content
133
+ */
127
134
  description?: string;
128
135
  /**
129
- * Sensitivity title of the content
130
- */
136
+ * Sensitivity title of the content
137
+ */
131
138
  name: string;
132
139
  /**
133
- * Optional; ignored in Teams.
134
- */
140
+ * Optional; ignored in Teams.
141
+ */
135
142
  position?: number;
143
+ /**
144
+ * Optional; if provided, the content is considered sensitive and should be handled accordingly.
145
+ */
136
146
  pattern?: {
137
147
  /**
138
- * Set to DefinedTerm
139
- */
148
+ * Set to DefinedTerm
149
+ */
140
150
  '@type': 'DefinedTerm';
141
151
  inDefinedTermSet: string;
142
152
  /**
143
- * Color
144
- */
153
+ * Color
154
+ */
145
155
  name: string;
146
156
  /**
147
- * e.g. #454545
148
- */
157
+ * e.g. #454545
158
+ */
149
159
  termCode: string;
150
160
  };
151
161
  }
152
162
  export interface AIEntity extends Entity {
153
163
  /**
154
- * Required as 'https://schema.org/Message'
155
- */
164
+ * Required as 'https://schema.org/Message'
165
+ */
156
166
  type: 'https://schema.org/Message';
157
167
  /**
158
- * Required as 'Message
159
- */
168
+ * Required as 'Message
169
+ */
160
170
  '@type': 'Message';
161
171
  /**
162
- * Required as 'https://schema.org
163
- */
172
+ * Required as 'https://schema.org
173
+ */
164
174
  '@context': 'https://schema.org';
165
175
  /**
166
- * Must be left blank. This is for Bot Framework schema.
167
- */
176
+ * Must be left blank. This is for Bot Framework schema.
177
+ */
168
178
  '@id': '';
169
179
  /**
170
- * Indicate that the content was generated by AI.
171
- */
180
+ * Indicate that the content was generated by AI.
181
+ */
172
182
  additionalType: ['AIGeneratedContent'];
173
183
  /**
174
- * Optional; if citations object is included, the sent activity will include the citations, referenced in the activity text.
175
- */
184
+ * Optional; if citations object is included, the sent activity will include the citations, referenced in the activity text.
185
+ */
176
186
  citation?: ClientCitation[];
177
187
  /**
178
- * Optional; if usage_info object is included, the sent activity will include the sensitivity usage information.
179
- */
188
+ * Optional; if usage_info object is included, the sent activity will include the sensitivity usage information.
189
+ */
180
190
  usageInfo?: SensitivityUsageInfo;
181
191
  }
182
192
  /**
183
- * Adds an AI entity to an activity to indicate that the content was generated by AI.
193
+ * @summary Adds an AI entity to an activity to indicate that the content was generated by AI.
194
+ * @remarks
184
195
  * This function enhances the activity with metadata that helps clients (like Microsoft Teams)
185
196
  * understand that the content is AI-generated and optionally includes citations and sensitivity information.
186
197
  *
@@ -6,7 +6,8 @@
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  exports.addAIToActivity = void 0;
8
8
  /**
9
- * Adds an AI entity to an activity to indicate that the content was generated by AI.
9
+ * @summary Adds an AI entity to an activity to indicate that the content was generated by AI.
10
+ * @remarks
10
11
  * This function enhances the activity with metadata that helps clients (like Microsoft Teams)
11
12
  * understand that the content is AI-generated and optionally includes citations and sensitivity information.
12
13
  *
@@ -1 +1 @@
1
- {"version":3,"file":"AIEntity.js","sourceRoot":"","sources":["../../../src/entity/AIEntity.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAgNH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACI,MAAM,eAAe,GAAG,CAAC,QAAkB,EAAE,SAA4B,EAAE,SAAgC,EAAQ,EAAE;;IAC1H,MAAM,QAAQ,GAAa;QACzB,IAAI,EAAE,4BAA4B;QAClC,OAAO,EAAE,SAAS;QAClB,UAAU,EAAE,oBAAoB;QAChC,KAAK,EAAE,EAAE;QACT,cAAc,EAAE,CAAC,oBAAoB,CAAC;QACtC,QAAQ,EAAE,SAAS;QACnB,SAAS;KACV,CAAA;IACD,MAAA,QAAQ,CAAC,QAAQ,oCAAjB,QAAQ,CAAC,QAAQ,GAAK,EAAE,EAAA;IACxB,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;AAClC,CAAC,CAAA;AAZY,QAAA,eAAe,mBAY3B"}
1
+ {"version":3,"file":"AIEntity.js","sourceRoot":"","sources":["../../../src/entity/AIEntity.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AA0NH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACI,MAAM,eAAe,GAAG,CAC7B,QAAkB,EAClB,SAA4B,EAC5B,SAAgC,EAC1B,EAAE;;IACR,MAAM,QAAQ,GAAa;QACzB,IAAI,EAAE,4BAA4B;QAClC,OAAO,EAAE,SAAS;QAClB,UAAU,EAAE,oBAAoB;QAChC,KAAK,EAAE,EAAE;QACT,cAAc,EAAE,CAAC,oBAAoB,CAAC;QACtC,QAAQ,EAAE,SAAS;QACnB,SAAS;KACV,CAAA;IACD,MAAA,QAAQ,CAAC,QAAQ,oCAAjB,QAAQ,CAAC,QAAQ,GAAK,EAAE,EAAA;IACxB,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;AAClC,CAAC,CAAA;AAhBY,QAAA,eAAe,mBAgB3B"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@microsoft/agents-activity",
4
- "version": "0.6.18",
4
+ "version": "0.6.22",
5
5
  "homepage": "https://github.com/microsoft/Agents-for-js",
6
6
  "repository": {
7
7
  "type": "git",
@@ -11,206 +11,217 @@ import { Entity } from './entity'
11
11
  * identify the type of content being referenced in AI-generated responses.
12
12
  */
13
13
  export type ClientCitationIconName =
14
- /** Microsoft Word document icon */
15
- | 'Microsoft Word'
16
- /** Microsoft Excel spreadsheet icon */
17
- | 'Microsoft Excel'
18
- /** Microsoft PowerPoint presentation icon */
19
- | 'Microsoft PowerPoint'
20
- /** Microsoft OneNote notebook icon */
21
- | 'Microsoft OneNote'
22
- /** Microsoft SharePoint site or document icon */
23
- | 'Microsoft SharePoint'
24
- /** Microsoft Visio diagram icon */
25
- | 'Microsoft Visio'
26
- /** Microsoft Loop component icon */
27
- | 'Microsoft Loop'
28
- /** Microsoft Whiteboard icon */
29
- | 'Microsoft Whiteboard'
30
- /** Adobe Illustrator vector graphics icon */
31
- | 'Adobe Illustrator'
32
- /** Adobe Photoshop image editing icon */
33
- | 'Adobe Photoshop'
34
- /** Adobe InDesign layout design icon */
35
- | 'Adobe InDesign'
36
- /** Adobe Flash multimedia icon */
37
- | 'Adobe Flash'
38
- /** Sketch design tool icon */
39
- | 'Sketch'
40
- /** Source code file icon */
41
- | 'Source Code'
42
- /** Generic image file icon */
43
- | 'Image'
44
- /** Animated GIF image icon */
45
- | 'GIF'
46
- /** Video file icon */
47
- | 'Video'
48
- /** Audio/sound file icon */
49
- | 'Sound'
50
- /** ZIP archive file icon */
51
- | 'ZIP'
52
- /** Plain text file icon */
53
- | 'Text'
54
- /** PDF document icon */
55
- | 'PDF'
14
+ /** Microsoft Word document icon */
15
+ | 'Microsoft Word'
16
+ /** Microsoft Excel spreadsheet icon */
17
+ | 'Microsoft Excel'
18
+ /** Microsoft PowerPoint presentation icon */
19
+ | 'Microsoft PowerPoint'
20
+ /** Microsoft OneNote notebook icon */
21
+ | 'Microsoft OneNote'
22
+ /** Microsoft SharePoint site or document icon */
23
+ | 'Microsoft SharePoint'
24
+ /** Microsoft Visio diagram icon */
25
+ | 'Microsoft Visio'
26
+ /** Microsoft Loop component icon */
27
+ | 'Microsoft Loop'
28
+ /** Microsoft Whiteboard icon */
29
+ | 'Microsoft Whiteboard'
30
+ /** Adobe Illustrator vector graphics icon */
31
+ | 'Adobe Illustrator'
32
+ /** Adobe Photoshop image editing icon */
33
+ | 'Adobe Photoshop'
34
+ /** Adobe InDesign layout design icon */
35
+ | 'Adobe InDesign'
36
+ /** Adobe Flash multimedia icon */
37
+ | 'Adobe Flash'
38
+ /** Sketch design tool icon */
39
+ | 'Sketch'
40
+ /** Source code file icon */
41
+ | 'Source Code'
42
+ /** Generic image file icon */
43
+ | 'Image'
44
+ /** Animated GIF image icon */
45
+ | 'GIF'
46
+ /** Video file icon */
47
+ | 'Video'
48
+ /** Audio/sound file icon */
49
+ | 'Sound'
50
+ /** ZIP archive file icon */
51
+ | 'ZIP'
52
+ /** Plain text file icon */
53
+ | 'Text'
54
+ /** PDF document icon */
55
+ | 'PDF'
56
56
 
57
57
  /**
58
- * Represents a Teams client citation to be included in a message. [Learn more about Bot messages with AI-generated content](https://learn.microsoft.com/microsoftteams/platform/bots/how-to/bot-messages-ai-generated-content?tabs=before%2Cbotmessage)
58
+ * @summary Represents a Teams client citation to be included in a message.
59
+ * @remarks
60
+ * [Learn more about Bot messages with AI-generated content](https://learn.microsoft.com/microsoftteams/platform/bots/how-to/bot-messages-ai-generated-content?tabs=before%2Cbotmessage)
59
61
  */
60
62
  export interface ClientCitation {
61
63
  /**
62
- * Required; must be "Claim"
63
- */
64
+ * Required; must be "Claim"
65
+ */
64
66
  '@type': 'Claim';
65
67
 
66
68
  /**
67
- * Required. Number and position of the citation.
68
- */
69
+ * Required. Number and position of the citation.
70
+ */
69
71
  position: number;
72
+ /**
73
+ * Optional; if provided, the citation will be displayed in the message.
74
+ */
70
75
  appearance: {
71
76
  /**
72
- * Required; Must be 'DigitalDocument'
73
- */
77
+ * Required; Must be 'DigitalDocument'
78
+ */
74
79
  '@type': 'DigitalDocument';
75
80
 
76
81
  /**
77
- * Name of the document. (max length 80)
78
- */
82
+ * Name of the document. (max length 80)
83
+ */
79
84
  name: string;
80
85
 
81
86
  /**
82
- * Stringified adaptive card with additional information about the citation.
83
- * It is rendered within the modal.
84
- */
87
+ * Stringified adaptive card with additional information about the citation.
88
+ * It is rendered within the modal.
89
+ */
85
90
  text?: string;
86
91
 
87
92
  /**
88
- * URL of the document. This will make the name of the citation clickable and direct the user to the specified URL.
89
- */
93
+ * URL of the document. This will make the name of the citation clickable and direct the user to the specified URL.
94
+ */
90
95
  url?: string;
91
96
 
92
97
  /**
93
- * Extract of the referenced content. (max length 160)
94
- */
98
+ * Extract of the referenced content. (max length 160)
99
+ */
95
100
  abstract: string;
96
101
 
97
102
  /**
98
- * Encoding format of the `citation.appearance.text` field.
99
- */
103
+ * Encoding format of the `citation.appearance.text` field.
104
+ */
100
105
  encodingFormat?: 'application/vnd.microsoft.card.adaptive';
101
106
 
102
107
  /**
103
- * Information about the citation’s icon.
104
- */
108
+ * Information about the citation’s icon.
109
+ */
105
110
  image?: {
106
111
  '@type': 'ImageObject';
107
112
 
108
113
  /**
109
- * The image/icon name
110
- */
114
+ * The image/icon name
115
+ */
111
116
  name: ClientCitationIconName;
112
117
  };
113
118
 
114
119
  /**
115
- * Optional; set by developer. (max length 3) (max keyword length 28)
116
- */
120
+ * Optional; set by developer. (max length 3) (max keyword length 28)
121
+ */
117
122
  keywords?: string[];
118
123
 
119
124
  /**
120
- * Optional sensitivity content information.
121
- */
125
+ * Optional sensitivity content information.
126
+ */
122
127
  usageInfo?: SensitivityUsageInfo;
123
128
  };
124
129
  }
125
130
 
126
131
  /**
127
- * Sensitivity usage info for content sent to the user. This is used to provide information about the content to the user. See {@link ClientCitation} for more information.
132
+ * @summary Sensitivity usage info for content sent to the user.
133
+ * @remarks
134
+ * This is used to provide information about the content to the user. See {@link ClientCitation} for more information.
128
135
  */
129
136
  export interface SensitivityUsageInfo {
130
137
  /**
131
- * Must be "https://schema.org/Message"
132
- */
138
+ * Must be "https://schema.org/Message"
139
+ */
133
140
  type: 'https://schema.org/Message';
134
141
 
135
142
  /**
136
- * Required; Set to CreativeWork;
137
- */
143
+ * Required; Set to CreativeWork;
144
+ */
138
145
  '@type': 'CreativeWork';
139
146
 
140
147
  /**
141
- * Sensitivity description of the content
142
- */
148
+ * Sensitivity description of the content
149
+ */
143
150
  description?: string;
144
151
 
145
152
  /**
146
- * Sensitivity title of the content
147
- */
153
+ * Sensitivity title of the content
154
+ */
148
155
  name: string;
149
156
 
150
157
  /**
151
- * Optional; ignored in Teams.
152
- */
158
+ * Optional; ignored in Teams.
159
+ */
153
160
  position?: number;
154
161
 
162
+ /**
163
+ * Optional; if provided, the content is considered sensitive and should be handled accordingly.
164
+ */
155
165
  pattern?: {
156
166
  /**
157
- * Set to DefinedTerm
158
- */
167
+ * Set to DefinedTerm
168
+ */
159
169
  '@type': 'DefinedTerm';
160
170
 
161
171
  inDefinedTermSet: string;
162
172
 
163
173
  /**
164
- * Color
165
- */
174
+ * Color
175
+ */
166
176
  name: string;
167
177
 
168
178
  /**
169
- * e.g. #454545
170
- */
179
+ * e.g. #454545
180
+ */
171
181
  termCode: string;
172
182
  };
173
183
  }
174
184
 
175
185
  export interface AIEntity extends Entity {
176
186
  /**
177
- * Required as 'https://schema.org/Message'
178
- */
187
+ * Required as 'https://schema.org/Message'
188
+ */
179
189
  type: 'https://schema.org/Message';
180
190
 
181
191
  /**
182
- * Required as 'Message
183
- */
192
+ * Required as 'Message
193
+ */
184
194
  '@type': 'Message';
185
195
 
186
196
  /**
187
- * Required as 'https://schema.org
188
- */
197
+ * Required as 'https://schema.org
198
+ */
189
199
  '@context': 'https://schema.org';
190
200
 
191
201
  /**
192
- * Must be left blank. This is for Bot Framework schema.
193
- */
202
+ * Must be left blank. This is for Bot Framework schema.
203
+ */
194
204
  '@id': '';
195
205
 
196
206
  /**
197
- * Indicate that the content was generated by AI.
198
- */
207
+ * Indicate that the content was generated by AI.
208
+ */
199
209
  additionalType: ['AIGeneratedContent'];
200
210
 
201
211
  /**
202
- * Optional; if citations object is included, the sent activity will include the citations, referenced in the activity text.
203
- */
212
+ * Optional; if citations object is included, the sent activity will include the citations, referenced in the activity text.
213
+ */
204
214
  citation?: ClientCitation[];
205
215
 
206
216
  /**
207
- * Optional; if usage_info object is included, the sent activity will include the sensitivity usage information.
208
- */
217
+ * Optional; if usage_info object is included, the sent activity will include the sensitivity usage information.
218
+ */
209
219
  usageInfo?: SensitivityUsageInfo;
210
220
  }
211
221
 
212
222
  /**
213
- * Adds an AI entity to an activity to indicate that the content was generated by AI.
223
+ * @summary Adds an AI entity to an activity to indicate that the content was generated by AI.
224
+ * @remarks
214
225
  * This function enhances the activity with metadata that helps clients (like Microsoft Teams)
215
226
  * understand that the content is AI-generated and optionally includes citations and sensitivity information.
216
227
  *
@@ -249,7 +260,11 @@ export interface AIEntity extends Entity {
249
260
  * addAIToActivity(activity, citations);
250
261
  * ```
251
262
  */
252
- export const addAIToActivity = (activity: Activity, citations?: ClientCitation[], usageInfo?: SensitivityUsageInfo): void => {
263
+ export const addAIToActivity = (
264
+ activity: Activity,
265
+ citations?: ClientCitation[],
266
+ usageInfo?: SensitivityUsageInfo
267
+ ): void => {
253
268
  const aiEntity: AIEntity = {
254
269
  type: 'https://schema.org/Message',
255
270
  '@type': 'Message',