@microsoft/agents-a365-notifications 0.1.0-preview.30

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 (90) hide show
  1. package/README.md +33 -0
  2. package/dist/cjs/agent-notification.d.ts +16 -0
  3. package/dist/cjs/agent-notification.d.ts.map +1 -0
  4. package/dist/cjs/agent-notification.js +219 -0
  5. package/dist/cjs/agent-notification.js.map +1 -0
  6. package/dist/cjs/constants.d.ts +16 -0
  7. package/dist/cjs/constants.d.ts.map +1 -0
  8. package/dist/cjs/constants.js +19 -0
  9. package/dist/cjs/constants.js.map +1 -0
  10. package/dist/cjs/extensions/agent-notification-handler.d.ts +12 -0
  11. package/dist/cjs/extensions/agent-notification-handler.d.ts.map +1 -0
  12. package/dist/cjs/extensions/agent-notification-handler.js +3 -0
  13. package/dist/cjs/extensions/agent-notification-handler.js.map +1 -0
  14. package/dist/cjs/extensions/index.d.ts +2 -0
  15. package/dist/cjs/extensions/index.d.ts.map +1 -0
  16. package/dist/cjs/extensions/index.js +18 -0
  17. package/dist/cjs/extensions/index.js.map +1 -0
  18. package/dist/cjs/index.d.ts +5 -0
  19. package/dist/cjs/index.d.ts.map +1 -0
  20. package/dist/cjs/index.js +25 -0
  21. package/dist/cjs/index.js.map +1 -0
  22. package/dist/cjs/models/agent-notification-activity.d.ts +56 -0
  23. package/dist/cjs/models/agent-notification-activity.d.ts.map +1 -0
  24. package/dist/cjs/models/agent-notification-activity.js +51 -0
  25. package/dist/cjs/models/agent-notification-activity.js.map +1 -0
  26. package/dist/cjs/models/email-reference.d.ts +35 -0
  27. package/dist/cjs/models/email-reference.d.ts.map +1 -0
  28. package/dist/cjs/models/email-reference.js +27 -0
  29. package/dist/cjs/models/email-reference.js.map +1 -0
  30. package/dist/cjs/models/email-response.d.ts +29 -0
  31. package/dist/cjs/models/email-response.d.ts.map +1 -0
  32. package/dist/cjs/models/email-response.js +31 -0
  33. package/dist/cjs/models/email-response.js.map +1 -0
  34. package/dist/cjs/models/index.d.ts +6 -0
  35. package/dist/cjs/models/index.d.ts.map +1 -0
  36. package/dist/cjs/models/index.js +22 -0
  37. package/dist/cjs/models/index.js.map +1 -0
  38. package/dist/cjs/models/notification-type.d.ts +10 -0
  39. package/dist/cjs/models/notification-type.d.ts.map +1 -0
  40. package/dist/cjs/models/notification-type.js +14 -0
  41. package/dist/cjs/models/notification-type.js.map +1 -0
  42. package/dist/cjs/models/wpx-comment.d.ts +39 -0
  43. package/dist/cjs/models/wpx-comment.d.ts.map +1 -0
  44. package/dist/cjs/models/wpx-comment.js +28 -0
  45. package/dist/cjs/models/wpx-comment.js.map +1 -0
  46. package/dist/esm/agent-notification.d.ts +16 -0
  47. package/dist/esm/agent-notification.d.ts.map +1 -0
  48. package/dist/esm/agent-notification.js +217 -0
  49. package/dist/esm/agent-notification.js.map +1 -0
  50. package/dist/esm/constants.d.ts +16 -0
  51. package/dist/esm/constants.d.ts.map +1 -0
  52. package/dist/esm/constants.js +16 -0
  53. package/dist/esm/constants.js.map +1 -0
  54. package/dist/esm/extensions/agent-notification-handler.d.ts +12 -0
  55. package/dist/esm/extensions/agent-notification-handler.d.ts.map +1 -0
  56. package/dist/esm/extensions/agent-notification-handler.js +2 -0
  57. package/dist/esm/extensions/agent-notification-handler.js.map +1 -0
  58. package/dist/esm/extensions/index.d.ts +2 -0
  59. package/dist/esm/extensions/index.d.ts.map +1 -0
  60. package/dist/esm/extensions/index.js +2 -0
  61. package/dist/esm/extensions/index.js.map +1 -0
  62. package/dist/esm/index.d.ts +5 -0
  63. package/dist/esm/index.d.ts.map +1 -0
  64. package/dist/esm/index.js +9 -0
  65. package/dist/esm/index.js.map +1 -0
  66. package/dist/esm/models/agent-notification-activity.d.ts +56 -0
  67. package/dist/esm/models/agent-notification-activity.d.ts.map +1 -0
  68. package/dist/esm/models/agent-notification-activity.js +48 -0
  69. package/dist/esm/models/agent-notification-activity.js.map +1 -0
  70. package/dist/esm/models/email-reference.d.ts +35 -0
  71. package/dist/esm/models/email-reference.d.ts.map +1 -0
  72. package/dist/esm/models/email-reference.js +22 -0
  73. package/dist/esm/models/email-reference.js.map +1 -0
  74. package/dist/esm/models/email-response.d.ts +29 -0
  75. package/dist/esm/models/email-response.d.ts.map +1 -0
  76. package/dist/esm/models/email-response.js +26 -0
  77. package/dist/esm/models/email-response.js.map +1 -0
  78. package/dist/esm/models/index.d.ts +6 -0
  79. package/dist/esm/models/index.d.ts.map +1 -0
  80. package/dist/esm/models/index.js +6 -0
  81. package/dist/esm/models/index.js.map +1 -0
  82. package/dist/esm/models/notification-type.d.ts +10 -0
  83. package/dist/esm/models/notification-type.d.ts.map +1 -0
  84. package/dist/esm/models/notification-type.js +11 -0
  85. package/dist/esm/models/notification-type.js.map +1 -0
  86. package/dist/esm/models/wpx-comment.d.ts +39 -0
  87. package/dist/esm/models/wpx-comment.d.ts.map +1 -0
  88. package/dist/esm/models/wpx-comment.js +23 -0
  89. package/dist/esm/models/wpx-comment.js.map +1 -0
  90. package/package.json +59 -0
package/README.md ADDED
@@ -0,0 +1,33 @@
1
+ # @microsoft/agents-a365-notifications
2
+
3
+ [![npm](https://img.shields.io/npm/v/@microsoft/agents-a365-notifications?label=npm&logo=npm)](https://www.npmjs.com/package/@microsoft/agents-a365-notifications)
4
+ [![npm Downloads](https://img.shields.io/npm/dm/@microsoft/agents-a365-notifications?label=Downloads&logo=npm)](https://www.npmjs.com/package/@microsoft/agents-a365-notifications)
5
+
6
+ Agent notification services and models for handling user notifications in applications built with the Microsoft Agent 365 SDK. This package provides type-safe notification handling for email, Word comments, and other collaboration scenarios.
7
+
8
+ ## Installation
9
+
10
+ ```bash
11
+ npm install @microsoft/agents-a365-notifications
12
+ ```
13
+
14
+ ## Usage
15
+
16
+ For detailed usage examples and implementation guidance, see the [Microsoft Agent 365 Notification Documentation](https://learn.microsoft.com/microsoft-agent-365/developer/notification?tabs=nodejs).
17
+
18
+ ## Support
19
+
20
+ For issues, questions, or feedback:
21
+
22
+ - File issues in the [GitHub Issues](https://github.com/microsoft/Agent365-nodejs/issues) section
23
+ - See the [main documentation](../../README.md) for more information
24
+
25
+ ## Trademarks
26
+
27
+ *Microsoft, Windows, Microsoft Azure and/or other Microsoft products and services referenced in the documentation may be either trademarks or registered trademarks of Microsoft in the United States and/or other countries. The licenses for this project do not grant you rights to use any Microsoft names, logos, or trademarks. Microsoft's general trademark guidelines can be found at http://go.microsoft.com/fwlink/?LinkID=254653.*
28
+
29
+ ## License
30
+
31
+ Copyright (c) Microsoft Corporation. All rights reserved.
32
+
33
+ Licensed under the MIT License - see the [LICENSE](../../LICENSE.md) file for details
@@ -0,0 +1,16 @@
1
+ import { TurnState } from '@microsoft/agents-hosting';
2
+ import { AgentNotificationHandler } from './extensions';
3
+ declare module '@microsoft/agents-hosting' {
4
+ interface AgentApplication<TState extends TurnState> {
5
+ onAgentNotification(channelId: string, routeHandler: AgentNotificationHandler<TState>, rank?: number, autoSignInHandlers?: string[]): void;
6
+ onAgenticEmailNotification(routeHandler: AgentNotificationHandler<TState>, rank?: number, autoSignInHandlers?: string[]): void;
7
+ onAgenticWordNotification(routeHandler: AgentNotificationHandler<TState>, rank?: number, autoSignInHandlers?: string[]): void;
8
+ onAgenticExcelNotification(routeHandler: AgentNotificationHandler<TState>, rank?: number, autoSignInHandlers?: string[]): void;
9
+ onAgenticPowerPointNotification(routeHandler: AgentNotificationHandler<TState>, rank?: number, autoSignInHandlers?: string[]): void;
10
+ onLifecycleNotification(routeHandler: AgentNotificationHandler<TState>, rank?: number, autoSignInHandlers?: string[]): void;
11
+ onAgenticUserCreatedNotification(routeHandler: AgentNotificationHandler<TState>, rank?: number, autoSignInHandlers?: string[]): void;
12
+ onAgenticUserWorkloadOnboardingNotification(routeHandler: AgentNotificationHandler<TState>, rank?: number, autoSignInHandlers?: string[]): void;
13
+ onAgenticUserDeletedNotification(routeHandler: AgentNotificationHandler<TState>, rank?: number, autoSignInHandlers?: string[]): void;
14
+ }
15
+ }
16
+ //# sourceMappingURL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BAAwB,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;QACrI,2CAA2C,CAAC,YAAY,EAAE,wBAAwB,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;QAChJ,gCAAgC,CAAC,YAAY,EAAE,wBAAwB,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;KACtI;CACF"}
@@ -0,0 +1,219 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const agents_hosting_1 = require("@microsoft/agents-hosting");
4
+ const agent_notification_activity_1 = require("./models/agent-notification-activity");
5
+ const constants_1 = require("./constants");
6
+ /**
7
+ * Helper function to check if an activity is an agentic request.
8
+ */
9
+ function isAgenticRequest(turnContext) {
10
+ if (!turnContext?.activity)
11
+ return false;
12
+ const role = turnContext.activity?.recipient?.role;
13
+ return role === 'agenticAppInstance' || role === 'agenticUser';
14
+ }
15
+ /**
16
+ * Helper function to add a route with agentic filtering.
17
+ */
18
+ function addAgenticRoute(app, routeSelector, routeHandler, isInvokeRoute = false, rank = 32767, autoSignInHandlers) {
19
+ const ensureAgentic = async (turnContext) => {
20
+ return isAgenticRequest(turnContext) && await Promise.resolve(routeSelector(turnContext));
21
+ };
22
+ app.addRoute(ensureAgentic, routeHandler, isInvokeRoute, rank, autoSignInHandlers);
23
+ }
24
+ /**
25
+ * Helper function to set up handler and route
26
+ */
27
+ function onAgentNotificationInternal(app, channelId, handler, rank = 32767, autoSignInHandlers) {
28
+ const routeSelector = async (turnContext) => {
29
+ const activity = turnContext.activity;
30
+ // In case core JS SDK is updated to match .NET SDK, this will need to be updated.
31
+ if (!(activity.channelId) || !isAgenticChannel(activity.channelId)) {
32
+ return false;
33
+ }
34
+ if (channelId !== 'agents:*') {
35
+ if (!isValidChannel(channelId))
36
+ return false;
37
+ if (activity.channelId.toLowerCase() !== channelId.toLowerCase()) {
38
+ return false;
39
+ }
40
+ }
41
+ return true;
42
+ };
43
+ const routeHandler = async (turnContext, turnState) => {
44
+ // Wrap the activity
45
+ const agentNotificationActivity = (0, agent_notification_activity_1.createAgentNotificationActivity)(turnContext.activity);
46
+ // Call the user's handler
47
+ return handler(turnContext, turnState, agentNotificationActivity);
48
+ };
49
+ addAgenticRoute(app, routeSelector, routeHandler, false, rank, autoSignInHandlers);
50
+ }
51
+ /**
52
+ * Helper function to set up handler and route
53
+ */
54
+ function onLifecycleNotificationInternal(app, lifecycleEvent, handler, rank = 32767, autoSignInHandlers) {
55
+ const routeSelector = async (turnContext) => {
56
+ const activity = turnContext.activity;
57
+ // In case core JS SDK is updated to match .NET SDK, this will need to be updated.
58
+ if (!(activity.channelId) || !isAgenticChannel(activity.channelId) || !activity.valueType) {
59
+ return false;
60
+ }
61
+ if (activity.name?.toLowerCase() !== constants_1.AGENT_LIFECYCLE) {
62
+ return false;
63
+ }
64
+ // Check if the lifecycle event is valid
65
+ if (lifecycleEvent !== '*') {
66
+ if (!isValidLifecycleEvent(lifecycleEvent))
67
+ return false;
68
+ if (activity.valueType.toLowerCase() !== lifecycleEvent.toLowerCase())
69
+ return false;
70
+ }
71
+ return true;
72
+ };
73
+ const routeHandler = async (turnContext, turnState) => {
74
+ // Wrap the activity
75
+ const agentNotificationActivity = (0, agent_notification_activity_1.createAgentNotificationActivity)(turnContext.activity);
76
+ // Call the user's handler
77
+ return handler(turnContext, turnState, agentNotificationActivity);
78
+ };
79
+ addAgenticRoute(app, routeSelector, routeHandler, false, rank, autoSignInHandlers);
80
+ }
81
+ /**
82
+ * Registers a route handler for agent notifications.
83
+ *
84
+ * @param this - The agent application
85
+ * @param channelId - The channel id to filter notifications on
86
+ * @param handler - The notification handler
87
+ * @param rank - Rank order in which to evaluate this
88
+ * @param autoSignInHandlers - handlers
89
+ */
90
+ function onAgentNotification(channelId, handler, rank = 32767, autoSignInHandlers) {
91
+ onAgentNotificationInternal(this, channelId, handler, rank, autoSignInHandlers);
92
+ }
93
+ /**
94
+ * Registers a route handler specifically for email notifications.
95
+ *
96
+ * @param this - The agent application
97
+ * @param handler - The notification handler
98
+ * @param rank - Rank order in which to evaluate this
99
+ * @param autoSignInHandlers - handlers
100
+ */
101
+ function onAgenticEmailNotification(handler, rank = 32767, autoSignInHandlers) {
102
+ onAgentNotificationInternal(this, constants_1.AGENTS_EMAIL_SUBCHANNEL, handler, rank, autoSignInHandlers);
103
+ }
104
+ /**
105
+ * Registers a route handler specifically for Word notifications.
106
+ *
107
+ * @param this - The agent application
108
+ * @param handler - The notification handler
109
+ * @param rank - Rank order in which to evaluate this
110
+ * @param autoSignInHandlers - handlers
111
+ */
112
+ function onAgenticWordNotification(handler, rank = 32767, autoSignInHandlers) {
113
+ onAgentNotificationInternal(this, constants_1.AGENTS_WORD_SUBCHANNEL, handler, rank, autoSignInHandlers);
114
+ }
115
+ /**
116
+ * Registers a route handler specifically for Excel notifications.
117
+ *
118
+ * @param this - The agent application
119
+ * @param handler - The notification handler
120
+ * @param rank - Rank order in which to evaluate this
121
+ * @param autoSignInHandlers - handlers
122
+ */
123
+ function onAgenticExcelNotification(handler, rank = 32767, autoSignInHandlers) {
124
+ onAgentNotificationInternal(this, constants_1.AGENTS_EXCEL_SUBCHANNEL, handler, rank, autoSignInHandlers);
125
+ }
126
+ /**
127
+ * Registers a route handler specifically for PowerPoint notifications.
128
+ *
129
+ * @param this - The agent application
130
+ * @param handler - The notification handler
131
+ * @param rank - Rank order in which to evaluate this
132
+ * @param autoSignInHandlers - handlers
133
+ */
134
+ function onAgenticPowerPointNotification(handler, rank = 32767, autoSignInHandlers) {
135
+ onAgentNotificationInternal(this, constants_1.AGENTS_POWERPOINT_SUBCHANNEL, handler, rank, autoSignInHandlers);
136
+ }
137
+ /**
138
+ * Registers a route handler for all lifecycle notifications.
139
+ *
140
+ * @param this - The agent application
141
+ * @param handler - The notification handler
142
+ * @param rank - Rank order in which to evaluate this
143
+ * @param autoSignInHandlers - handlers
144
+ */
145
+ function onLifecycleNotification(handler, rank = 32767, autoSignInHandlers) {
146
+ onLifecycleNotificationInternal(this, '*', handler, rank, autoSignInHandlers);
147
+ }
148
+ /**
149
+ * Registers a route handler for all lifecycle notifications.
150
+ *
151
+ * @param this - The agent application
152
+ * @param handler - The notification handler
153
+ * @param rank - Rank order in which to evaluate this
154
+ * @param autoSignInHandlers - handlers
155
+ */
156
+ function onAgenticUserIdentityCreatedNotification(handler, rank = 32767, autoSignInHandlers) {
157
+ onLifecycleNotificationInternal(this, constants_1.USER_CREATED_LIFECYCLE_EVENT, handler, rank, autoSignInHandlers);
158
+ }
159
+ /**
160
+ * Registers a route handler for all lifecycle notifications.
161
+ *
162
+ * @param this - The agent application
163
+ * @param handler - The notification handler
164
+ * @param rank - Rank order in which to evaluate this
165
+ * @param autoSignInHandlers - handlers
166
+ */
167
+ function onAgenticUserWorkloadOnboardingNotification(handler, rank = 32767, autoSignInHandlers) {
168
+ onLifecycleNotificationInternal(this, constants_1.USER_WORKLOAD_ONBOARDING_LIFECYCLE_EVENT, handler, rank, autoSignInHandlers);
169
+ }
170
+ /**
171
+ * Registers a route handler for all lifecycle notifications.
172
+ *
173
+ * @param this - The agent application
174
+ * @param handler - The notification handler
175
+ * @param rank - Rank order in which to evaluate this
176
+ * @param autoSignInHandlers - handlers
177
+ */
178
+ function onAgenticUserIdentityDeletedNotification(handler, rank = 32767, autoSignInHandlers) {
179
+ onLifecycleNotificationInternal(this, constants_1.USER_DELETED_LIFECYCLE_EVENT, handler, rank, autoSignInHandlers);
180
+ }
181
+ /**
182
+ * Checks if the given channel ID is an agentic channel.
183
+ */
184
+ function isAgenticChannel(channelId) {
185
+ return channelId.toLowerCase().startsWith(constants_1.AGENTS_CHANNEL);
186
+ }
187
+ /**
188
+ * Validates if a sub-channel is supported.
189
+ */
190
+ function isValidChannel(channel) {
191
+ const validChannels = [
192
+ constants_1.AGENTS_EMAIL_SUBCHANNEL,
193
+ constants_1.AGENTS_EXCEL_SUBCHANNEL,
194
+ constants_1.AGENTS_WORD_SUBCHANNEL,
195
+ constants_1.AGENTS_POWERPOINT_SUBCHANNEL,
196
+ ];
197
+ return validChannels.includes(channel.toLowerCase());
198
+ }
199
+ /**
200
+ * Validates if a lifecycle event is supported.
201
+ */
202
+ function isValidLifecycleEvent(lifecycleEvent) {
203
+ const validLifecycleEvents = [
204
+ constants_1.USER_CREATED_LIFECYCLE_EVENT,
205
+ constants_1.USER_WORKLOAD_ONBOARDING_LIFECYCLE_EVENT,
206
+ constants_1.USER_DELETED_LIFECYCLE_EVENT
207
+ ];
208
+ return validLifecycleEvents.includes(lifecycleEvent.toLowerCase());
209
+ }
210
+ agents_hosting_1.AgentApplication.prototype.onAgentNotification = onAgentNotification;
211
+ agents_hosting_1.AgentApplication.prototype.onAgenticEmailNotification = onAgenticEmailNotification;
212
+ agents_hosting_1.AgentApplication.prototype.onAgenticWordNotification = onAgenticWordNotification;
213
+ agents_hosting_1.AgentApplication.prototype.onAgenticExcelNotification = onAgenticExcelNotification;
214
+ agents_hosting_1.AgentApplication.prototype.onAgenticPowerPointNotification = onAgenticPowerPointNotification;
215
+ agents_hosting_1.AgentApplication.prototype.onLifecycleNotification = onLifecycleNotification;
216
+ agents_hosting_1.AgentApplication.prototype.onAgenticUserCreatedNotification = onAgenticUserIdentityCreatedNotification;
217
+ agents_hosting_1.AgentApplication.prototype.onAgenticUserWorkloadOnboardingNotification = onAgenticUserWorkloadOnboardingNotification;
218
+ agents_hosting_1.AgentApplication.prototype.onAgenticUserDeletedNotification = onAgenticUserIdentityDeletedNotification;
219
+ //# sourceMappingURL=agent-notification.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-notification.js","sourceRoot":"","sources":["../../src/agent-notification.ts"],"names":[],"mappings":";;AAAA,8DAA6G;AAC7G,sFAA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CAAsB;QACtB,wCAA4B;KAC7B,CAAC;IACF,OAAO,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;AACvD,CAAC;AAED;;GAEG;AACH,SAAS,qBAAqB,CAAC,cAAsB;IACnD,MAAM,oBAAoB,GAAG;QAC3B,wCAA4B;QAC5B,oDAAwC;QACxC,wCAA4B;KAC7B,CAAC;IACF,OAAO,oBAAoB,CAAC,QAAQ,CAAC,cAAc,CAAC,WAAW,EAAE,CAAC,CAAC;AACrE,CAAC;AAgBD,iCAAgB,CAAC,SAAS,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;AACrE,iCAAgB,CAAC,SAAS,CAAC,0BAA0B,GAAG,0BAA0B,CAAC;AACnF,iCAAgB,CAAC,SAAS,CAAC,yBAAyB,GAAG,yBAAyB,CAAC;AACjF,iCAAgB,CAAC,SAAS,CAAC,0BAA0B,GAAG,0BAA0B,CAAC;AACnF,iCAAgB,CAAC,SAAS,CAAC,+BAA+B,GAAG,+BAA+B,CAAC;AAC7F,iCAAgB,CAAC,SAAS,CAAC,uBAAuB,GAAG,uBAAuB,CAAC;AAC7E,iCAAgB,CAAC,SAAS,CAAC,gCAAgC,GAAG,wCAAwC,CAAC;AACvG,iCAAgB,CAAC,SAAS,CAAC,2CAA2C,GAAG,2CAA2C,CAAC;AACrH,iCAAgB,CAAC,SAAS,CAAC,gCAAgC,GAAG,wCAAwC,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Channel and sub-channel constants for agent notifications.
3
+ */
4
+ export declare const AGENTS_CHANNEL = "agents";
5
+ export declare const AGENTS_EMAIL_SUBCHANNEL = "agents:email";
6
+ export declare const AGENTS_EXCEL_SUBCHANNEL = "agents:excel";
7
+ export declare const AGENTS_WORD_SUBCHANNEL = "agents:word";
8
+ export declare const AGENTS_POWERPOINT_SUBCHANNEL = "agents:powerpoint";
9
+ /**
10
+ * Lifecycle constants for agent notifications.
11
+ */
12
+ export declare const AGENT_LIFECYCLE = "agentlifecycle";
13
+ export declare const USER_CREATED_LIFECYCLE_EVENT = "agenticuseridentitycreated";
14
+ export declare const USER_WORKLOAD_ONBOARDING_LIFECYCLE_EVENT = "agenticuserworkloadonboardingupdated";
15
+ export declare const USER_DELETED_LIFECYCLE_EVENT = "agenticuserdeleted";
16
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,cAAc,WAAW,CAAC;AACvC,eAAO,MAAM,uBAAuB,iBAAiB,CAAC;AACtD,eAAO,MAAM,uBAAuB,iBAAiB,CAAC;AACtD,eAAO,MAAM,sBAAsB,gBAAgB,CAAC;AACpD,eAAO,MAAM,4BAA4B,sBAAsB,CAAC;AAEhE;;GAEG;AACH,eAAO,MAAM,eAAe,mBAAmB,CAAC;AAChD,eAAO,MAAM,4BAA4B,+BAA+B,CAAC;AACzE,eAAO,MAAM,wCAAwC,yCAAyC,CAAC;AAC/F,eAAO,MAAM,4BAA4B,uBAAuB,CAAC"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.USER_DELETED_LIFECYCLE_EVENT = exports.USER_WORKLOAD_ONBOARDING_LIFECYCLE_EVENT = exports.USER_CREATED_LIFECYCLE_EVENT = exports.AGENT_LIFECYCLE = exports.AGENTS_POWERPOINT_SUBCHANNEL = exports.AGENTS_WORD_SUBCHANNEL = exports.AGENTS_EXCEL_SUBCHANNEL = exports.AGENTS_EMAIL_SUBCHANNEL = exports.AGENTS_CHANNEL = void 0;
4
+ /**
5
+ * Channel and sub-channel constants for agent notifications.
6
+ */
7
+ exports.AGENTS_CHANNEL = 'agents';
8
+ exports.AGENTS_EMAIL_SUBCHANNEL = 'agents:email';
9
+ exports.AGENTS_EXCEL_SUBCHANNEL = 'agents:excel';
10
+ exports.AGENTS_WORD_SUBCHANNEL = 'agents:word';
11
+ exports.AGENTS_POWERPOINT_SUBCHANNEL = 'agents:powerpoint';
12
+ /**
13
+ * Lifecycle constants for agent notifications.
14
+ */
15
+ exports.AGENT_LIFECYCLE = 'agentlifecycle';
16
+ exports.USER_CREATED_LIFECYCLE_EVENT = 'agenticuseridentitycreated';
17
+ exports.USER_WORKLOAD_ONBOARDING_LIFECYCLE_EVENT = 'agenticuserworkloadonboardingupdated';
18
+ exports.USER_DELETED_LIFECYCLE_EVENT = 'agenticuserdeleted';
19
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACU,QAAA,cAAc,GAAG,QAAQ,CAAC;AAC1B,QAAA,uBAAuB,GAAG,cAAc,CAAC;AACzC,QAAA,uBAAuB,GAAG,cAAc,CAAC;AACzC,QAAA,sBAAsB,GAAG,aAAa,CAAC;AACvC,QAAA,4BAA4B,GAAG,mBAAmB,CAAC;AAEhE;;GAEG;AACU,QAAA,eAAe,GAAG,gBAAgB,CAAC;AACnC,QAAA,4BAA4B,GAAG,4BAA4B,CAAC;AAC5D,QAAA,wCAAwC,GAAG,sCAAsC,CAAC;AAClF,QAAA,4BAA4B,GAAG,oBAAoB,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { TurnContext, TurnState } from '@microsoft/agents-hosting';
2
+ import { AgentNotificationActivity } from '../models/agent-notification-activity';
3
+ /**
4
+ * Type definition for an agent notification handler function.
5
+ * Handles agent notification activities with strongly-typed notification data.
6
+ *
7
+ * @param turnContext - The turn context
8
+ * @param turnState - The turn state
9
+ * @param agentNotificationActivity - The parsed notification activity containing notification types
10
+ */
11
+ export type AgentNotificationHandler<TState extends TurnState = TurnState> = (turnContext: TurnContext, turnState: TState, agentNotificationActivity: AgentNotificationActivity) => Promise<void>;
12
+ //# sourceMappingURL=agent-notification-handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-notification-handler.d.ts","sourceRoot":"","sources":["../../../src/extensions/agent-notification-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAElF;;;;;;;GAOG;AACH,MAAM,MAAM,wBAAwB,CAAC,MAAM,SAAS,SAAS,GAAG,SAAS,IAAI,CAC3E,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,MAAM,EACjB,yBAAyB,EAAE,yBAAyB,KACjD,OAAO,CAAC,IAAI,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=agent-notification-handler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-notification-handler.js","sourceRoot":"","sources":["../../../src/extensions/agent-notification-handler.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export * from './agent-notification-handler';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/extensions/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./agent-notification-handler"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/extensions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+DAA6C"}
@@ -0,0 +1,5 @@
1
+ export * from './models';
2
+ export * from './extensions';
3
+ export * from './constants';
4
+ export * from './agent-notification';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,cAAc,UAAU,CAAC;AAGzB,cAAc,cAAc,CAAC;AAG7B,cAAc,aAAa,CAAC;AAG5B,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ // Export all models
18
+ __exportStar(require("./models"), exports);
19
+ // Export all extensions
20
+ __exportStar(require("./extensions"), exports);
21
+ // Export all constants
22
+ __exportStar(require("./constants"), exports);
23
+ // Export main notification functions
24
+ __exportStar(require("./agent-notification"), exports);
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oBAAoB;AACpB,2CAAyB;AAEzB,wBAAwB;AACxB,+CAA6B;AAE7B,uBAAuB;AACvB,8CAA4B;AAE5B,qCAAqC;AACrC,uDAAqC"}
@@ -0,0 +1,56 @@
1
+ import { NotificationType } from './notification-type';
2
+ import { EmailReference } from './email-reference';
3
+ import { WpxComment } from './wpx-comment';
4
+ import { Activity, ConversationAccount, ChannelAccount } from '@microsoft/agents-activity';
5
+ /**
6
+ * Represents a parsed agent notification activity with strongly-typed notification data.
7
+ */
8
+ export interface AgentNotificationActivity {
9
+ /**
10
+ * WPX comment notification if present.
11
+ */
12
+ wpxCommentNotification?: WpxComment;
13
+ /**
14
+ * Email notification if present.
15
+ */
16
+ emailNotification?: EmailReference;
17
+ /**
18
+ * The type of notification detected.
19
+ */
20
+ notificationType: NotificationType;
21
+ /**
22
+ * The conversation account.
23
+ */
24
+ conversation?: ConversationAccount;
25
+ /**
26
+ * The sender of the activity.
27
+ */
28
+ from: ChannelAccount;
29
+ /**
30
+ * The recipient of the activity.
31
+ */
32
+ recipient: ChannelAccount;
33
+ /**
34
+ * Channel-specific data.
35
+ */
36
+ channelData: unknown;
37
+ /**
38
+ * The text content of the activity.
39
+ */
40
+ text: string;
41
+ /**
42
+ * The value type of the activity.
43
+ */
44
+ valueType: string;
45
+ /**
46
+ * The value payload of the activity.
47
+ */
48
+ value: unknown;
49
+ }
50
+ /**
51
+ * Creates a wrapper for an agent notification activity.
52
+ * @param activity - The activity
53
+ * @returns An agent notification activity
54
+ */
55
+ export declare function createAgentNotificationActivity(activity: Activity): AgentNotificationActivity;
56
+ //# sourceMappingURL=agent-notification-activity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-notification-activity.d.ts","sourceRoot":"","sources":["../../../src/models/agent-notification-activity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAoB,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAE,UAAU,EAAgB,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAO3F;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,sBAAsB,CAAC,EAAE,UAAU,CAAC;IAEpC;;OAEG;IACH,iBAAiB,CAAC,EAAE,cAAc,CAAC;IAEnC;;OAEG;IACH,gBAAgB,EAAE,gBAAgB,CAAC;IAEnC;;OAEG;IACH,YAAY,CAAC,EAAE,mBAAmB,CAAC;IAEnC;;OAEG;IACH,IAAI,EAAE,cAAc,CAAC;IAErB;;OAEG;IACH,SAAS,EAAE,cAAc,CAAC;IAE1B;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAC7C,QAAQ,EAAE,QAAQ,GACjB,yBAAyB,CAuC3B"}
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createAgentNotificationActivity = createAgentNotificationActivity;
4
+ const notification_type_1 = require("./notification-type");
5
+ const email_reference_1 = require("./email-reference");
6
+ const wpx_comment_1 = require("./wpx-comment");
7
+ const constants_1 = require("../constants");
8
+ /**
9
+ * Creates a wrapper for an agent notification activity.
10
+ * @param activity - The activity
11
+ * @returns An agent notification activity
12
+ */
13
+ function createAgentNotificationActivity(activity) {
14
+ if (!activity) {
15
+ throw new Error('Activity cannot be null or undefined');
16
+ }
17
+ let notificationType = notification_type_1.NotificationType.Unknown;
18
+ let wpxCommentNotification;
19
+ let emailNotification;
20
+ // Parse entities to extract notification types
21
+ if (activity.entities && Array.isArray(activity.entities)) {
22
+ for (const entity of activity.entities) {
23
+ if ((0, wpx_comment_1.isWpxComment)(entity)) {
24
+ wpxCommentNotification = entity;
25
+ notificationType = notification_type_1.NotificationType.WpxComment;
26
+ }
27
+ else if ((0, email_reference_1.isEmailReference)(entity)) {
28
+ emailNotification = entity;
29
+ notificationType = notification_type_1.NotificationType.EmailNotification;
30
+ }
31
+ }
32
+ }
33
+ else {
34
+ if (activity.name && activity.name.toLowerCase() === constants_1.AGENT_LIFECYCLE) {
35
+ notificationType = notification_type_1.NotificationType.AgentLifecycleNotification;
36
+ }
37
+ }
38
+ return {
39
+ wpxCommentNotification,
40
+ emailNotification,
41
+ notificationType,
42
+ conversation: activity.conversation,
43
+ from: activity.from ?? {},
44
+ recipient: activity.recipient ?? {},
45
+ channelData: activity.channelData ?? {},
46
+ text: activity.text ?? '',
47
+ valueType: activity.valueType ?? '',
48
+ value: activity.value ?? {}
49
+ };
50
+ }
51
+ //# sourceMappingURL=agent-notification-activity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent-notification-activity.js","sourceRoot":"","sources":["../../../src/models/agent-notification-activity.ts"],"names":[],"mappings":";;AAsEA,0EAyCC;AA/GD,2DAAuD;AACvD,uDAAqE;AACrE,+CAAyD;AAGzD,4CAEsB;AA0DtB;;;;GAIG;AACH,SAAgB,+BAA+B,CAC7C,QAAkB;IAElB,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;IAC1D,CAAC;IAED,IAAI,gBAAgB,GAAG,oCAAgB,CAAC,OAAO,CAAC;IAChD,IAAI,sBAA8C,CAAC;IACnD,IAAI,iBAA6C,CAAC;IAElD,+CAA+C;IAC/C,IAAI,QAAQ,CAAC,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC1D,KAAK,MAAM,MAAM,IAAI,QAAQ,CAAC,QAAQ,EAAE,CAAC;YACvC,IAAI,IAAA,0BAAY,EAAC,MAAM,CAAC,EAAE,CAAC;gBACzB,sBAAsB,GAAG,MAAM,CAAC;gBAChC,gBAAgB,GAAG,oCAAgB,CAAC,UAAU,CAAC;YACjD,CAAC;iBAAM,IAAI,IAAA,kCAAgB,EAAC,MAAM,CAAC,EAAE,CAAC;gBACpC,iBAAiB,GAAG,MAAM,CAAC;gBAC3B,gBAAgB,GAAG,oCAAgB,CAAC,iBAAiB,CAAC;YACxD,CAAC;QACH,CAAC;IACH,CAAC;SACI,CAAC;QACJ,IAAI,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,2BAAe,EAAC,CAAC;YACpE,gBAAgB,GAAG,oCAAgB,CAAC,0BAA0B,CAAC;QACjE,CAAC;IACH,CAAC;IAED,OAAO;QACL,sBAAsB;QACtB,iBAAiB;QACjB,gBAAgB;QAChB,YAAY,EAAE,QAAQ,CAAC,YAAY;QACnC,IAAI,EAAE,QAAQ,CAAC,IAAI,IAAI,EAAE;QACzB,SAAS,EAAE,QAAQ,CAAC,SAAS,IAAI,EAAE;QACnC,WAAW,EAAE,QAAQ,CAAC,WAAW,IAAI,EAAE;QACvC,IAAI,EAAE,QAAQ,CAAC,IAAI,IAAI,EAAE;QACzB,SAAS,EAAE,QAAQ,CAAC,SAAS,IAAI,EAAE;QACnC,KAAK,EAAE,QAAQ,CAAC,KAAK,IAAI,EAAE;KAC5B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,35 @@
1
+ import { Entity } from '@microsoft/agents-activity';
2
+ /**
3
+ * Represents an email notification entity.
4
+ */
5
+ export interface EmailReference extends Entity {
6
+ /**
7
+ * The type of the entity. Always 'emailNotification'.
8
+ */
9
+ type: 'emailNotification';
10
+ /**
11
+ * The ID of the email.
12
+ */
13
+ id?: string;
14
+ /**
15
+ * The conversation ID associated with the email.
16
+ */
17
+ conversationId?: string;
18
+ /**
19
+ * The HTML body content of the email.
20
+ */
21
+ htmlBody?: string;
22
+ }
23
+ /**
24
+ * The entity type name for email notifications.
25
+ */
26
+ export declare const EMAIL_NOTIFICATION_TYPE = "emailNotification";
27
+ /**
28
+ * Type guard to check if an entity is an EmailReference.
29
+ */
30
+ export declare function isEmailReference(entity: Entity): entity is EmailReference;
31
+ /**
32
+ * Factory function to create an EmailReference entity.
33
+ */
34
+ export declare function createEmailReference(id?: string, conversationId?: string, htmlBody?: string): EmailReference;
35
+ //# sourceMappingURL=email-reference.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email-reference.d.ts","sourceRoot":"","sources":["../../../src/models/email-reference.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEpD;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,MAAM;IAC5C;;OAEG;IACH,IAAI,EAAE,mBAAmB,CAAC;IAE1B;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,sBAAsB,CAAC;AAE3D;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,cAAc,CAEzE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,EAAE,CAAC,EAAE,MAAM,EACX,cAAc,CAAC,EAAE,MAAM,EACvB,QAAQ,CAAC,EAAE,MAAM,GAChB,cAAc,CAOhB"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EMAIL_NOTIFICATION_TYPE = void 0;
4
+ exports.isEmailReference = isEmailReference;
5
+ exports.createEmailReference = createEmailReference;
6
+ /**
7
+ * The entity type name for email notifications.
8
+ */
9
+ exports.EMAIL_NOTIFICATION_TYPE = 'emailNotification';
10
+ /**
11
+ * Type guard to check if an entity is an EmailReference.
12
+ */
13
+ function isEmailReference(entity) {
14
+ return entity?.type?.toLowerCase() === exports.EMAIL_NOTIFICATION_TYPE.toLowerCase();
15
+ }
16
+ /**
17
+ * Factory function to create an EmailReference entity.
18
+ */
19
+ function createEmailReference(id, conversationId, htmlBody) {
20
+ return {
21
+ type: 'emailNotification',
22
+ id,
23
+ conversationId,
24
+ htmlBody,
25
+ };
26
+ }
27
+ //# sourceMappingURL=email-reference.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"email-reference.js","sourceRoot":"","sources":["../../../src/models/email-reference.ts"],"names":[],"mappings":";;;AAmCA,4CAEC;AAKD,oDAWC;AA1BD;;GAEG;AACU,QAAA,uBAAuB,GAAG,mBAAmB,CAAC;AAE3D;;GAEG;AACH,SAAgB,gBAAgB,CAAC,MAAc;IAC7C,OAAO,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,+BAAuB,CAAC,WAAW,EAAE,CAAC;AAC/E,CAAC;AAED;;GAEG;AACH,SAAgB,oBAAoB,CAClC,EAAW,EACX,cAAuB,EACvB,QAAiB;IAEjB,OAAO;QACL,IAAI,EAAE,mBAAmB;QACzB,EAAE;QACF,cAAc;QACd,QAAQ;KACT,CAAC;AACJ,CAAC"}