@cuylabs/channel-teams 0.4.0
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/LICENSE +201 -0
- package/README.md +77 -0
- package/dist/chunk-B5KRH22J.js +12 -0
- package/dist/chunk-HI2TMD6D.js +43 -0
- package/dist/chunk-KRYOYRKW.js +20 -0
- package/dist/chunk-VC7GUFOR.js +328 -0
- package/dist/extensions.d.ts +1 -0
- package/dist/extensions.js +10 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +78 -0
- package/dist/invoke.d.ts +11 -0
- package/dist/invoke.js +8 -0
- package/dist/responses.d.ts +59 -0
- package/dist/responses.js +12 -0
- package/dist/teams-activity-BKFY1qUk.d.ts +87 -0
- package/dist/teams-activity.d.ts +4 -0
- package/dist/teams-activity.js +55 -0
- package/package.json +85 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# @cuylabs/channel-teams
|
|
2
|
+
|
|
3
|
+
Teams channel primitives for parsing Microsoft Teams activities, detecting
|
|
4
|
+
Teams invoke routes, building invoke responses, and using a curated subset of
|
|
5
|
+
Microsoft Teams SDK helpers.
|
|
6
|
+
|
|
7
|
+
This package does not create or run an agent. Use it when your application owns
|
|
8
|
+
the runtime but wants reusable Teams mechanics.
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install @cuylabs/channel-teams
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Most hosts that use the invoke helpers also install the Microsoft activity and
|
|
17
|
+
hosting packages:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install @microsoft/agents-activity @microsoft/agents-hosting @microsoft/agents-hosting-extensions-teams
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Parse A Teams Activity
|
|
24
|
+
|
|
25
|
+
```typescript
|
|
26
|
+
import { parseTeamsActivity } from "@cuylabs/channel-teams";
|
|
27
|
+
|
|
28
|
+
const teams = parseTeamsActivity(turnContext, {
|
|
29
|
+
strictChannelData: false,
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
if (teams.kind === "message-extension-query") {
|
|
33
|
+
// Route the compose extension query in your own host.
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
`parseTeamsActivity` returns normalized Teams metadata:
|
|
38
|
+
|
|
39
|
+
```json
|
|
40
|
+
{
|
|
41
|
+
"channelId": "msteams",
|
|
42
|
+
"conversationId": "conversation-1",
|
|
43
|
+
"invokeName": "composeExtension/query",
|
|
44
|
+
"tenantId": "tenant-1",
|
|
45
|
+
"teamId": "team-1",
|
|
46
|
+
"channelThreadId": "channel-1",
|
|
47
|
+
"surface": "channel",
|
|
48
|
+
"kind": "message-extension-query",
|
|
49
|
+
"targeted": false
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Build Invoke Responses
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
import {
|
|
57
|
+
createTeamsSearchResult,
|
|
58
|
+
sendTeamsInvoke,
|
|
59
|
+
} from "@cuylabs/channel-teams";
|
|
60
|
+
|
|
61
|
+
await sendTeamsInvoke(
|
|
62
|
+
turnContext,
|
|
63
|
+
createTeamsSearchResult({
|
|
64
|
+
layout: "list",
|
|
65
|
+
text: "No matching records",
|
|
66
|
+
}),
|
|
67
|
+
);
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Subpaths
|
|
71
|
+
|
|
72
|
+
```typescript
|
|
73
|
+
import { parseTeamsActivity } from "@cuylabs/channel-teams/activity";
|
|
74
|
+
import { TeamsInfo } from "@cuylabs/channel-teams/extensions";
|
|
75
|
+
import { sendTeamsInvoke } from "@cuylabs/channel-teams/invoke";
|
|
76
|
+
import { createTeamsDialog } from "@cuylabs/channel-teams/responses";
|
|
77
|
+
```
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// src/extensions.ts
|
|
2
|
+
import {
|
|
3
|
+
TeamsAttachmentDownloader,
|
|
4
|
+
TeamsInfo
|
|
5
|
+
} from "@microsoft/agents-hosting-extensions-teams";
|
|
6
|
+
import { parseTeamsChannelData } from "@microsoft/agents-hosting-extensions-teams";
|
|
7
|
+
|
|
8
|
+
export {
|
|
9
|
+
TeamsAttachmentDownloader,
|
|
10
|
+
TeamsInfo,
|
|
11
|
+
parseTeamsChannelData
|
|
12
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// src/responses.ts
|
|
2
|
+
function createTeamsSearchResult(result) {
|
|
3
|
+
return {
|
|
4
|
+
composeExtension: {
|
|
5
|
+
...result.type ? { type: result.type } : { type: "result" },
|
|
6
|
+
...result.layout ? { attachmentLayout: result.layout } : {},
|
|
7
|
+
...result.attachments ? { attachments: result.attachments } : {},
|
|
8
|
+
...result.text ? { text: result.text } : {},
|
|
9
|
+
...result.preview ? { activityPreview: result.preview } : {}
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function createTeamsSearchMessage(text) {
|
|
14
|
+
return {
|
|
15
|
+
composeExtension: {
|
|
16
|
+
type: "message",
|
|
17
|
+
text
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function createTeamsDialog(dialog) {
|
|
22
|
+
return {
|
|
23
|
+
task: {
|
|
24
|
+
type: "continue",
|
|
25
|
+
value: dialog
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
function createTeamsDialogMessage(message) {
|
|
30
|
+
return {
|
|
31
|
+
task: {
|
|
32
|
+
type: "message",
|
|
33
|
+
value: message
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export {
|
|
39
|
+
createTeamsSearchResult,
|
|
40
|
+
createTeamsSearchMessage,
|
|
41
|
+
createTeamsDialog,
|
|
42
|
+
createTeamsDialogMessage
|
|
43
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// src/invoke.ts
|
|
2
|
+
import { Activity, ActivityTypes } from "@microsoft/agents-activity";
|
|
3
|
+
function createTeamsInvokeActivity(result) {
|
|
4
|
+
const activity = new Activity(ActivityTypes.InvokeResponse);
|
|
5
|
+
activity.value = result.body === void 0 ? { status: result.status } : { status: result.status, body: result.body };
|
|
6
|
+
return activity;
|
|
7
|
+
}
|
|
8
|
+
async function sendTeamsInvoke(context, body, status = 200) {
|
|
9
|
+
await context.sendActivity(
|
|
10
|
+
createTeamsInvokeActivity({
|
|
11
|
+
status,
|
|
12
|
+
...body === void 0 ? {} : { body }
|
|
13
|
+
})
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export {
|
|
18
|
+
createTeamsInvokeActivity,
|
|
19
|
+
sendTeamsInvoke
|
|
20
|
+
};
|
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
import {
|
|
2
|
+
parseTeamsChannelData
|
|
3
|
+
} from "./chunk-B5KRH22J.js";
|
|
4
|
+
|
|
5
|
+
// src/teams-activity.ts
|
|
6
|
+
import {
|
|
7
|
+
ActivityTreatments,
|
|
8
|
+
ActivityTypes
|
|
9
|
+
} from "@microsoft/agents-activity";
|
|
10
|
+
var ACTIVITY_TREATMENT_ENTITY_TYPE = "activityTreatment";
|
|
11
|
+
function isTargetedTreatmentEntity(entity) {
|
|
12
|
+
const value = asObject(entity);
|
|
13
|
+
return value?.type === ACTIVITY_TREATMENT_ENTITY_TYPE && value.treatment === ActivityTreatments.Targeted;
|
|
14
|
+
}
|
|
15
|
+
function isTargetedTeamsActivity(context) {
|
|
16
|
+
const activity = context.activity;
|
|
17
|
+
const entities = activity?.entities;
|
|
18
|
+
if (!Array.isArray(entities)) return false;
|
|
19
|
+
return entities.some(isTargetedTreatmentEntity);
|
|
20
|
+
}
|
|
21
|
+
function makeTargetedTeamsActivity(activity) {
|
|
22
|
+
const entities = Array.isArray(activity.entities) ? activity.entities : [];
|
|
23
|
+
if (!entities.some(isTargetedTreatmentEntity)) {
|
|
24
|
+
activity.entities = [
|
|
25
|
+
...entities,
|
|
26
|
+
{
|
|
27
|
+
type: ACTIVITY_TREATMENT_ENTITY_TYPE,
|
|
28
|
+
treatment: ActivityTreatments.Targeted
|
|
29
|
+
}
|
|
30
|
+
];
|
|
31
|
+
}
|
|
32
|
+
return activity;
|
|
33
|
+
}
|
|
34
|
+
function asObject(value) {
|
|
35
|
+
return value && typeof value === "object" ? value : void 0;
|
|
36
|
+
}
|
|
37
|
+
function readString(value, key) {
|
|
38
|
+
const candidate = value?.[key];
|
|
39
|
+
return typeof candidate === "string" && candidate.trim() ? candidate : void 0;
|
|
40
|
+
}
|
|
41
|
+
function detectSurface(conversationType, meetingId, teamId) {
|
|
42
|
+
if (meetingId) return "meeting";
|
|
43
|
+
if (teamId) return "channel";
|
|
44
|
+
if (conversationType === "personal") return "personal";
|
|
45
|
+
if (conversationType === "groupChat") return "group";
|
|
46
|
+
return "unknown";
|
|
47
|
+
}
|
|
48
|
+
function includesName(names, candidate) {
|
|
49
|
+
return !!candidate && names.includes(candidate);
|
|
50
|
+
}
|
|
51
|
+
function parseTypedChannelData(channelData, options = {}) {
|
|
52
|
+
if (!channelData) return void 0;
|
|
53
|
+
try {
|
|
54
|
+
return parseTeamsChannelData(channelData);
|
|
55
|
+
} catch (error) {
|
|
56
|
+
if (options.strictChannelData ?? true) {
|
|
57
|
+
throw error;
|
|
58
|
+
}
|
|
59
|
+
return void 0;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
var TEAMS_CONFIG_FETCH_NAMES = ["config/fetch"];
|
|
63
|
+
var TEAMS_CONFIG_SUBMIT_NAMES = ["config/submit"];
|
|
64
|
+
var TEAMS_FILE_CONSENT_NAMES = ["fileConsent/invoke"];
|
|
65
|
+
var TEAMS_ACTIONABLE_MESSAGE_NAMES = [
|
|
66
|
+
"actionableMessage/executeAction"
|
|
67
|
+
];
|
|
68
|
+
var TEAMS_ADAPTIVE_CARD_ACTION_NAMES = [
|
|
69
|
+
"adaptiveCard/action"
|
|
70
|
+
];
|
|
71
|
+
var TEAMS_ADAPTIVE_CARD_SEARCH_NAMES = ["application/search"];
|
|
72
|
+
var TEAMS_TASK_MODULE_FETCH_NAMES = [
|
|
73
|
+
"task/fetch",
|
|
74
|
+
"composeExtension/fetchTask"
|
|
75
|
+
];
|
|
76
|
+
var TEAMS_TASK_MODULE_SUBMIT_NAMES = ["task/submit"];
|
|
77
|
+
var TEAMS_TAB_FETCH_NAMES = ["tab/fetch"];
|
|
78
|
+
var TEAMS_TAB_SUBMIT_NAMES = ["tab/submit"];
|
|
79
|
+
var TEAMS_MESSAGE_EXTENSION_QUERY_NAMES = [
|
|
80
|
+
"composeExtension/query",
|
|
81
|
+
"composeExtension/queryLink",
|
|
82
|
+
"composeExtension/anonymousQueryLink"
|
|
83
|
+
];
|
|
84
|
+
var TEAMS_MESSAGE_EXTENSION_SUBMIT_ACTION_NAMES = [
|
|
85
|
+
"composeExtension/submitAction"
|
|
86
|
+
];
|
|
87
|
+
var TEAMS_MESSAGE_EXTENSION_FETCH_TASK_NAMES = [
|
|
88
|
+
"composeExtension/fetchTask"
|
|
89
|
+
];
|
|
90
|
+
var TEAMS_MESSAGE_EXTENSION_QUERY_SETTING_URL_NAMES = [
|
|
91
|
+
"composeExtension/querySettingUrl"
|
|
92
|
+
];
|
|
93
|
+
var TEAMS_MESSAGE_EXTENSION_SETTING_NAMES = [
|
|
94
|
+
"composeExtension/setting"
|
|
95
|
+
];
|
|
96
|
+
var TEAMS_MESSAGE_EXTENSION_CARD_BUTTON_CLICKED_NAMES = [
|
|
97
|
+
"composeExtension/onCardButtonClicked"
|
|
98
|
+
];
|
|
99
|
+
var TEAMS_MESSAGE_EXTENSION_SELECT_NAMES = [
|
|
100
|
+
"composeExtension/selectItem"
|
|
101
|
+
];
|
|
102
|
+
var TEAMS_CARD_ACTION_SUBMIT_NAMES = ["message/submitAction"];
|
|
103
|
+
var TEAMS_CONVERSATION_UPDATE_EVENT_NAMES = {
|
|
104
|
+
channelCreated: "channel-created",
|
|
105
|
+
channelDeleted: "channel-deleted",
|
|
106
|
+
channelRenamed: "channel-renamed",
|
|
107
|
+
channelRestored: "channel-restored",
|
|
108
|
+
channelShared: "channel-shared",
|
|
109
|
+
channelUnshared: "channel-unshared",
|
|
110
|
+
teamRenamed: "team-renamed",
|
|
111
|
+
teamArchived: "team-archived",
|
|
112
|
+
teamUnarchived: "team-unarchived",
|
|
113
|
+
teamDeleted: "team-deleted",
|
|
114
|
+
teamHardDeleted: "team-hard-deleted",
|
|
115
|
+
teamRestored: "team-restored"
|
|
116
|
+
};
|
|
117
|
+
var TEAMS_MEETING_EVENT_NAMES = {
|
|
118
|
+
"application/vnd.microsoft.readReceipt": "read-receipt",
|
|
119
|
+
"application/vnd.microsoft.meetingStart": "meeting-start",
|
|
120
|
+
"application/vnd.microsoft.meetingEnd": "meeting-end",
|
|
121
|
+
"application/vnd.microsoft.meetingParticipantJoin": "participants-join",
|
|
122
|
+
"application/vnd.microsoft.meetingParticipantLeave": "participants-leave",
|
|
123
|
+
"application/vnd.microsoft.meetingRoomJoin": "meeting-room-join",
|
|
124
|
+
"application/vnd.microsoft.meetingRoomLeave": "meeting-room-leave",
|
|
125
|
+
"application/vnd.microsoft.meetingReaction": "meeting-reaction",
|
|
126
|
+
"application/vnd.microsoft.meetingPollResponse": "meeting-poll-response",
|
|
127
|
+
"application/vnd.microsoft.meetingAppsInstalled": "meeting-apps-installed",
|
|
128
|
+
"application/vnd.microsoft.meetingAppsUninstalled": "meeting-apps-uninstalled",
|
|
129
|
+
"application/vnd.microsoft.meetingRecordingStarted": "meeting-recording-started",
|
|
130
|
+
"application/vnd.microsoft.meetingRecordingStopped": "meeting-recording-stopped",
|
|
131
|
+
"application/vnd.microsoft.meetingFocusChange": "meeting-focus-change",
|
|
132
|
+
"application/vnd.microsoft.meetingScreenShareStart": "meeting-screen-share-start",
|
|
133
|
+
"application/vnd.microsoft.meetingScreenShareStop": "meeting-screen-share-stop"
|
|
134
|
+
};
|
|
135
|
+
var TEAMS_MEETING_INVOKE_NAMES = {
|
|
136
|
+
"application/vnd.microsoft.meetingStageView": "meeting-stage-view",
|
|
137
|
+
"application/vnd.microsoft.meetingSmartReply": "meeting-smart-reply"
|
|
138
|
+
};
|
|
139
|
+
function detectKind(context, eventType) {
|
|
140
|
+
const { activity } = context;
|
|
141
|
+
const payload = asObject(activity.value);
|
|
142
|
+
const invokeName = activity.name;
|
|
143
|
+
switch (activity.type) {
|
|
144
|
+
case ActivityTypes.Message:
|
|
145
|
+
return "message";
|
|
146
|
+
case ActivityTypes.MessageReaction:
|
|
147
|
+
return "reaction";
|
|
148
|
+
case ActivityTypes.ConversationUpdate:
|
|
149
|
+
if (Array.isArray(activity.membersAdded) && activity.membersAdded.length > 0) {
|
|
150
|
+
return "members-added";
|
|
151
|
+
}
|
|
152
|
+
if (Array.isArray(activity.membersRemoved) && activity.membersRemoved.length > 0) {
|
|
153
|
+
return "members-removed";
|
|
154
|
+
}
|
|
155
|
+
if (eventType && eventType in TEAMS_CONVERSATION_UPDATE_EVENT_NAMES) {
|
|
156
|
+
return TEAMS_CONVERSATION_UPDATE_EVENT_NAMES[eventType];
|
|
157
|
+
}
|
|
158
|
+
return "conversation-update";
|
|
159
|
+
case ActivityTypes.MessageUpdate:
|
|
160
|
+
if (eventType === "editMessage") return "message-edit";
|
|
161
|
+
if (eventType === "undeleteMessage") return "message-restore";
|
|
162
|
+
return "other";
|
|
163
|
+
case ActivityTypes.MessageDelete:
|
|
164
|
+
if (eventType === "softDeleteMessage") return "message-delete";
|
|
165
|
+
return "other";
|
|
166
|
+
case ActivityTypes.Event:
|
|
167
|
+
if (invokeName && invokeName in TEAMS_MEETING_EVENT_NAMES) {
|
|
168
|
+
return TEAMS_MEETING_EVENT_NAMES[invokeName];
|
|
169
|
+
}
|
|
170
|
+
return "other";
|
|
171
|
+
case ActivityTypes.Invoke:
|
|
172
|
+
if (invokeName && invokeName in TEAMS_MEETING_INVOKE_NAMES) {
|
|
173
|
+
return TEAMS_MEETING_INVOKE_NAMES[invokeName];
|
|
174
|
+
}
|
|
175
|
+
if (includesName(TEAMS_CONFIG_FETCH_NAMES, invokeName)) {
|
|
176
|
+
return "config-fetch";
|
|
177
|
+
}
|
|
178
|
+
if (includesName(TEAMS_CONFIG_SUBMIT_NAMES, invokeName)) {
|
|
179
|
+
return "config-submit";
|
|
180
|
+
}
|
|
181
|
+
if (includesName(TEAMS_FILE_CONSENT_NAMES, invokeName)) {
|
|
182
|
+
return "file-consent";
|
|
183
|
+
}
|
|
184
|
+
if (includesName(TEAMS_ACTIONABLE_MESSAGE_NAMES, invokeName)) {
|
|
185
|
+
return "actionable-message-execute-action";
|
|
186
|
+
}
|
|
187
|
+
if (includesName(TEAMS_ADAPTIVE_CARD_ACTION_NAMES, invokeName)) {
|
|
188
|
+
return "adaptive-card-action";
|
|
189
|
+
}
|
|
190
|
+
if (includesName(TEAMS_ADAPTIVE_CARD_SEARCH_NAMES, invokeName)) {
|
|
191
|
+
return "adaptive-card-search";
|
|
192
|
+
}
|
|
193
|
+
if (includesName(TEAMS_TASK_MODULE_FETCH_NAMES, invokeName)) {
|
|
194
|
+
return invokeName === "composeExtension/fetchTask" ? "message-extension-fetch-task" : "task-fetch";
|
|
195
|
+
}
|
|
196
|
+
if (includesName(TEAMS_TASK_MODULE_SUBMIT_NAMES, invokeName)) {
|
|
197
|
+
return "task-submit";
|
|
198
|
+
}
|
|
199
|
+
if (includesName(TEAMS_TAB_FETCH_NAMES, invokeName)) {
|
|
200
|
+
return "tab-fetch";
|
|
201
|
+
}
|
|
202
|
+
if (includesName(TEAMS_TAB_SUBMIT_NAMES, invokeName)) {
|
|
203
|
+
return "tab-submit";
|
|
204
|
+
}
|
|
205
|
+
if (includesName(TEAMS_MESSAGE_EXTENSION_QUERY_NAMES, invokeName)) {
|
|
206
|
+
switch (invokeName) {
|
|
207
|
+
case "composeExtension/queryLink":
|
|
208
|
+
return "message-extension-query-link";
|
|
209
|
+
case "composeExtension/anonymousQueryLink":
|
|
210
|
+
return "message-extension-anonymous-query-link";
|
|
211
|
+
default:
|
|
212
|
+
return "message-extension-query";
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
if (includesName(TEAMS_MESSAGE_EXTENSION_SELECT_NAMES, invokeName)) {
|
|
216
|
+
return "message-extension-select-item";
|
|
217
|
+
}
|
|
218
|
+
if (includesName(TEAMS_MESSAGE_EXTENSION_SUBMIT_ACTION_NAMES, invokeName)) {
|
|
219
|
+
return "message-extension-submit-action";
|
|
220
|
+
}
|
|
221
|
+
if (includesName(
|
|
222
|
+
TEAMS_MESSAGE_EXTENSION_QUERY_SETTING_URL_NAMES,
|
|
223
|
+
invokeName
|
|
224
|
+
)) {
|
|
225
|
+
return "message-extension-query-setting-url";
|
|
226
|
+
}
|
|
227
|
+
if (includesName(TEAMS_MESSAGE_EXTENSION_SETTING_NAMES, invokeName)) {
|
|
228
|
+
return "message-extension-setting";
|
|
229
|
+
}
|
|
230
|
+
if (includesName(
|
|
231
|
+
TEAMS_MESSAGE_EXTENSION_CARD_BUTTON_CLICKED_NAMES,
|
|
232
|
+
invokeName
|
|
233
|
+
)) {
|
|
234
|
+
return "message-extension-card-button-clicked";
|
|
235
|
+
}
|
|
236
|
+
if (includesName(TEAMS_CARD_ACTION_SUBMIT_NAMES, invokeName)) {
|
|
237
|
+
return payload?.actionName === "feedback" ? "feedback" : "card-submit";
|
|
238
|
+
}
|
|
239
|
+
return "invoke";
|
|
240
|
+
default:
|
|
241
|
+
return "other";
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
function parseActors(channelData) {
|
|
245
|
+
const raw = channelData?.onBehalfOf;
|
|
246
|
+
if (!Array.isArray(raw)) return [];
|
|
247
|
+
const actors = [];
|
|
248
|
+
for (const item of raw) {
|
|
249
|
+
const actor = asObject(item);
|
|
250
|
+
const itemRef = asObject(actor?.item);
|
|
251
|
+
actors.push({
|
|
252
|
+
id: readString(itemRef, "id"),
|
|
253
|
+
displayName: readString(itemRef, "displayName"),
|
|
254
|
+
tenantId: readString(actor, "tenantId"),
|
|
255
|
+
userPrincipalName: readString(itemRef, "userPrincipalName")
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
return actors.filter(
|
|
259
|
+
(actor) => actor.id !== void 0 || actor.displayName !== void 0 || actor.userPrincipalName !== void 0
|
|
260
|
+
);
|
|
261
|
+
}
|
|
262
|
+
function parseTeamsActivity(context, options = {}) {
|
|
263
|
+
const { activity } = context;
|
|
264
|
+
const channelData = asObject(activity.channelData);
|
|
265
|
+
const parsedChannelData = parseTypedChannelData(channelData, options);
|
|
266
|
+
const team = asObject(channelData?.team);
|
|
267
|
+
const channel = asObject(channelData?.channel);
|
|
268
|
+
const tenant = asObject(channelData?.tenant);
|
|
269
|
+
const meeting = asObject(channelData?.meeting);
|
|
270
|
+
const eventType = parsedChannelData?.eventType ?? readString(channelData, "eventType");
|
|
271
|
+
const conversationType = typeof activity.conversation?.conversationType === "string" ? activity.conversation.conversationType : void 0;
|
|
272
|
+
const teamId = parsedChannelData?.team?.aadGroupId ?? parsedChannelData?.team?.id ?? readString(team, "aadGroupId") ?? readString(team, "id");
|
|
273
|
+
const meetingId = parsedChannelData?.meeting?.id ?? readString(meeting, "id");
|
|
274
|
+
const surface = detectSurface(
|
|
275
|
+
conversationType,
|
|
276
|
+
meetingId,
|
|
277
|
+
teamId
|
|
278
|
+
);
|
|
279
|
+
return {
|
|
280
|
+
channelId: activity.channelId ?? "unknown",
|
|
281
|
+
conversationId: activity.conversation?.id ?? "unknown",
|
|
282
|
+
activityId: activity.id ?? void 0,
|
|
283
|
+
messageId: activity.id ?? void 0,
|
|
284
|
+
replyToId: activity.replyToId ?? void 0,
|
|
285
|
+
invokeName: activity.name ?? void 0,
|
|
286
|
+
eventType,
|
|
287
|
+
tenantId: parsedChannelData?.tenant?.id ?? readString(tenant, "id") ?? activity.conversation?.tenantId,
|
|
288
|
+
teamId,
|
|
289
|
+
channelData: parsedChannelData,
|
|
290
|
+
channelThreadId: parsedChannelData?.channel?.id ?? readString(channel, "id"),
|
|
291
|
+
meetingId,
|
|
292
|
+
surface,
|
|
293
|
+
kind: detectKind(context, eventType),
|
|
294
|
+
actors: parseActors(channelData),
|
|
295
|
+
targeted: isTargetedTeamsActivity(context)
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
function parseTeamsActivitySafe(context) {
|
|
299
|
+
return parseTeamsActivity(context, { strictChannelData: false });
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
export {
|
|
303
|
+
isTargetedTeamsActivity,
|
|
304
|
+
makeTargetedTeamsActivity,
|
|
305
|
+
TEAMS_CONFIG_FETCH_NAMES,
|
|
306
|
+
TEAMS_CONFIG_SUBMIT_NAMES,
|
|
307
|
+
TEAMS_FILE_CONSENT_NAMES,
|
|
308
|
+
TEAMS_ACTIONABLE_MESSAGE_NAMES,
|
|
309
|
+
TEAMS_ADAPTIVE_CARD_ACTION_NAMES,
|
|
310
|
+
TEAMS_ADAPTIVE_CARD_SEARCH_NAMES,
|
|
311
|
+
TEAMS_TASK_MODULE_FETCH_NAMES,
|
|
312
|
+
TEAMS_TASK_MODULE_SUBMIT_NAMES,
|
|
313
|
+
TEAMS_TAB_FETCH_NAMES,
|
|
314
|
+
TEAMS_TAB_SUBMIT_NAMES,
|
|
315
|
+
TEAMS_MESSAGE_EXTENSION_QUERY_NAMES,
|
|
316
|
+
TEAMS_MESSAGE_EXTENSION_SUBMIT_ACTION_NAMES,
|
|
317
|
+
TEAMS_MESSAGE_EXTENSION_FETCH_TASK_NAMES,
|
|
318
|
+
TEAMS_MESSAGE_EXTENSION_QUERY_SETTING_URL_NAMES,
|
|
319
|
+
TEAMS_MESSAGE_EXTENSION_SETTING_NAMES,
|
|
320
|
+
TEAMS_MESSAGE_EXTENSION_CARD_BUTTON_CLICKED_NAMES,
|
|
321
|
+
TEAMS_MESSAGE_EXTENSION_SELECT_NAMES,
|
|
322
|
+
TEAMS_CARD_ACTION_SUBMIT_NAMES,
|
|
323
|
+
TEAMS_CONVERSATION_UPDATE_EVENT_NAMES,
|
|
324
|
+
TEAMS_MEETING_EVENT_NAMES,
|
|
325
|
+
TEAMS_MEETING_INVOKE_NAMES,
|
|
326
|
+
parseTeamsActivity,
|
|
327
|
+
parseTeamsActivitySafe
|
|
328
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { BatchFailedEntriesResponse, BatchOperationResponse, BatchOperationStateResponse, CancelOperationResponse, ChannelInfo, FeedbackLoopData, MeetingNotification, NotificationInfo, OnBehalfOf, TeamDetails, TeamInfo, TeamsAttachmentDownloader, TeamsChannelAccount, TeamsChannelData, TeamsChannelDataSettings, TeamsInfo, TeamsMeetingInfo, TeamsMember, TeamsPagedMembersResult, TenantInfo, parseTeamsChannelData } from '@microsoft/agents-hosting-extensions-teams';
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { BatchFailedEntriesResponse, BatchOperationResponse, BatchOperationStateResponse, CancelOperationResponse, ChannelInfo, FeedbackLoopData, MeetingNotification, NotificationInfo, OnBehalfOf, TeamDetails, TeamInfo, TeamsAttachmentDownloader, TeamsChannelAccount, TeamsChannelData, TeamsChannelDataSettings, TeamsInfo, TeamsMeetingInfo, TeamsMember, TeamsPagedMembersResult, TenantInfo, parseTeamsChannelData } from '@microsoft/agents-hosting-extensions-teams';
|
|
2
|
+
export { TeamsInvokeResult, createTeamsInvokeActivity, sendTeamsInvoke } from './invoke.js';
|
|
3
|
+
export { TeamsDialogDefinition, TeamsDialogMessageBody, TeamsDialogResponse, TeamsDialogSize, TeamsSearchAttachment, TeamsSearchLayout, TeamsSearchMessageBody, TeamsSearchResponse, TeamsSearchResult, TeamsSearchResultBody, TeamsSearchResultType, createTeamsDialog, createTeamsDialogMessage, createTeamsSearchMessage, createTeamsSearchResult } from './responses.js';
|
|
4
|
+
export { P as ParseTeamsActivityOptions, T as TEAMS_ACTIONABLE_MESSAGE_NAMES, a as TEAMS_ADAPTIVE_CARD_ACTION_NAMES, b as TEAMS_ADAPTIVE_CARD_SEARCH_NAMES, c as TEAMS_CARD_ACTION_SUBMIT_NAMES, d as TEAMS_CONFIG_FETCH_NAMES, e as TEAMS_CONFIG_SUBMIT_NAMES, f as TEAMS_CONVERSATION_UPDATE_EVENT_NAMES, g as TEAMS_FILE_CONSENT_NAMES, h as TEAMS_MEETING_EVENT_NAMES, i as TEAMS_MEETING_INVOKE_NAMES, j as TEAMS_MESSAGE_EXTENSION_CARD_BUTTON_CLICKED_NAMES, k as TEAMS_MESSAGE_EXTENSION_FETCH_TASK_NAMES, l as TEAMS_MESSAGE_EXTENSION_QUERY_NAMES, m as TEAMS_MESSAGE_EXTENSION_QUERY_SETTING_URL_NAMES, n as TEAMS_MESSAGE_EXTENSION_SELECT_NAMES, o as TEAMS_MESSAGE_EXTENSION_SETTING_NAMES, p as TEAMS_MESSAGE_EXTENSION_SUBMIT_ACTION_NAMES, q as TEAMS_TAB_FETCH_NAMES, r as TEAMS_TAB_SUBMIT_NAMES, s as TEAMS_TASK_MODULE_FETCH_NAMES, t as TEAMS_TASK_MODULE_SUBMIT_NAMES, u as TeamsActivityInfo, v as TeamsActivityKind, w as TeamsActorReference, x as TeamsSurface, y as isTargetedTeamsActivity, z as makeTargetedTeamsActivity, A as parseTeamsActivity, B as parseTeamsActivitySafe } from './teams-activity-BKFY1qUk.js';
|
|
5
|
+
import '@microsoft/agents-activity';
|
|
6
|
+
import '@microsoft/agents-hosting';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createTeamsInvokeActivity,
|
|
3
|
+
sendTeamsInvoke
|
|
4
|
+
} from "./chunk-KRYOYRKW.js";
|
|
5
|
+
import {
|
|
6
|
+
createTeamsDialog,
|
|
7
|
+
createTeamsDialogMessage,
|
|
8
|
+
createTeamsSearchMessage,
|
|
9
|
+
createTeamsSearchResult
|
|
10
|
+
} from "./chunk-HI2TMD6D.js";
|
|
11
|
+
import {
|
|
12
|
+
TEAMS_ACTIONABLE_MESSAGE_NAMES,
|
|
13
|
+
TEAMS_ADAPTIVE_CARD_ACTION_NAMES,
|
|
14
|
+
TEAMS_ADAPTIVE_CARD_SEARCH_NAMES,
|
|
15
|
+
TEAMS_CARD_ACTION_SUBMIT_NAMES,
|
|
16
|
+
TEAMS_CONFIG_FETCH_NAMES,
|
|
17
|
+
TEAMS_CONFIG_SUBMIT_NAMES,
|
|
18
|
+
TEAMS_CONVERSATION_UPDATE_EVENT_NAMES,
|
|
19
|
+
TEAMS_FILE_CONSENT_NAMES,
|
|
20
|
+
TEAMS_MEETING_EVENT_NAMES,
|
|
21
|
+
TEAMS_MEETING_INVOKE_NAMES,
|
|
22
|
+
TEAMS_MESSAGE_EXTENSION_CARD_BUTTON_CLICKED_NAMES,
|
|
23
|
+
TEAMS_MESSAGE_EXTENSION_FETCH_TASK_NAMES,
|
|
24
|
+
TEAMS_MESSAGE_EXTENSION_QUERY_NAMES,
|
|
25
|
+
TEAMS_MESSAGE_EXTENSION_QUERY_SETTING_URL_NAMES,
|
|
26
|
+
TEAMS_MESSAGE_EXTENSION_SELECT_NAMES,
|
|
27
|
+
TEAMS_MESSAGE_EXTENSION_SETTING_NAMES,
|
|
28
|
+
TEAMS_MESSAGE_EXTENSION_SUBMIT_ACTION_NAMES,
|
|
29
|
+
TEAMS_TAB_FETCH_NAMES,
|
|
30
|
+
TEAMS_TAB_SUBMIT_NAMES,
|
|
31
|
+
TEAMS_TASK_MODULE_FETCH_NAMES,
|
|
32
|
+
TEAMS_TASK_MODULE_SUBMIT_NAMES,
|
|
33
|
+
isTargetedTeamsActivity,
|
|
34
|
+
makeTargetedTeamsActivity,
|
|
35
|
+
parseTeamsActivity,
|
|
36
|
+
parseTeamsActivitySafe
|
|
37
|
+
} from "./chunk-VC7GUFOR.js";
|
|
38
|
+
import {
|
|
39
|
+
TeamsAttachmentDownloader,
|
|
40
|
+
TeamsInfo,
|
|
41
|
+
parseTeamsChannelData
|
|
42
|
+
} from "./chunk-B5KRH22J.js";
|
|
43
|
+
export {
|
|
44
|
+
TEAMS_ACTIONABLE_MESSAGE_NAMES,
|
|
45
|
+
TEAMS_ADAPTIVE_CARD_ACTION_NAMES,
|
|
46
|
+
TEAMS_ADAPTIVE_CARD_SEARCH_NAMES,
|
|
47
|
+
TEAMS_CARD_ACTION_SUBMIT_NAMES,
|
|
48
|
+
TEAMS_CONFIG_FETCH_NAMES,
|
|
49
|
+
TEAMS_CONFIG_SUBMIT_NAMES,
|
|
50
|
+
TEAMS_CONVERSATION_UPDATE_EVENT_NAMES,
|
|
51
|
+
TEAMS_FILE_CONSENT_NAMES,
|
|
52
|
+
TEAMS_MEETING_EVENT_NAMES,
|
|
53
|
+
TEAMS_MEETING_INVOKE_NAMES,
|
|
54
|
+
TEAMS_MESSAGE_EXTENSION_CARD_BUTTON_CLICKED_NAMES,
|
|
55
|
+
TEAMS_MESSAGE_EXTENSION_FETCH_TASK_NAMES,
|
|
56
|
+
TEAMS_MESSAGE_EXTENSION_QUERY_NAMES,
|
|
57
|
+
TEAMS_MESSAGE_EXTENSION_QUERY_SETTING_URL_NAMES,
|
|
58
|
+
TEAMS_MESSAGE_EXTENSION_SELECT_NAMES,
|
|
59
|
+
TEAMS_MESSAGE_EXTENSION_SETTING_NAMES,
|
|
60
|
+
TEAMS_MESSAGE_EXTENSION_SUBMIT_ACTION_NAMES,
|
|
61
|
+
TEAMS_TAB_FETCH_NAMES,
|
|
62
|
+
TEAMS_TAB_SUBMIT_NAMES,
|
|
63
|
+
TEAMS_TASK_MODULE_FETCH_NAMES,
|
|
64
|
+
TEAMS_TASK_MODULE_SUBMIT_NAMES,
|
|
65
|
+
TeamsAttachmentDownloader,
|
|
66
|
+
TeamsInfo,
|
|
67
|
+
createTeamsDialog,
|
|
68
|
+
createTeamsDialogMessage,
|
|
69
|
+
createTeamsInvokeActivity,
|
|
70
|
+
createTeamsSearchMessage,
|
|
71
|
+
createTeamsSearchResult,
|
|
72
|
+
isTargetedTeamsActivity,
|
|
73
|
+
makeTargetedTeamsActivity,
|
|
74
|
+
parseTeamsActivity,
|
|
75
|
+
parseTeamsActivitySafe,
|
|
76
|
+
parseTeamsChannelData,
|
|
77
|
+
sendTeamsInvoke
|
|
78
|
+
};
|
package/dist/invoke.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Activity } from '@microsoft/agents-activity';
|
|
2
|
+
import { TurnContext } from '@microsoft/agents-hosting';
|
|
3
|
+
|
|
4
|
+
interface TeamsInvokeResult<T = unknown> {
|
|
5
|
+
status: number;
|
|
6
|
+
body?: T;
|
|
7
|
+
}
|
|
8
|
+
declare function createTeamsInvokeActivity<T = unknown>(result: TeamsInvokeResult<T>): Activity;
|
|
9
|
+
declare function sendTeamsInvoke<T = unknown>(context: TurnContext, body?: T, status?: number): Promise<void>;
|
|
10
|
+
|
|
11
|
+
export { type TeamsInvokeResult, createTeamsInvokeActivity, sendTeamsInvoke };
|
package/dist/invoke.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Attachment, Activity } from '@microsoft/agents-activity';
|
|
2
|
+
|
|
3
|
+
type TeamsSearchLayout = "list" | "grid";
|
|
4
|
+
type TeamsSearchResultType = "result" | "auth" | "config" | "message" | "botMessagePreview" | "silentAuth";
|
|
5
|
+
interface TeamsSearchAttachment extends Attachment {
|
|
6
|
+
preview?: Attachment;
|
|
7
|
+
}
|
|
8
|
+
interface TeamsSearchResult {
|
|
9
|
+
type?: TeamsSearchResultType;
|
|
10
|
+
layout?: TeamsSearchLayout;
|
|
11
|
+
attachments?: TeamsSearchAttachment[];
|
|
12
|
+
text?: string;
|
|
13
|
+
preview?: Activity;
|
|
14
|
+
}
|
|
15
|
+
interface TeamsSearchResultBody {
|
|
16
|
+
composeExtension: {
|
|
17
|
+
type?: TeamsSearchResultType;
|
|
18
|
+
attachmentLayout?: TeamsSearchLayout;
|
|
19
|
+
attachments?: TeamsSearchAttachment[];
|
|
20
|
+
text?: string;
|
|
21
|
+
activityPreview?: Activity;
|
|
22
|
+
};
|
|
23
|
+
cacheInfo?: unknown;
|
|
24
|
+
}
|
|
25
|
+
interface TeamsSearchMessageBody {
|
|
26
|
+
composeExtension: {
|
|
27
|
+
type: "message";
|
|
28
|
+
text: string;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
type TeamsSearchResponse = TeamsSearchResultBody | TeamsSearchMessageBody;
|
|
32
|
+
declare function createTeamsSearchResult(result: TeamsSearchResult): TeamsSearchResultBody;
|
|
33
|
+
declare function createTeamsSearchMessage(text: string): TeamsSearchMessageBody;
|
|
34
|
+
type TeamsDialogSize = number | "small" | "medium" | "large";
|
|
35
|
+
interface TeamsDialogDefinition {
|
|
36
|
+
title?: string;
|
|
37
|
+
height?: TeamsDialogSize;
|
|
38
|
+
width?: TeamsDialogSize;
|
|
39
|
+
url?: string;
|
|
40
|
+
fallbackUrl?: string;
|
|
41
|
+
card?: Attachment;
|
|
42
|
+
completionAgentId?: string;
|
|
43
|
+
}
|
|
44
|
+
interface TeamsDialogResponse {
|
|
45
|
+
task: {
|
|
46
|
+
type: "continue";
|
|
47
|
+
value: TeamsDialogDefinition;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
interface TeamsDialogMessageBody {
|
|
51
|
+
task: {
|
|
52
|
+
type: "message";
|
|
53
|
+
value: string;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
declare function createTeamsDialog(dialog: TeamsDialogDefinition): TeamsDialogResponse;
|
|
57
|
+
declare function createTeamsDialogMessage(message: string): TeamsDialogMessageBody;
|
|
58
|
+
|
|
59
|
+
export { type TeamsDialogDefinition, type TeamsDialogMessageBody, type TeamsDialogResponse, type TeamsDialogSize, type TeamsSearchAttachment, type TeamsSearchLayout, type TeamsSearchMessageBody, type TeamsSearchResponse, type TeamsSearchResult, type TeamsSearchResultBody, type TeamsSearchResultType, createTeamsDialog, createTeamsDialogMessage, createTeamsSearchMessage, createTeamsSearchResult };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createTeamsDialog,
|
|
3
|
+
createTeamsDialogMessage,
|
|
4
|
+
createTeamsSearchMessage,
|
|
5
|
+
createTeamsSearchResult
|
|
6
|
+
} from "./chunk-HI2TMD6D.js";
|
|
7
|
+
export {
|
|
8
|
+
createTeamsDialog,
|
|
9
|
+
createTeamsDialogMessage,
|
|
10
|
+
createTeamsSearchMessage,
|
|
11
|
+
createTeamsSearchResult
|
|
12
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { Activity } from '@microsoft/agents-activity';
|
|
2
|
+
import { TurnContext } from '@microsoft/agents-hosting';
|
|
3
|
+
import { TeamsChannelData } from '@microsoft/agents-hosting-extensions-teams';
|
|
4
|
+
|
|
5
|
+
type TeamsSurface = "personal" | "channel" | "group" | "meeting" | "unknown";
|
|
6
|
+
type TeamsActivityKind = "message" | "conversation-update" | "members-added" | "members-removed" | "channel-created" | "channel-deleted" | "channel-renamed" | "channel-restored" | "channel-shared" | "channel-unshared" | "team-renamed" | "team-archived" | "team-unarchived" | "team-deleted" | "team-hard-deleted" | "team-restored" | "message-edit" | "message-delete" | "message-restore" | "reaction" | "read-receipt" | "config-fetch" | "config-submit" | "file-consent" | "actionable-message-execute-action" | "adaptive-card-action" | "adaptive-card-search" | "card-submit" | "feedback" | "dialog-open" | "dialog-submit" | "task-fetch" | "task-submit" | "search-command" | "message-extension-query" | "message-extension-query-link" | "message-extension-anonymous-query-link" | "select-result" | "message-extension-select-item" | "message-extension-submit-action" | "message-extension-fetch-task" | "message-extension-query-setting-url" | "message-extension-setting" | "message-extension-card-button-clicked" | "tab-fetch" | "tab-submit" | "invoke" | "meeting-start" | "meeting-end" | "participants-join" | "participants-leave" | "meeting-room-join" | "meeting-room-leave" | "meeting-stage-view" | "meeting-smart-reply" | "meeting-reaction" | "meeting-poll-response" | "meeting-apps-installed" | "meeting-apps-uninstalled" | "meeting-recording-started" | "meeting-recording-stopped" | "meeting-focus-change" | "meeting-screen-share-start" | "meeting-screen-share-stop" | "other";
|
|
7
|
+
interface TeamsActorReference {
|
|
8
|
+
id?: string;
|
|
9
|
+
displayName?: string;
|
|
10
|
+
tenantId?: string;
|
|
11
|
+
userPrincipalName?: string;
|
|
12
|
+
}
|
|
13
|
+
interface TeamsActivityInfo {
|
|
14
|
+
channelId: string;
|
|
15
|
+
conversationId: string;
|
|
16
|
+
activityId?: string;
|
|
17
|
+
messageId?: string;
|
|
18
|
+
replyToId?: string;
|
|
19
|
+
invokeName?: string;
|
|
20
|
+
eventType?: string;
|
|
21
|
+
tenantId?: string;
|
|
22
|
+
teamId?: string;
|
|
23
|
+
channelThreadId?: string;
|
|
24
|
+
meetingId?: string;
|
|
25
|
+
channelData?: TeamsChannelData;
|
|
26
|
+
surface: TeamsSurface;
|
|
27
|
+
kind: TeamsActivityKind;
|
|
28
|
+
actors: TeamsActorReference[];
|
|
29
|
+
/**
|
|
30
|
+
* Whether the inbound activity carries an `activityTreatment: targeted` entity.
|
|
31
|
+
*
|
|
32
|
+
* Targeted activities are visible only to the recipient even inside a group
|
|
33
|
+
* Teams conversation. Set by Teams clients or outgoing helper code through
|
|
34
|
+
* the `activityTreatment: targeted` entity added in @microsoft/agents-activity 1.5.
|
|
35
|
+
*/
|
|
36
|
+
targeted: boolean;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Returns `true` when the activity carries an `activityTreatment: targeted`
|
|
41
|
+
* entity.
|
|
42
|
+
*
|
|
43
|
+
* Targeted activities are surfaced only to the recipient inside a group
|
|
44
|
+
* Teams conversation. This is a Teams-only concept; for non-group
|
|
45
|
+
* conversations Teams clients should not add the treatment.
|
|
46
|
+
*/
|
|
47
|
+
declare function isTargetedTeamsActivity(context: TurnContext): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Marks an outbound activity as targeted for Teams group conversations.
|
|
50
|
+
*
|
|
51
|
+
* This helper mutates the activity by adding the `activityTreatment: targeted`
|
|
52
|
+
* entity. It is idempotent and returns the same activity for chaining. Teams
|
|
53
|
+
* only honors this treatment in group chat / channel contexts; callers may use
|
|
54
|
+
* it before `TurnContext.sendActivity()` applies the conversation reference.
|
|
55
|
+
*
|
|
56
|
+
* Use when sending a reply that should only be visible to one recipient inside
|
|
57
|
+
* a group chat or channel thread.
|
|
58
|
+
*/
|
|
59
|
+
declare function makeTargetedTeamsActivity(activity: Activity): Activity;
|
|
60
|
+
interface ParseTeamsActivityOptions {
|
|
61
|
+
strictChannelData?: boolean;
|
|
62
|
+
}
|
|
63
|
+
declare const TEAMS_CONFIG_FETCH_NAMES: readonly ["config/fetch"];
|
|
64
|
+
declare const TEAMS_CONFIG_SUBMIT_NAMES: readonly ["config/submit"];
|
|
65
|
+
declare const TEAMS_FILE_CONSENT_NAMES: readonly ["fileConsent/invoke"];
|
|
66
|
+
declare const TEAMS_ACTIONABLE_MESSAGE_NAMES: readonly ["actionableMessage/executeAction"];
|
|
67
|
+
declare const TEAMS_ADAPTIVE_CARD_ACTION_NAMES: readonly ["adaptiveCard/action"];
|
|
68
|
+
declare const TEAMS_ADAPTIVE_CARD_SEARCH_NAMES: readonly ["application/search"];
|
|
69
|
+
declare const TEAMS_TASK_MODULE_FETCH_NAMES: readonly ["task/fetch", "composeExtension/fetchTask"];
|
|
70
|
+
declare const TEAMS_TASK_MODULE_SUBMIT_NAMES: readonly ["task/submit"];
|
|
71
|
+
declare const TEAMS_TAB_FETCH_NAMES: readonly ["tab/fetch"];
|
|
72
|
+
declare const TEAMS_TAB_SUBMIT_NAMES: readonly ["tab/submit"];
|
|
73
|
+
declare const TEAMS_MESSAGE_EXTENSION_QUERY_NAMES: readonly ["composeExtension/query", "composeExtension/queryLink", "composeExtension/anonymousQueryLink"];
|
|
74
|
+
declare const TEAMS_MESSAGE_EXTENSION_SUBMIT_ACTION_NAMES: readonly ["composeExtension/submitAction"];
|
|
75
|
+
declare const TEAMS_MESSAGE_EXTENSION_FETCH_TASK_NAMES: readonly ["composeExtension/fetchTask"];
|
|
76
|
+
declare const TEAMS_MESSAGE_EXTENSION_QUERY_SETTING_URL_NAMES: readonly ["composeExtension/querySettingUrl"];
|
|
77
|
+
declare const TEAMS_MESSAGE_EXTENSION_SETTING_NAMES: readonly ["composeExtension/setting"];
|
|
78
|
+
declare const TEAMS_MESSAGE_EXTENSION_CARD_BUTTON_CLICKED_NAMES: readonly ["composeExtension/onCardButtonClicked"];
|
|
79
|
+
declare const TEAMS_MESSAGE_EXTENSION_SELECT_NAMES: readonly ["composeExtension/selectItem"];
|
|
80
|
+
declare const TEAMS_CARD_ACTION_SUBMIT_NAMES: readonly ["message/submitAction"];
|
|
81
|
+
declare const TEAMS_CONVERSATION_UPDATE_EVENT_NAMES: Readonly<Record<string, TeamsActivityKind>>;
|
|
82
|
+
declare const TEAMS_MEETING_EVENT_NAMES: Readonly<Record<string, TeamsActivityKind>>;
|
|
83
|
+
declare const TEAMS_MEETING_INVOKE_NAMES: Readonly<Record<string, TeamsActivityKind>>;
|
|
84
|
+
declare function parseTeamsActivity(context: TurnContext, options?: ParseTeamsActivityOptions): TeamsActivityInfo;
|
|
85
|
+
declare function parseTeamsActivitySafe(context: TurnContext): TeamsActivityInfo;
|
|
86
|
+
|
|
87
|
+
export { parseTeamsActivity as A, parseTeamsActivitySafe as B, type ParseTeamsActivityOptions as P, TEAMS_ACTIONABLE_MESSAGE_NAMES as T, TEAMS_ADAPTIVE_CARD_ACTION_NAMES as a, TEAMS_ADAPTIVE_CARD_SEARCH_NAMES as b, TEAMS_CARD_ACTION_SUBMIT_NAMES as c, TEAMS_CONFIG_FETCH_NAMES as d, TEAMS_CONFIG_SUBMIT_NAMES as e, TEAMS_CONVERSATION_UPDATE_EVENT_NAMES as f, TEAMS_FILE_CONSENT_NAMES as g, TEAMS_MEETING_EVENT_NAMES as h, TEAMS_MEETING_INVOKE_NAMES as i, TEAMS_MESSAGE_EXTENSION_CARD_BUTTON_CLICKED_NAMES as j, TEAMS_MESSAGE_EXTENSION_FETCH_TASK_NAMES as k, TEAMS_MESSAGE_EXTENSION_QUERY_NAMES as l, TEAMS_MESSAGE_EXTENSION_QUERY_SETTING_URL_NAMES as m, TEAMS_MESSAGE_EXTENSION_SELECT_NAMES as n, TEAMS_MESSAGE_EXTENSION_SETTING_NAMES as o, TEAMS_MESSAGE_EXTENSION_SUBMIT_ACTION_NAMES as p, TEAMS_TAB_FETCH_NAMES as q, TEAMS_TAB_SUBMIT_NAMES as r, TEAMS_TASK_MODULE_FETCH_NAMES as s, TEAMS_TASK_MODULE_SUBMIT_NAMES as t, type TeamsActivityInfo as u, type TeamsActivityKind as v, type TeamsActorReference as w, type TeamsSurface as x, isTargetedTeamsActivity as y, makeTargetedTeamsActivity as z };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import '@microsoft/agents-activity';
|
|
2
|
+
import '@microsoft/agents-hosting';
|
|
3
|
+
export { P as ParseTeamsActivityOptions, T as TEAMS_ACTIONABLE_MESSAGE_NAMES, a as TEAMS_ADAPTIVE_CARD_ACTION_NAMES, b as TEAMS_ADAPTIVE_CARD_SEARCH_NAMES, c as TEAMS_CARD_ACTION_SUBMIT_NAMES, d as TEAMS_CONFIG_FETCH_NAMES, e as TEAMS_CONFIG_SUBMIT_NAMES, f as TEAMS_CONVERSATION_UPDATE_EVENT_NAMES, g as TEAMS_FILE_CONSENT_NAMES, h as TEAMS_MEETING_EVENT_NAMES, i as TEAMS_MEETING_INVOKE_NAMES, j as TEAMS_MESSAGE_EXTENSION_CARD_BUTTON_CLICKED_NAMES, k as TEAMS_MESSAGE_EXTENSION_FETCH_TASK_NAMES, l as TEAMS_MESSAGE_EXTENSION_QUERY_NAMES, m as TEAMS_MESSAGE_EXTENSION_QUERY_SETTING_URL_NAMES, n as TEAMS_MESSAGE_EXTENSION_SELECT_NAMES, o as TEAMS_MESSAGE_EXTENSION_SETTING_NAMES, p as TEAMS_MESSAGE_EXTENSION_SUBMIT_ACTION_NAMES, q as TEAMS_TAB_FETCH_NAMES, r as TEAMS_TAB_SUBMIT_NAMES, s as TEAMS_TASK_MODULE_FETCH_NAMES, t as TEAMS_TASK_MODULE_SUBMIT_NAMES, y as isTargetedTeamsActivity, z as makeTargetedTeamsActivity, A as parseTeamsActivity, B as parseTeamsActivitySafe } from './teams-activity-BKFY1qUk.js';
|
|
4
|
+
import '@microsoft/agents-hosting-extensions-teams';
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TEAMS_ACTIONABLE_MESSAGE_NAMES,
|
|
3
|
+
TEAMS_ADAPTIVE_CARD_ACTION_NAMES,
|
|
4
|
+
TEAMS_ADAPTIVE_CARD_SEARCH_NAMES,
|
|
5
|
+
TEAMS_CARD_ACTION_SUBMIT_NAMES,
|
|
6
|
+
TEAMS_CONFIG_FETCH_NAMES,
|
|
7
|
+
TEAMS_CONFIG_SUBMIT_NAMES,
|
|
8
|
+
TEAMS_CONVERSATION_UPDATE_EVENT_NAMES,
|
|
9
|
+
TEAMS_FILE_CONSENT_NAMES,
|
|
10
|
+
TEAMS_MEETING_EVENT_NAMES,
|
|
11
|
+
TEAMS_MEETING_INVOKE_NAMES,
|
|
12
|
+
TEAMS_MESSAGE_EXTENSION_CARD_BUTTON_CLICKED_NAMES,
|
|
13
|
+
TEAMS_MESSAGE_EXTENSION_FETCH_TASK_NAMES,
|
|
14
|
+
TEAMS_MESSAGE_EXTENSION_QUERY_NAMES,
|
|
15
|
+
TEAMS_MESSAGE_EXTENSION_QUERY_SETTING_URL_NAMES,
|
|
16
|
+
TEAMS_MESSAGE_EXTENSION_SELECT_NAMES,
|
|
17
|
+
TEAMS_MESSAGE_EXTENSION_SETTING_NAMES,
|
|
18
|
+
TEAMS_MESSAGE_EXTENSION_SUBMIT_ACTION_NAMES,
|
|
19
|
+
TEAMS_TAB_FETCH_NAMES,
|
|
20
|
+
TEAMS_TAB_SUBMIT_NAMES,
|
|
21
|
+
TEAMS_TASK_MODULE_FETCH_NAMES,
|
|
22
|
+
TEAMS_TASK_MODULE_SUBMIT_NAMES,
|
|
23
|
+
isTargetedTeamsActivity,
|
|
24
|
+
makeTargetedTeamsActivity,
|
|
25
|
+
parseTeamsActivity,
|
|
26
|
+
parseTeamsActivitySafe
|
|
27
|
+
} from "./chunk-VC7GUFOR.js";
|
|
28
|
+
import "./chunk-B5KRH22J.js";
|
|
29
|
+
export {
|
|
30
|
+
TEAMS_ACTIONABLE_MESSAGE_NAMES,
|
|
31
|
+
TEAMS_ADAPTIVE_CARD_ACTION_NAMES,
|
|
32
|
+
TEAMS_ADAPTIVE_CARD_SEARCH_NAMES,
|
|
33
|
+
TEAMS_CARD_ACTION_SUBMIT_NAMES,
|
|
34
|
+
TEAMS_CONFIG_FETCH_NAMES,
|
|
35
|
+
TEAMS_CONFIG_SUBMIT_NAMES,
|
|
36
|
+
TEAMS_CONVERSATION_UPDATE_EVENT_NAMES,
|
|
37
|
+
TEAMS_FILE_CONSENT_NAMES,
|
|
38
|
+
TEAMS_MEETING_EVENT_NAMES,
|
|
39
|
+
TEAMS_MEETING_INVOKE_NAMES,
|
|
40
|
+
TEAMS_MESSAGE_EXTENSION_CARD_BUTTON_CLICKED_NAMES,
|
|
41
|
+
TEAMS_MESSAGE_EXTENSION_FETCH_TASK_NAMES,
|
|
42
|
+
TEAMS_MESSAGE_EXTENSION_QUERY_NAMES,
|
|
43
|
+
TEAMS_MESSAGE_EXTENSION_QUERY_SETTING_URL_NAMES,
|
|
44
|
+
TEAMS_MESSAGE_EXTENSION_SELECT_NAMES,
|
|
45
|
+
TEAMS_MESSAGE_EXTENSION_SETTING_NAMES,
|
|
46
|
+
TEAMS_MESSAGE_EXTENSION_SUBMIT_ACTION_NAMES,
|
|
47
|
+
TEAMS_TAB_FETCH_NAMES,
|
|
48
|
+
TEAMS_TAB_SUBMIT_NAMES,
|
|
49
|
+
TEAMS_TASK_MODULE_FETCH_NAMES,
|
|
50
|
+
TEAMS_TASK_MODULE_SUBMIT_NAMES,
|
|
51
|
+
isTargetedTeamsActivity,
|
|
52
|
+
makeTargetedTeamsActivity,
|
|
53
|
+
parseTeamsActivity,
|
|
54
|
+
parseTeamsActivitySafe
|
|
55
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@cuylabs/channel-teams",
|
|
3
|
+
"version": "0.4.0",
|
|
4
|
+
"description": "Microsoft Teams channel primitives for AI agents",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./activity": {
|
|
15
|
+
"types": "./dist/teams-activity.d.ts",
|
|
16
|
+
"import": "./dist/teams-activity.js",
|
|
17
|
+
"default": "./dist/teams-activity.js"
|
|
18
|
+
},
|
|
19
|
+
"./extensions": {
|
|
20
|
+
"types": "./dist/extensions.d.ts",
|
|
21
|
+
"import": "./dist/extensions.js",
|
|
22
|
+
"default": "./dist/extensions.js"
|
|
23
|
+
},
|
|
24
|
+
"./invoke": {
|
|
25
|
+
"types": "./dist/invoke.d.ts",
|
|
26
|
+
"import": "./dist/invoke.js",
|
|
27
|
+
"default": "./dist/invoke.js"
|
|
28
|
+
},
|
|
29
|
+
"./responses": {
|
|
30
|
+
"types": "./dist/responses.d.ts",
|
|
31
|
+
"import": "./dist/responses.js",
|
|
32
|
+
"default": "./dist/responses.js"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"dist",
|
|
37
|
+
"README.md"
|
|
38
|
+
],
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@cuylabs/channel-m365": "^0.4.0"
|
|
41
|
+
},
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"@microsoft/agents-activity": "^1.5.0",
|
|
44
|
+
"@microsoft/agents-hosting": "^1.5.0",
|
|
45
|
+
"@microsoft/agents-hosting-extensions-teams": "^1.5.0"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@microsoft/agents-activity": "^1.5.3",
|
|
49
|
+
"@microsoft/agents-hosting": "^1.5.3",
|
|
50
|
+
"@microsoft/agents-hosting-extensions-teams": "^1.5.3",
|
|
51
|
+
"@types/node": "^22.0.0",
|
|
52
|
+
"tsup": "^8.0.0",
|
|
53
|
+
"typescript": "^5.7.0",
|
|
54
|
+
"vitest": "^4.0.18"
|
|
55
|
+
},
|
|
56
|
+
"keywords": [
|
|
57
|
+
"ai",
|
|
58
|
+
"agent",
|
|
59
|
+
"teams",
|
|
60
|
+
"microsoft",
|
|
61
|
+
"m365",
|
|
62
|
+
"channel"
|
|
63
|
+
],
|
|
64
|
+
"license": "Apache-2.0",
|
|
65
|
+
"repository": {
|
|
66
|
+
"type": "git",
|
|
67
|
+
"url": "https://github.com/cuylabs-ai/agent-channels-ts.git",
|
|
68
|
+
"directory": "packages/channel-teams"
|
|
69
|
+
},
|
|
70
|
+
"publishConfig": {
|
|
71
|
+
"access": "public"
|
|
72
|
+
},
|
|
73
|
+
"engines": {
|
|
74
|
+
"node": ">=20"
|
|
75
|
+
},
|
|
76
|
+
"scripts": {
|
|
77
|
+
"build": "tsup src/index.ts src/teams-activity.ts src/extensions.ts src/invoke.ts src/responses.ts --format esm --dts --clean",
|
|
78
|
+
"clean": "rm -rf dist",
|
|
79
|
+
"dev": "tsup src/index.ts src/teams-activity.ts src/extensions.ts src/invoke.ts src/responses.ts --format esm --dts --watch",
|
|
80
|
+
"lint": "eslint \"src/**/*.{ts,tsx}\" \"tests/**/*.{ts,tsx}\" --max-warnings=0",
|
|
81
|
+
"test": "vitest run",
|
|
82
|
+
"test:watch": "vitest",
|
|
83
|
+
"typecheck": "tsc --noEmit"
|
|
84
|
+
}
|
|
85
|
+
}
|