@microsoft/agents-hosting 0.5.4-ga4d0401645 → 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.
Files changed (77) hide show
  1. package/dist/src/app/adaptiveCards/adaptiveCardsActions.js +4 -4
  2. package/dist/src/app/adaptiveCards/adaptiveCardsActions.js.map +1 -1
  3. package/dist/src/app/agentApplication.js +1 -1
  4. package/dist/src/app/agentApplication.js.map +1 -1
  5. package/dist/src/app/oauth/authorization.d.ts +1 -0
  6. package/dist/src/app/oauth/authorization.js +3 -4
  7. package/dist/src/app/oauth/authorization.js.map +1 -1
  8. package/dist/src/app/streaming/citation.d.ts +25 -0
  9. package/dist/src/app/streaming/{AIEntity.js → citation.js} +1 -1
  10. package/dist/src/app/streaming/citation.js.map +1 -0
  11. package/dist/src/app/streaming/{utilities.d.ts → citationUtil.d.ts} +3 -3
  12. package/dist/src/app/streaming/{utilities.js → citationUtil.js} +5 -36
  13. package/dist/src/app/streaming/citationUtil.js.map +1 -0
  14. package/dist/src/app/streaming/streamingResponse.d.ts +3 -4
  15. package/dist/src/app/streaming/streamingResponse.js +24 -22
  16. package/dist/src/app/streaming/streamingResponse.js.map +1 -1
  17. package/dist/src/cards/cardFactory.d.ts +2 -2
  18. package/dist/src/cards/cardFactory.js.map +1 -1
  19. package/dist/src/oauth/index.d.ts +1 -4
  20. package/dist/src/oauth/index.js +1 -4
  21. package/dist/src/oauth/index.js.map +1 -1
  22. package/dist/src/oauth/oAuthFlow.d.ts +9 -10
  23. package/dist/src/oauth/oAuthFlow.js +35 -38
  24. package/dist/src/oauth/oAuthFlow.js.map +1 -1
  25. package/dist/src/oauth/userTokenClient.d.ts +37 -7
  26. package/dist/src/oauth/userTokenClient.js +56 -15
  27. package/dist/src/oauth/userTokenClient.js.map +1 -1
  28. package/dist/src/oauth/userTokenClient.types.d.ts +147 -0
  29. package/dist/src/oauth/{oAuthCard.js → userTokenClient.types.js} +1 -1
  30. package/dist/src/oauth/userTokenClient.types.js.map +1 -0
  31. package/package.json +3 -3
  32. package/src/app/adaptiveCards/adaptiveCardsActions.ts +4 -4
  33. package/src/app/agentApplication.ts +1 -1
  34. package/src/app/oauth/authorization.ts +6 -8
  35. package/src/app/streaming/citation.ts +29 -0
  36. package/src/app/streaming/{utilities.ts → citationUtil.ts} +3 -35
  37. package/src/app/streaming/streamingResponse.ts +28 -27
  38. package/src/cards/cardFactory.ts +2 -3
  39. package/src/oauth/index.ts +1 -4
  40. package/src/oauth/oAuthFlow.ts +39 -45
  41. package/src/oauth/userTokenClient.ts +62 -19
  42. package/src/oauth/userTokenClient.types.ts +173 -0
  43. package/dist/src/app/streaming/AIEntity.d.ts +0 -36
  44. package/dist/src/app/streaming/AIEntity.js.map +0 -1
  45. package/dist/src/app/streaming/actionCall.d.ts +0 -33
  46. package/dist/src/app/streaming/actionCall.js +0 -7
  47. package/dist/src/app/streaming/actionCall.js.map +0 -1
  48. package/dist/src/app/streaming/clientCitation.d.ts +0 -68
  49. package/dist/src/app/streaming/clientCitation.js +0 -10
  50. package/dist/src/app/streaming/clientCitation.js.map +0 -1
  51. package/dist/src/app/streaming/message.d.ts +0 -106
  52. package/dist/src/app/streaming/message.js +0 -7
  53. package/dist/src/app/streaming/message.js.map +0 -1
  54. package/dist/src/app/streaming/sensitivityUsageInfo.d.ts +0 -40
  55. package/dist/src/app/streaming/sensitivityUsageInfo.js +0 -3
  56. package/dist/src/app/streaming/sensitivityUsageInfo.js.map +0 -1
  57. package/dist/src/app/streaming/utilities.js.map +0 -1
  58. package/dist/src/oauth/oAuthCard.d.ts +0 -27
  59. package/dist/src/oauth/oAuthCard.js.map +0 -1
  60. package/dist/src/oauth/signingResource.d.ts +0 -43
  61. package/dist/src/oauth/signingResource.js +0 -5
  62. package/dist/src/oauth/signingResource.js.map +0 -1
  63. package/dist/src/oauth/tokenExchangeRequest.d.ts +0 -17
  64. package/dist/src/oauth/tokenExchangeRequest.js +0 -5
  65. package/dist/src/oauth/tokenExchangeRequest.js.map +0 -1
  66. package/dist/src/oauth/tokenResponse.d.ts +0 -29
  67. package/dist/src/oauth/tokenResponse.js +0 -25
  68. package/dist/src/oauth/tokenResponse.js.map +0 -1
  69. package/src/app/streaming/AIEntity.ts +0 -44
  70. package/src/app/streaming/actionCall.ts +0 -37
  71. package/src/app/streaming/clientCitation.ts +0 -102
  72. package/src/app/streaming/message.ts +0 -125
  73. package/src/app/streaming/sensitivityUsageInfo.ts +0 -48
  74. package/src/oauth/oAuthCard.ts +0 -30
  75. package/src/oauth/signingResource.ts +0 -48
  76. package/src/oauth/tokenExchangeRequest.ts +0 -20
  77. package/src/oauth/tokenResponse.ts +0 -43
@@ -1,25 +0,0 @@
1
- "use strict";
2
- // Copyright (c) Microsoft Corporation. All rights reserved.
3
- // Licensed under the MIT License.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.TokenRequestStatus = void 0;
6
- /**
7
- * Represents the status of an OAuth token request.
8
- */
9
- var TokenRequestStatus;
10
- (function (TokenRequestStatus) {
11
- /**
12
- * Indicates that the token request was successful.
13
- */
14
- TokenRequestStatus["Success"] = "Success";
15
- /**
16
- * Indicates that the token request failed.
17
- */
18
- TokenRequestStatus["Failed"] = "Failed";
19
- /**
20
- * Indicates that the token request is pending.
21
- */
22
- TokenRequestStatus["InProgress"] = "InProgress";
23
- TokenRequestStatus["Expired"] = "Expired";
24
- })(TokenRequestStatus || (exports.TokenRequestStatus = TokenRequestStatus = {}));
25
- //# sourceMappingURL=tokenResponse.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tokenResponse.js","sourceRoot":"","sources":["../../../src/oauth/tokenResponse.ts"],"names":[],"mappings":";AAAA,4DAA4D;AAC5D,kCAAkC;;;AAElC;;GAEG;AACH,IAAY,kBAiBX;AAjBD,WAAY,kBAAkB;IAC5B;;OAEG;IACH,yCAAmB,CAAA;IAEnB;;OAEG;IACH,uCAAiB,CAAA;IAEjB;;OAEG;IACH,+CAAyB,CAAA;IAEzB,yCAAmB,CAAA;AACrB,CAAC,EAjBW,kBAAkB,kCAAlB,kBAAkB,QAiB7B"}
@@ -1,44 +0,0 @@
1
- /**
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
-
6
- import { ClientCitation } from './clientCitation'
7
- import { SensitivityUsageInfo } from './sensitivityUsageInfo'
8
-
9
- export interface AIEntity {
10
- /**
11
- * Required as 'https://schema.org/Message'
12
- */
13
- type: 'https://schema.org/Message';
14
-
15
- /**
16
- * Required as 'Message
17
- */
18
- '@type': 'Message';
19
-
20
- /**
21
- * Required as 'https://schema.org
22
- */
23
- '@context': 'https://schema.org';
24
-
25
- /**
26
- * Must be left blank. This is for Bot Framework schema.
27
- */
28
- '@id': '';
29
-
30
- /**
31
- * Indicate that the content was generated by AI.
32
- */
33
- additionalType: ['AIGeneratedContent'];
34
-
35
- /**
36
- * Optional; if citations object is included, the sent activity will include the citations, referenced in the activity text.
37
- */
38
- citation?: ClientCitation[];
39
-
40
- /**
41
- * Optional; if usage_info object is included, the sent activity will include the sensitivity usage information.
42
- */
43
- usageInfo?: SensitivityUsageInfo;
44
- }
@@ -1,37 +0,0 @@
1
- /**
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
-
6
- /**
7
- * An action call to be requested by the LLM model. This type is a generic meant to be the equivalent of OpenAI's [`ChatCompletionMessageToolCall`](https://github.com/openai/openai-node/blob/master/src/resources/chat/completions.ts#L477), but is not tied to OpenAI's implementation in order to allow for flexibility for other models in the future.
8
- */
9
- export interface ActionCall {
10
- /**
11
- * The ID of the tool call.
12
- */
13
- id: string;
14
-
15
- /**
16
- * The function that the model called.
17
- */
18
- function: {
19
- /**
20
- * The name of the function.
21
- */
22
- name: string;
23
-
24
- /**
25
- * The arguments to call the function with, as generated by the model in JSON
26
- * format. Note that the model does not always generate valid JSON, and may
27
- * hallucinate parameters not defined by your function schema. Validate the
28
- * arguments in your code before calling your function.
29
- */
30
- arguments: string;
31
- };
32
-
33
- /**
34
- * The type of the tool. Currently, only `function` is supported.
35
- */
36
- type: 'function';
37
- }
@@ -1,102 +0,0 @@
1
- /**
2
- * @module teams-ai
3
- */
4
- /**
5
- * Copyright (c) Microsoft Corporation. All rights reserved.
6
- * Licensed under the MIT License.
7
- */
8
-
9
- import { SensitivityUsageInfo } from './sensitivityUsageInfo'
10
-
11
- export type ClientCitationIconName =
12
- | 'Microsoft Word'
13
- | 'Microsoft Excel'
14
- | 'Microsoft PowerPoint'
15
- | 'Microsoft OneNote'
16
- | 'Microsoft SharePoint'
17
- | 'Microsoft Visio'
18
- | 'Microsoft Loop'
19
- | 'Microsoft Whiteboard'
20
- | 'Adobe Illustrator'
21
- | 'Adobe Photoshop'
22
- | 'Adobe InDesign'
23
- | 'Adobe Flash'
24
- | 'Sketch'
25
- | 'Source Code'
26
- | 'Image'
27
- | 'GIF'
28
- | 'Video'
29
- | 'Sound'
30
- | 'ZIP'
31
- | 'Text'
32
- | 'PDF'
33
-
34
- /**
35
- * Represents a Teams client citation to be included in a message. See Bot messages with AI-generated content for more details.
36
- * https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/bot-messages-ai-generated-content?tabs=before%2Cbotmessage
37
- */
38
- export interface ClientCitation {
39
- /**
40
- * Required; must be "Claim"
41
- */
42
- '@type': 'Claim';
43
-
44
- /**
45
- * Required. Number and position of the citation.
46
- */
47
- position: number;
48
- appearance: {
49
- /**
50
- * Required; Must be 'DigitalDocument'
51
- */
52
- '@type': 'DigitalDocument';
53
-
54
- /**
55
- * Name of the document. (max length 80)
56
- */
57
- name: string;
58
-
59
- /**
60
- * Stringified adaptive card with additional information about the citation.
61
- * It is rendered within the modal.
62
- */
63
- text?: string;
64
-
65
- /**
66
- * URL of the document. This will make the name of the citation clickable and direct the user to the specified URL.
67
- */
68
- url?: string;
69
-
70
- /**
71
- * Extract of the referenced content. (max length 160)
72
- */
73
- abstract: string;
74
-
75
- /**
76
- * Encoding format of the `citation.appearance.text` field.
77
- */
78
- encodingFormat?: 'application/vnd.microsoft.card.adaptive';
79
-
80
- /**
81
- * Information about the citation’s icon.
82
- */
83
- image?: {
84
- '@type': 'ImageObject';
85
-
86
- /**
87
- * The image/icon name
88
- */
89
- name: ClientCitationIconName;
90
- };
91
-
92
- /**
93
- * Optional; set by developer. (max length 3) (max keyword length 28)
94
- */
95
- keywords?: string[];
96
-
97
- /**
98
- * Optional sensitivity content information.
99
- */
100
- usageInfo?: SensitivityUsageInfo;
101
- };
102
- }
@@ -1,125 +0,0 @@
1
- /**
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the MIT License.
4
- */
5
-
6
- import { ActionCall } from './actionCall'
7
-
8
- /**
9
- * A message object sent to or received from an LLM.
10
- * @param TContent Optional. Type of the message content. Defaults to `string`
11
- */
12
- export interface Message<TContent = string> {
13
- /**
14
- * The messages role. Typically 'system', 'user', 'assistant', 'tool', 'function'.
15
- */
16
- role: string;
17
-
18
- /**
19
- * Text of the message.
20
- */
21
- content: TContent | undefined;
22
-
23
- /**
24
- * Optional. A named function to call.
25
- */
26
- function_call?: FunctionCall;
27
-
28
- /**
29
- * The context used for the message.
30
- */
31
- context?: MessageContext;
32
-
33
- /**
34
- * Optional. Name of the function that was called.
35
- */
36
- name?: string;
37
-
38
- /**
39
- * Optional. The action or tool to be called by the model when using 'tools' augmentation. In OpenAI, this is the tool_calls property returned from the model.
40
- */
41
- action_calls?: ActionCall[];
42
-
43
- /**
44
- * Optional. The id of the action called.
45
- */
46
- action_call_id?: string | undefined;
47
- }
48
-
49
- /**
50
- * A named function to call.
51
- */
52
- export interface FunctionCall {
53
- /**
54
- * Name of the function to call.
55
- */
56
- name?: string;
57
-
58
- /**
59
- * Optional. Arguments to pass to the function. Must be deserialized.
60
- */
61
- arguments?: string;
62
- }
63
-
64
- export type MessageContentParts = TextContentPart | ImageContentPart
65
-
66
- export interface TextContentPart {
67
- /**
68
- * Type of the message content. Should always be 'text'.
69
- */
70
- type: 'text';
71
-
72
- /**
73
- * The text of the message.
74
- */
75
- text: string;
76
- }
77
-
78
- export interface ImageContentPart {
79
- /**
80
- * Type of the message content. Should always be 'image_url'.
81
- */
82
- type: 'image_url';
83
-
84
- /**
85
- * The URL of the image.
86
- */
87
- image_url: string | { url: string };
88
- }
89
-
90
- /**
91
- * Citations returned by the model.
92
- */
93
- export interface Citation {
94
- /**
95
- * The content of the citation.
96
- */
97
- content: string;
98
-
99
- /**
100
- * The title of the citation.
101
- */
102
- title: string | null;
103
-
104
- /**
105
- * The URL of the citation.
106
- */
107
- url: string | null;
108
-
109
- /**
110
- * The filepath of the document.
111
- */
112
- filepath: string | null;
113
- }
114
-
115
- export interface MessageContext {
116
- /**
117
- * Citations used in the message.
118
- */
119
- citations: Citation[];
120
-
121
- /**
122
- * The intent of the message (what the user wrote).
123
- */
124
- intent: string;
125
- }
@@ -1,48 +0,0 @@
1
- /**
2
- * 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.
3
- */
4
- export interface SensitivityUsageInfo {
5
- /**
6
- * Must be "https://schema.org/Message"
7
- */
8
- type: 'https://schema.org/Message';
9
-
10
- /**
11
- * Required; Set to CreativeWork;
12
- */
13
- '@type': 'CreativeWork';
14
-
15
- /**
16
- * Sensitivity description of the content
17
- */
18
- description?: string;
19
-
20
- /**
21
- * Sensitivity title of the content
22
- */
23
- name: string;
24
-
25
- /**
26
- * Optional; ignored in Teams.
27
- */
28
- position?: number;
29
-
30
- pattern?: {
31
- /**
32
- * Set to DefinedTerm
33
- */
34
- '@type': 'DefinedTerm';
35
-
36
- inDefinedTermSet: string;
37
-
38
- /**
39
- * Color
40
- */
41
- name: string;
42
-
43
- /**
44
- * e.g. #454545
45
- */
46
- termCode: string;
47
- };
48
- }
@@ -1,30 +0,0 @@
1
- // Copyright (c) Microsoft Corporation. All rights reserved.
2
- // Licensed under the MIT License.
3
-
4
- import { CardAction } from '@microsoft/agents-activity'
5
- import { TokenExchangeResource, TokenPostResource } from './signingResource'
6
- /**
7
- * Represents an OAuth card.
8
- */
9
- export interface OAuthCard {
10
- /**
11
- * The buttons associated with the OAuth card.
12
- */
13
- buttons: CardAction[]
14
- /**
15
- * The connection name for the OAuth card.
16
- */
17
- connectionName: string
18
- /**
19
- * The text content of the OAuth card.
20
- */
21
- text: string
22
- /**
23
- * The token exchange resource for the OAuth card.
24
- */
25
- tokenExchangeResource: TokenExchangeResource
26
- /**
27
- * The token post resource for the OAuth card.
28
- */
29
- tokenPostResource: TokenPostResource
30
- }
@@ -1,48 +0,0 @@
1
- // Copyright (c) Microsoft Corporation. All rights reserved.
2
- // Licensed under the MIT License.
3
-
4
- /**
5
- * Represents a resource for exchanging tokens.
6
- */
7
- export interface TokenExchangeResource {
8
- /**
9
- * The ID of the token exchange resource.
10
- */
11
- id?: string
12
- /**
13
- * The URI of the token exchange resource.
14
- */
15
- uri?: string
16
- /**
17
- * The provider ID for the token exchange resource.
18
- */
19
- providerId?: string
20
- }
21
-
22
- /**
23
- * Represents a resource for posting tokens.
24
- */
25
- export interface TokenPostResource {
26
- /**
27
- * The SAS URL for the token post resource.
28
- */
29
- sasUrl?: string
30
- }
31
-
32
- /**
33
- * Represents a resource for signing in.
34
- */
35
- export interface SigningResource {
36
- /**
37
- * The link for signing in.
38
- */
39
- signInLink: string,
40
- /**
41
- * The resource for token exchange.
42
- */
43
- tokenExchangeResource: TokenExchangeResource,
44
- /**
45
- * The resource for token post.
46
- */
47
- tokenPostResource: TokenPostResource
48
- }
@@ -1,20 +0,0 @@
1
- // Copyright (c) Microsoft Corporation. All rights reserved.
2
- // Licensed under the MIT License.
3
-
4
- /**
5
- * Represents a request for exchanging tokens.
6
- */
7
- export interface TokenExchangeRequest {
8
- /**
9
- * The URI for the token exchange request.
10
- */
11
- uri?: string
12
- /**
13
- * The token to be exchanged.
14
- */
15
- token?: string
16
- /**
17
- * The ID associated with the token exchange request.
18
- */
19
- id?: string
20
- }
@@ -1,43 +0,0 @@
1
- // Copyright (c) Microsoft Corporation. All rights reserved.
2
- // Licensed under the MIT License.
3
-
4
- /**
5
- * Represents the status of an OAuth token request.
6
- */
7
- export enum TokenRequestStatus {
8
- /**
9
- * Indicates that the token request was successful.
10
- */
11
- Success = 'Success',
12
-
13
- /**
14
- * Indicates that the token request failed.
15
- */
16
- Failed = 'Failed',
17
-
18
- /**
19
- * Indicates that the token request is pending.
20
- */
21
- InProgress = 'InProgress',
22
-
23
- Expired = 'Expired',
24
- }
25
-
26
- /**
27
- * Represents the response containing OAuth token information.
28
- * This interface encapsulates all data related to an OAuth token response.
29
- */
30
- export interface TokenResponse {
31
-
32
- status: TokenRequestStatus
33
-
34
- /**
35
- * The OAuth token string, or null if no token is available.
36
- */
37
- token: string | undefined
38
-
39
- /**
40
- * The expiration time of the token, represented as a numeric timestamp.
41
- */
42
- // expires: number
43
- }