@microsoft/agents-activity 0.5.1-g2e246ff274 → 0.5.12-g2d752e9b13
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.
- package/dist/src/activityTreatments.d.ts +19 -0
- package/dist/src/activityTreatments.js +24 -0
- package/dist/src/activityTreatments.js.map +1 -0
- package/dist/src/entity/AIEntity.d.ts +137 -0
- package/dist/src/entity/AIEntity.js +23 -0
- package/dist/src/entity/AIEntity.js.map +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.js +4 -1
- package/dist/src/index.js.map +1 -1
- package/package.json +2 -2
- package/src/activityTreatments.ts +22 -0
- package/src/entity/AIEntity.ts +200 -0
- package/src/index.ts +2 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
/**
|
|
7
|
+
* Enum representing treatment types for the activity.
|
|
8
|
+
*/
|
|
9
|
+
export declare enum ActivityTreatments {
|
|
10
|
+
/**
|
|
11
|
+
* Indicates that only the recipient should be able to see the message even if the activity
|
|
12
|
+
* is being sent to a group of people.
|
|
13
|
+
*/
|
|
14
|
+
Targeted = "targeted"
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Zod schema for validating an ActivityTreatments enum.
|
|
18
|
+
*/
|
|
19
|
+
export declare const activityTreatments: z.ZodNativeEnum<typeof ActivityTreatments>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
+
* Licensed under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.activityTreatments = exports.ActivityTreatments = void 0;
|
|
8
|
+
const zod_1 = require("zod");
|
|
9
|
+
/**
|
|
10
|
+
* Enum representing treatment types for the activity.
|
|
11
|
+
*/
|
|
12
|
+
var ActivityTreatments;
|
|
13
|
+
(function (ActivityTreatments) {
|
|
14
|
+
/**
|
|
15
|
+
* Indicates that only the recipient should be able to see the message even if the activity
|
|
16
|
+
* is being sent to a group of people.
|
|
17
|
+
*/
|
|
18
|
+
ActivityTreatments["Targeted"] = "targeted";
|
|
19
|
+
})(ActivityTreatments || (exports.ActivityTreatments = ActivityTreatments = {}));
|
|
20
|
+
/**
|
|
21
|
+
* Zod schema for validating an ActivityTreatments enum.
|
|
22
|
+
*/
|
|
23
|
+
exports.activityTreatments = zod_1.z.nativeEnum(ActivityTreatments);
|
|
24
|
+
//# sourceMappingURL=activityTreatments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activityTreatments.js","sourceRoot":"","sources":["../../src/activityTreatments.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,6BAAuB;AAEvB;;GAEG;AACH,IAAY,kBAMX;AAND,WAAY,kBAAkB;IAC5B;;;OAGG;IACH,2CAAqB,CAAA;AACvB,CAAC,EANW,kBAAkB,kCAAlB,kBAAkB,QAM7B;AAED;;GAEG;AACU,QAAA,kBAAkB,GAAG,OAAC,CAAC,UAAU,CAAC,kBAAkB,CAAC,CAAA"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import { Activity } from '../activity';
|
|
6
|
+
import { Entity } from './entity';
|
|
7
|
+
export type ClientCitationIconName = 'Microsoft Word' | 'Microsoft Excel' | 'Microsoft PowerPoint' | 'Microsoft OneNote' | 'Microsoft SharePoint' | 'Microsoft Visio' | 'Microsoft Loop' | 'Microsoft Whiteboard' | 'Adobe Illustrator' | 'Adobe Photoshop' | 'Adobe InDesign' | 'Adobe Flash' | 'Sketch' | 'Source Code' | 'Image' | 'GIF' | 'Video' | 'Sound' | 'ZIP' | 'Text' | 'PDF';
|
|
8
|
+
/**
|
|
9
|
+
* Represents a Teams client citation to be included in a message. See Bot messages with AI-generated content for more details.
|
|
10
|
+
* https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/bot-messages-ai-generated-content?tabs=before%2Cbotmessage
|
|
11
|
+
*/
|
|
12
|
+
export interface ClientCitation {
|
|
13
|
+
/**
|
|
14
|
+
* Required; must be "Claim"
|
|
15
|
+
*/
|
|
16
|
+
'@type': 'Claim';
|
|
17
|
+
/**
|
|
18
|
+
* Required. Number and position of the citation.
|
|
19
|
+
*/
|
|
20
|
+
position: number;
|
|
21
|
+
appearance: {
|
|
22
|
+
/**
|
|
23
|
+
* Required; Must be 'DigitalDocument'
|
|
24
|
+
*/
|
|
25
|
+
'@type': 'DigitalDocument';
|
|
26
|
+
/**
|
|
27
|
+
* Name of the document. (max length 80)
|
|
28
|
+
*/
|
|
29
|
+
name: string;
|
|
30
|
+
/**
|
|
31
|
+
* Stringified adaptive card with additional information about the citation.
|
|
32
|
+
* It is rendered within the modal.
|
|
33
|
+
*/
|
|
34
|
+
text?: string;
|
|
35
|
+
/**
|
|
36
|
+
* URL of the document. This will make the name of the citation clickable and direct the user to the specified URL.
|
|
37
|
+
*/
|
|
38
|
+
url?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Extract of the referenced content. (max length 160)
|
|
41
|
+
*/
|
|
42
|
+
abstract: string;
|
|
43
|
+
/**
|
|
44
|
+
* Encoding format of the `citation.appearance.text` field.
|
|
45
|
+
*/
|
|
46
|
+
encodingFormat?: 'application/vnd.microsoft.card.adaptive';
|
|
47
|
+
/**
|
|
48
|
+
* Information about the citation’s icon.
|
|
49
|
+
*/
|
|
50
|
+
image?: {
|
|
51
|
+
'@type': 'ImageObject';
|
|
52
|
+
/**
|
|
53
|
+
* The image/icon name
|
|
54
|
+
*/
|
|
55
|
+
name: ClientCitationIconName;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Optional; set by developer. (max length 3) (max keyword length 28)
|
|
59
|
+
*/
|
|
60
|
+
keywords?: string[];
|
|
61
|
+
/**
|
|
62
|
+
* Optional sensitivity content information.
|
|
63
|
+
*/
|
|
64
|
+
usageInfo?: SensitivityUsageInfo;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Sensitivity usage info for content sent to the user. This is used to provide information about the content to the user. See ClientCitation for more information.
|
|
69
|
+
*/
|
|
70
|
+
export interface SensitivityUsageInfo {
|
|
71
|
+
/**
|
|
72
|
+
* Must be "https://schema.org/Message"
|
|
73
|
+
*/
|
|
74
|
+
type: 'https://schema.org/Message';
|
|
75
|
+
/**
|
|
76
|
+
* Required; Set to CreativeWork;
|
|
77
|
+
*/
|
|
78
|
+
'@type': 'CreativeWork';
|
|
79
|
+
/**
|
|
80
|
+
* Sensitivity description of the content
|
|
81
|
+
*/
|
|
82
|
+
description?: string;
|
|
83
|
+
/**
|
|
84
|
+
* Sensitivity title of the content
|
|
85
|
+
*/
|
|
86
|
+
name: string;
|
|
87
|
+
/**
|
|
88
|
+
* Optional; ignored in Teams.
|
|
89
|
+
*/
|
|
90
|
+
position?: number;
|
|
91
|
+
pattern?: {
|
|
92
|
+
/**
|
|
93
|
+
* Set to DefinedTerm
|
|
94
|
+
*/
|
|
95
|
+
'@type': 'DefinedTerm';
|
|
96
|
+
inDefinedTermSet: string;
|
|
97
|
+
/**
|
|
98
|
+
* Color
|
|
99
|
+
*/
|
|
100
|
+
name: string;
|
|
101
|
+
/**
|
|
102
|
+
* e.g. #454545
|
|
103
|
+
*/
|
|
104
|
+
termCode: string;
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
export interface AIEntity extends Entity {
|
|
108
|
+
/**
|
|
109
|
+
* Required as 'https://schema.org/Message'
|
|
110
|
+
*/
|
|
111
|
+
type: 'https://schema.org/Message';
|
|
112
|
+
/**
|
|
113
|
+
* Required as 'Message
|
|
114
|
+
*/
|
|
115
|
+
'@type': 'Message';
|
|
116
|
+
/**
|
|
117
|
+
* Required as 'https://schema.org
|
|
118
|
+
*/
|
|
119
|
+
'@context': 'https://schema.org';
|
|
120
|
+
/**
|
|
121
|
+
* Must be left blank. This is for Bot Framework schema.
|
|
122
|
+
*/
|
|
123
|
+
'@id': '';
|
|
124
|
+
/**
|
|
125
|
+
* Indicate that the content was generated by AI.
|
|
126
|
+
*/
|
|
127
|
+
additionalType: ['AIGeneratedContent'];
|
|
128
|
+
/**
|
|
129
|
+
* Optional; if citations object is included, the sent activity will include the citations, referenced in the activity text.
|
|
130
|
+
*/
|
|
131
|
+
citation?: ClientCitation[];
|
|
132
|
+
/**
|
|
133
|
+
* Optional; if usage_info object is included, the sent activity will include the sensitivity usage information.
|
|
134
|
+
*/
|
|
135
|
+
usageInfo?: SensitivityUsageInfo;
|
|
136
|
+
}
|
|
137
|
+
export declare const addAIToActivity: (activity: Activity, citations?: ClientCitation[], usageInfo?: SensitivityUsageInfo) => void;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
+
* Licensed under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.addAIToActivity = void 0;
|
|
8
|
+
const addAIToActivity = (activity, citations, usageInfo) => {
|
|
9
|
+
var _a;
|
|
10
|
+
const aiEntity = {
|
|
11
|
+
type: 'https://schema.org/Message',
|
|
12
|
+
'@type': 'Message',
|
|
13
|
+
'@context': 'https://schema.org',
|
|
14
|
+
'@id': '',
|
|
15
|
+
additionalType: ['AIGeneratedContent'],
|
|
16
|
+
citation: citations,
|
|
17
|
+
usageInfo
|
|
18
|
+
};
|
|
19
|
+
(_a = activity.entities) !== null && _a !== void 0 ? _a : (activity.entities = []);
|
|
20
|
+
activity.entities.push(aiEntity);
|
|
21
|
+
};
|
|
22
|
+
exports.addAIToActivity = addAIToActivity;
|
|
23
|
+
//# sourceMappingURL=AIEntity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AIEntity.js","sourceRoot":"","sources":["../../../src/entity/AIEntity.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAwLI,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"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ export { Mention } from './entity/mention';
|
|
|
24
24
|
export { GeoCoordinates } from './entity/geoCoordinates';
|
|
25
25
|
export { Place } from './entity/place';
|
|
26
26
|
export { Thing } from './entity/thing';
|
|
27
|
+
export * from './entity/AIEntity';
|
|
27
28
|
export * from './invoke/adaptiveCardInvokeAction';
|
|
28
29
|
export { Activity, activityZodSchema } from './activity';
|
|
29
30
|
export { ActivityEventNames } from './activityEventNames';
|
|
@@ -37,3 +38,4 @@ export { MessageReaction } from './messageReaction';
|
|
|
37
38
|
export { MessageReactionTypes } from './messageReactionTypes';
|
|
38
39
|
export { TextFormatTypes } from './textFormatTypes';
|
|
39
40
|
export { TextHighlight } from './textHighlight';
|
|
41
|
+
export { ActivityTreatments } from './activityTreatments';
|
package/dist/src/index.js
CHANGED
|
@@ -18,7 +18,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
18
18
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
19
19
|
};
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
-
exports.TextFormatTypes = exports.MessageReactionTypes = exports.InputHints = exports.DeliveryModes = exports.CallerIdConstants = exports.ActivityTypes = exports.ActivityImportance = exports.ActivityEventNames = exports.activityZodSchema = exports.Activity = exports.RoleTypes = exports.EndOfConversationCodes = exports.Channels = exports.AttachmentLayoutTypes = exports.SemanticActionStateTypes = exports.ActionTypes = void 0;
|
|
21
|
+
exports.ActivityTreatments = exports.TextFormatTypes = exports.MessageReactionTypes = exports.InputHints = exports.DeliveryModes = exports.CallerIdConstants = exports.ActivityTypes = exports.ActivityImportance = exports.ActivityEventNames = exports.activityZodSchema = exports.Activity = exports.RoleTypes = exports.EndOfConversationCodes = exports.Channels = exports.AttachmentLayoutTypes = exports.SemanticActionStateTypes = exports.ActionTypes = void 0;
|
|
22
22
|
/**
|
|
23
23
|
* Export statements for various modules.
|
|
24
24
|
*/
|
|
@@ -34,6 +34,7 @@ var endOfConversationCodes_1 = require("./conversation/endOfConversationCodes");
|
|
|
34
34
|
Object.defineProperty(exports, "EndOfConversationCodes", { enumerable: true, get: function () { return endOfConversationCodes_1.EndOfConversationCodes; } });
|
|
35
35
|
var roleTypes_1 = require("./conversation/roleTypes");
|
|
36
36
|
Object.defineProperty(exports, "RoleTypes", { enumerable: true, get: function () { return roleTypes_1.RoleTypes; } });
|
|
37
|
+
__exportStar(require("./entity/AIEntity"), exports);
|
|
37
38
|
__exportStar(require("./invoke/adaptiveCardInvokeAction"), exports);
|
|
38
39
|
var activity_1 = require("./activity");
|
|
39
40
|
Object.defineProperty(exports, "Activity", { enumerable: true, get: function () { return activity_1.Activity; } });
|
|
@@ -54,4 +55,6 @@ var messageReactionTypes_1 = require("./messageReactionTypes");
|
|
|
54
55
|
Object.defineProperty(exports, "MessageReactionTypes", { enumerable: true, get: function () { return messageReactionTypes_1.MessageReactionTypes; } });
|
|
55
56
|
var textFormatTypes_1 = require("./textFormatTypes");
|
|
56
57
|
Object.defineProperty(exports, "TextFormatTypes", { enumerable: true, get: function () { return textFormatTypes_1.TextFormatTypes; } });
|
|
58
|
+
var activityTreatments_1 = require("./activityTreatments");
|
|
59
|
+
Object.defineProperty(exports, "ActivityTreatments", { enumerable: true, get: function () { return activityTreatments_1.ActivityTreatments; } });
|
|
57
60
|
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;AAEH;;GAEG;AACH,oDAAkD;AAAzC,0GAAA,WAAW,OAAA;AAGpB,8EAA4E;AAAnE,oIAAA,wBAAwB,OAAA;AAIjC,4EAA0E;AAAjE,8HAAA,qBAAqB,OAAA;AAG9B,oDAAkD;AAAzC,oGAAA,QAAQ,OAAA;AAGjB,gFAA8E;AAArE,gIAAA,sBAAsB,OAAA;AAE/B,sDAAoD;AAA3C,sGAAA,SAAS,OAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;AAEH;;GAEG;AACH,oDAAkD;AAAzC,0GAAA,WAAW,OAAA;AAGpB,8EAA4E;AAAnE,oIAAA,wBAAwB,OAAA;AAIjC,4EAA0E;AAAjE,8HAAA,qBAAqB,OAAA;AAG9B,oDAAkD;AAAzC,oGAAA,QAAQ,OAAA;AAGjB,gFAA8E;AAArE,gIAAA,sBAAsB,OAAA;AAE/B,sDAAoD;AAA3C,sGAAA,SAAS,OAAA;AAOlB,oDAAiC;AAEjC,oEAAiD;AAEjD,uCAAwD;AAA/C,oGAAA,QAAQ,OAAA;AAAE,6GAAA,iBAAiB,OAAA;AACpC,2DAAyD;AAAhD,wHAAA,kBAAkB,OAAA;AAC3B,2DAAyD;AAAhD,wHAAA,kBAAkB,OAAA;AAC3B,iDAA+C;AAAtC,8GAAA,aAAa,OAAA;AACtB,yDAAuD;AAA9C,sHAAA,iBAAiB,OAAA;AAC1B,iDAA+C;AAAtC,8GAAA,aAAa,OAAA;AAEtB,2CAAyC;AAAhC,wGAAA,UAAU,OAAA;AAEnB,+DAA6D;AAApD,4HAAA,oBAAoB,OAAA;AAC7B,qDAAmD;AAA1C,kHAAA,eAAe,OAAA;AAExB,2DAAyD;AAAhD,wHAAA,kBAAkB,OAAA"}
|
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.5.
|
|
4
|
+
"version": "0.5.12-g2d752e9b13",
|
|
5
5
|
"homepage": "https://github.com/microsoft/Agents-for-js",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"types": "dist/src/index.d.ts",
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"uuid": "^11.1.0",
|
|
23
|
-
"zod": "^3.25.
|
|
23
|
+
"zod": "^3.25.48"
|
|
24
24
|
},
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"files": [
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { z } from 'zod'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Enum representing treatment types for the activity.
|
|
10
|
+
*/
|
|
11
|
+
export enum ActivityTreatments {
|
|
12
|
+
/**
|
|
13
|
+
* Indicates that only the recipient should be able to see the message even if the activity
|
|
14
|
+
* is being sent to a group of people.
|
|
15
|
+
*/
|
|
16
|
+
Targeted = 'targeted',
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Zod schema for validating an ActivityTreatments enum.
|
|
21
|
+
*/
|
|
22
|
+
export const activityTreatments = z.nativeEnum(ActivityTreatments)
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { Activity } from '../activity'
|
|
7
|
+
import { Entity } from './entity'
|
|
8
|
+
|
|
9
|
+
export type ClientCitationIconName =
|
|
10
|
+
| 'Microsoft Word'
|
|
11
|
+
| 'Microsoft Excel'
|
|
12
|
+
| 'Microsoft PowerPoint'
|
|
13
|
+
| 'Microsoft OneNote'
|
|
14
|
+
| 'Microsoft SharePoint'
|
|
15
|
+
| 'Microsoft Visio'
|
|
16
|
+
| 'Microsoft Loop'
|
|
17
|
+
| 'Microsoft Whiteboard'
|
|
18
|
+
| 'Adobe Illustrator'
|
|
19
|
+
| 'Adobe Photoshop'
|
|
20
|
+
| 'Adobe InDesign'
|
|
21
|
+
| 'Adobe Flash'
|
|
22
|
+
| 'Sketch'
|
|
23
|
+
| 'Source Code'
|
|
24
|
+
| 'Image'
|
|
25
|
+
| 'GIF'
|
|
26
|
+
| 'Video'
|
|
27
|
+
| 'Sound'
|
|
28
|
+
| 'ZIP'
|
|
29
|
+
| 'Text'
|
|
30
|
+
| 'PDF'
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Represents a Teams client citation to be included in a message. See Bot messages with AI-generated content for more details.
|
|
34
|
+
* https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/bot-messages-ai-generated-content?tabs=before%2Cbotmessage
|
|
35
|
+
*/
|
|
36
|
+
export interface ClientCitation {
|
|
37
|
+
/**
|
|
38
|
+
* Required; must be "Claim"
|
|
39
|
+
*/
|
|
40
|
+
'@type': 'Claim';
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Required. Number and position of the citation.
|
|
44
|
+
*/
|
|
45
|
+
position: number;
|
|
46
|
+
appearance: {
|
|
47
|
+
/**
|
|
48
|
+
* Required; Must be 'DigitalDocument'
|
|
49
|
+
*/
|
|
50
|
+
'@type': 'DigitalDocument';
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Name of the document. (max length 80)
|
|
54
|
+
*/
|
|
55
|
+
name: string;
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Stringified adaptive card with additional information about the citation.
|
|
59
|
+
* It is rendered within the modal.
|
|
60
|
+
*/
|
|
61
|
+
text?: string;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* URL of the document. This will make the name of the citation clickable and direct the user to the specified URL.
|
|
65
|
+
*/
|
|
66
|
+
url?: string;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Extract of the referenced content. (max length 160)
|
|
70
|
+
*/
|
|
71
|
+
abstract: string;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Encoding format of the `citation.appearance.text` field.
|
|
75
|
+
*/
|
|
76
|
+
encodingFormat?: 'application/vnd.microsoft.card.adaptive';
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Information about the citation’s icon.
|
|
80
|
+
*/
|
|
81
|
+
image?: {
|
|
82
|
+
'@type': 'ImageObject';
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* The image/icon name
|
|
86
|
+
*/
|
|
87
|
+
name: ClientCitationIconName;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Optional; set by developer. (max length 3) (max keyword length 28)
|
|
92
|
+
*/
|
|
93
|
+
keywords?: string[];
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Optional sensitivity content information.
|
|
97
|
+
*/
|
|
98
|
+
usageInfo?: SensitivityUsageInfo;
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Sensitivity usage info for content sent to the user. This is used to provide information about the content to the user. See ClientCitation for more information.
|
|
104
|
+
*/
|
|
105
|
+
export interface SensitivityUsageInfo {
|
|
106
|
+
/**
|
|
107
|
+
* Must be "https://schema.org/Message"
|
|
108
|
+
*/
|
|
109
|
+
type: 'https://schema.org/Message';
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Required; Set to CreativeWork;
|
|
113
|
+
*/
|
|
114
|
+
'@type': 'CreativeWork';
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Sensitivity description of the content
|
|
118
|
+
*/
|
|
119
|
+
description?: string;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Sensitivity title of the content
|
|
123
|
+
*/
|
|
124
|
+
name: string;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Optional; ignored in Teams.
|
|
128
|
+
*/
|
|
129
|
+
position?: number;
|
|
130
|
+
|
|
131
|
+
pattern?: {
|
|
132
|
+
/**
|
|
133
|
+
* Set to DefinedTerm
|
|
134
|
+
*/
|
|
135
|
+
'@type': 'DefinedTerm';
|
|
136
|
+
|
|
137
|
+
inDefinedTermSet: string;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Color
|
|
141
|
+
*/
|
|
142
|
+
name: string;
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* e.g. #454545
|
|
146
|
+
*/
|
|
147
|
+
termCode: string;
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export interface AIEntity extends Entity {
|
|
152
|
+
/**
|
|
153
|
+
* Required as 'https://schema.org/Message'
|
|
154
|
+
*/
|
|
155
|
+
type: 'https://schema.org/Message';
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Required as 'Message
|
|
159
|
+
*/
|
|
160
|
+
'@type': 'Message';
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Required as 'https://schema.org
|
|
164
|
+
*/
|
|
165
|
+
'@context': 'https://schema.org';
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Must be left blank. This is for Bot Framework schema.
|
|
169
|
+
*/
|
|
170
|
+
'@id': '';
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Indicate that the content was generated by AI.
|
|
174
|
+
*/
|
|
175
|
+
additionalType: ['AIGeneratedContent'];
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Optional; if citations object is included, the sent activity will include the citations, referenced in the activity text.
|
|
179
|
+
*/
|
|
180
|
+
citation?: ClientCitation[];
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Optional; if usage_info object is included, the sent activity will include the sensitivity usage information.
|
|
184
|
+
*/
|
|
185
|
+
usageInfo?: SensitivityUsageInfo;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export const addAIToActivity = (activity: Activity, citations?: ClientCitation[], usageInfo?: SensitivityUsageInfo): void => {
|
|
189
|
+
const aiEntity: AIEntity = {
|
|
190
|
+
type: 'https://schema.org/Message',
|
|
191
|
+
'@type': 'Message',
|
|
192
|
+
'@context': 'https://schema.org',
|
|
193
|
+
'@id': '',
|
|
194
|
+
additionalType: ['AIGeneratedContent'],
|
|
195
|
+
citation: citations,
|
|
196
|
+
usageInfo
|
|
197
|
+
}
|
|
198
|
+
activity.entities ??= []
|
|
199
|
+
activity.entities.push(aiEntity)
|
|
200
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -28,6 +28,7 @@ export { Mention } from './entity/mention'
|
|
|
28
28
|
export { GeoCoordinates } from './entity/geoCoordinates'
|
|
29
29
|
export { Place } from './entity/place'
|
|
30
30
|
export { Thing } from './entity/thing'
|
|
31
|
+
export * from './entity/AIEntity'
|
|
31
32
|
|
|
32
33
|
export * from './invoke/adaptiveCardInvokeAction'
|
|
33
34
|
|
|
@@ -43,3 +44,4 @@ export { MessageReaction } from './messageReaction'
|
|
|
43
44
|
export { MessageReactionTypes } from './messageReactionTypes'
|
|
44
45
|
export { TextFormatTypes } from './textFormatTypes'
|
|
45
46
|
export { TextHighlight } from './textHighlight'
|
|
47
|
+
export { ActivityTreatments } from './activityTreatments'
|