@burdenoff/mcp-libs 2026.511.1

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 (174) hide show
  1. package/README.md +76 -0
  2. package/dist/chunk-4GBVJ4OY.js +847 -0
  3. package/dist/chunk-4GBVJ4OY.js.map +1 -0
  4. package/dist/chunk-H2OYWLOA.js +919 -0
  5. package/dist/chunk-H2OYWLOA.js.map +1 -0
  6. package/dist/chunk-JFEQYSWM.js +174 -0
  7. package/dist/chunk-JFEQYSWM.js.map +1 -0
  8. package/dist/chunk-WWFVD7BO.js +273 -0
  9. package/dist/chunk-WWFVD7BO.js.map +1 -0
  10. package/dist/context-1jV4NsLv.d.cts +138 -0
  11. package/dist/context-1jV4NsLv.d.ts +138 -0
  12. package/dist/core/index.cjs +953 -0
  13. package/dist/core/index.cjs.map +1 -0
  14. package/dist/core/index.d.cts +59 -0
  15. package/dist/core/index.d.ts +59 -0
  16. package/dist/core/index.js +3 -0
  17. package/dist/core/index.js.map +1 -0
  18. package/dist/http-BP4c721D.d.cts +22 -0
  19. package/dist/http-DXTeCD5r.d.ts +22 -0
  20. package/dist/index.cjs +1013 -0
  21. package/dist/index.cjs.map +1 -0
  22. package/dist/index.d.cts +7 -0
  23. package/dist/index.d.ts +7 -0
  24. package/dist/index.js +4 -0
  25. package/dist/index.js.map +1 -0
  26. package/dist/module-DBcfA-i3.d.ts +67 -0
  27. package/dist/module-DFQBZNK6.d.cts +67 -0
  28. package/dist/modules/auth/index.cjs +533 -0
  29. package/dist/modules/auth/index.cjs.map +1 -0
  30. package/dist/modules/auth/index.d.cts +51 -0
  31. package/dist/modules/auth/index.d.ts +51 -0
  32. package/dist/modules/auth/index.js +159 -0
  33. package/dist/modules/auth/index.js.map +1 -0
  34. package/dist/modules/billing/index.cjs +655 -0
  35. package/dist/modules/billing/index.cjs.map +1 -0
  36. package/dist/modules/billing/index.d.cts +8 -0
  37. package/dist/modules/billing/index.d.ts +8 -0
  38. package/dist/modules/billing/index.js +606 -0
  39. package/dist/modules/billing/index.js.map +1 -0
  40. package/dist/modules/channels/index.cjs +443 -0
  41. package/dist/modules/channels/index.cjs.map +1 -0
  42. package/dist/modules/channels/index.d.cts +8 -0
  43. package/dist/modules/channels/index.d.ts +8 -0
  44. package/dist/modules/channels/index.js +394 -0
  45. package/dist/modules/channels/index.js.map +1 -0
  46. package/dist/modules/conversations/index.cjs +288 -0
  47. package/dist/modules/conversations/index.cjs.map +1 -0
  48. package/dist/modules/conversations/index.d.cts +8 -0
  49. package/dist/modules/conversations/index.d.ts +8 -0
  50. package/dist/modules/conversations/index.js +239 -0
  51. package/dist/modules/conversations/index.js.map +1 -0
  52. package/dist/modules/devportal/index.cjs +796 -0
  53. package/dist/modules/devportal/index.cjs.map +1 -0
  54. package/dist/modules/devportal/index.d.cts +8 -0
  55. package/dist/modules/devportal/index.d.ts +8 -0
  56. package/dist/modules/devportal/index.js +747 -0
  57. package/dist/modules/devportal/index.js.map +1 -0
  58. package/dist/modules/export/index.cjs +333 -0
  59. package/dist/modules/export/index.cjs.map +1 -0
  60. package/dist/modules/export/index.d.cts +8 -0
  61. package/dist/modules/export/index.d.ts +8 -0
  62. package/dist/modules/export/index.js +284 -0
  63. package/dist/modules/export/index.js.map +1 -0
  64. package/dist/modules/files/index.cjs +278 -0
  65. package/dist/modules/files/index.cjs.map +1 -0
  66. package/dist/modules/files/index.d.cts +8 -0
  67. package/dist/modules/files/index.d.ts +8 -0
  68. package/dist/modules/files/index.js +229 -0
  69. package/dist/modules/files/index.js.map +1 -0
  70. package/dist/modules/groups/index.cjs +451 -0
  71. package/dist/modules/groups/index.cjs.map +1 -0
  72. package/dist/modules/groups/index.d.cts +8 -0
  73. package/dist/modules/groups/index.d.ts +8 -0
  74. package/dist/modules/groups/index.js +402 -0
  75. package/dist/modules/groups/index.js.map +1 -0
  76. package/dist/modules/health/index.cjs +159 -0
  77. package/dist/modules/health/index.cjs.map +1 -0
  78. package/dist/modules/health/index.d.cts +8 -0
  79. package/dist/modules/health/index.d.ts +8 -0
  80. package/dist/modules/health/index.js +36 -0
  81. package/dist/modules/health/index.js.map +1 -0
  82. package/dist/modules/integrations/index.cjs +316 -0
  83. package/dist/modules/integrations/index.cjs.map +1 -0
  84. package/dist/modules/integrations/index.d.cts +8 -0
  85. package/dist/modules/integrations/index.d.ts +8 -0
  86. package/dist/modules/integrations/index.js +267 -0
  87. package/dist/modules/integrations/index.js.map +1 -0
  88. package/dist/modules/notifications/index.cjs +222 -0
  89. package/dist/modules/notifications/index.cjs.map +1 -0
  90. package/dist/modules/notifications/index.d.cts +8 -0
  91. package/dist/modules/notifications/index.d.ts +8 -0
  92. package/dist/modules/notifications/index.js +173 -0
  93. package/dist/modules/notifications/index.js.map +1 -0
  94. package/dist/modules/organizations/index.cjs +267 -0
  95. package/dist/modules/organizations/index.cjs.map +1 -0
  96. package/dist/modules/organizations/index.d.cts +8 -0
  97. package/dist/modules/organizations/index.d.ts +8 -0
  98. package/dist/modules/organizations/index.js +218 -0
  99. package/dist/modules/organizations/index.js.map +1 -0
  100. package/dist/modules/products/index.cjs +736 -0
  101. package/dist/modules/products/index.cjs.map +1 -0
  102. package/dist/modules/products/index.d.cts +8 -0
  103. package/dist/modules/products/index.d.ts +8 -0
  104. package/dist/modules/products/index.js +687 -0
  105. package/dist/modules/products/index.js.map +1 -0
  106. package/dist/modules/rbac/index.cjs +378 -0
  107. package/dist/modules/rbac/index.cjs.map +1 -0
  108. package/dist/modules/rbac/index.d.cts +8 -0
  109. package/dist/modules/rbac/index.d.ts +8 -0
  110. package/dist/modules/rbac/index.js +329 -0
  111. package/dist/modules/rbac/index.js.map +1 -0
  112. package/dist/modules/sandbox/index.cjs +318 -0
  113. package/dist/modules/sandbox/index.cjs.map +1 -0
  114. package/dist/modules/sandbox/index.d.cts +8 -0
  115. package/dist/modules/sandbox/index.d.ts +8 -0
  116. package/dist/modules/sandbox/index.js +225 -0
  117. package/dist/modules/sandbox/index.js.map +1 -0
  118. package/dist/modules/scheduler/index.cjs +267 -0
  119. package/dist/modules/scheduler/index.cjs.map +1 -0
  120. package/dist/modules/scheduler/index.d.cts +8 -0
  121. package/dist/modules/scheduler/index.d.ts +8 -0
  122. package/dist/modules/scheduler/index.js +218 -0
  123. package/dist/modules/scheduler/index.js.map +1 -0
  124. package/dist/modules/security/index.cjs +529 -0
  125. package/dist/modules/security/index.cjs.map +1 -0
  126. package/dist/modules/security/index.d.cts +8 -0
  127. package/dist/modules/security/index.d.ts +8 -0
  128. package/dist/modules/security/index.js +480 -0
  129. package/dist/modules/security/index.js.map +1 -0
  130. package/dist/modules/store/index.cjs +450 -0
  131. package/dist/modules/store/index.cjs.map +1 -0
  132. package/dist/modules/store/index.d.cts +8 -0
  133. package/dist/modules/store/index.d.ts +8 -0
  134. package/dist/modules/store/index.js +401 -0
  135. package/dist/modules/store/index.js.map +1 -0
  136. package/dist/modules/support/index.cjs +285 -0
  137. package/dist/modules/support/index.cjs.map +1 -0
  138. package/dist/modules/support/index.d.cts +8 -0
  139. package/dist/modules/support/index.d.ts +8 -0
  140. package/dist/modules/support/index.js +236 -0
  141. package/dist/modules/support/index.js.map +1 -0
  142. package/dist/modules/tags/index.cjs +421 -0
  143. package/dist/modules/tags/index.cjs.map +1 -0
  144. package/dist/modules/tags/index.d.cts +8 -0
  145. package/dist/modules/tags/index.d.ts +8 -0
  146. package/dist/modules/tags/index.js +372 -0
  147. package/dist/modules/tags/index.js.map +1 -0
  148. package/dist/modules/tours/index.cjs +225 -0
  149. package/dist/modules/tours/index.cjs.map +1 -0
  150. package/dist/modules/tours/index.d.cts +8 -0
  151. package/dist/modules/tours/index.d.ts +8 -0
  152. package/dist/modules/tours/index.js +176 -0
  153. package/dist/modules/tours/index.js.map +1 -0
  154. package/dist/modules/vibecontrols/index.cjs +5551 -0
  155. package/dist/modules/vibecontrols/index.cjs.map +1 -0
  156. package/dist/modules/vibecontrols/index.d.cts +8 -0
  157. package/dist/modules/vibecontrols/index.d.ts +8 -0
  158. package/dist/modules/vibecontrols/index.js +4380 -0
  159. package/dist/modules/vibecontrols/index.js.map +1 -0
  160. package/dist/modules/workspaces/index.cjs +552 -0
  161. package/dist/modules/workspaces/index.cjs.map +1 -0
  162. package/dist/modules/workspaces/index.d.cts +8 -0
  163. package/dist/modules/workspaces/index.d.ts +8 -0
  164. package/dist/modules/workspaces/index.js +503 -0
  165. package/dist/modules/workspaces/index.js.map +1 -0
  166. package/dist/tool-name-CQf_IqAj.d.cts +47 -0
  167. package/dist/tool-name-DlnrBsZ6.d.ts +47 -0
  168. package/dist/transports/index.cjs +183 -0
  169. package/dist/transports/index.cjs.map +1 -0
  170. package/dist/transports/index.d.cts +13 -0
  171. package/dist/transports/index.d.ts +13 -0
  172. package/dist/transports/index.js +3 -0
  173. package/dist/transports/index.js.map +1 -0
  174. package/package.json +125 -0
@@ -0,0 +1,394 @@
1
+ import { mcpToolName, jsonResult, errorResult } from '../../chunk-H2OYWLOA.js';
2
+ import { z } from 'zod';
3
+
4
+ // src/modules/channels/operations.ts
5
+ var GET_CHANNELS = `
6
+ query GetChannels($filter: ChannelFilterInput, $pagination: ChannelPaginationInput) {
7
+ getChannels(filter: $filter, pagination: $pagination) {
8
+ items { id name platform adapterType status connectionHealth priority createdAt }
9
+ total hasMore
10
+ }
11
+ }
12
+ `;
13
+ var GET_CHANNEL = `
14
+ query GetChannel($id: ID!) {
15
+ getChannel(id: $id) {
16
+ id name platform adapterType status channelType
17
+ connection { id authType isActive isHealthy }
18
+ }
19
+ }
20
+ `;
21
+ var CREATE_CHANNEL = `
22
+ mutation CreateChannel($input: CreateChannelInput!) {
23
+ createChannel(input: $input) {
24
+ id name platform adapterType status
25
+ }
26
+ }
27
+ `;
28
+ var DELETE_CHANNEL = `
29
+ mutation DeleteChannel($id: ID!) {
30
+ deleteChannel(id: $id)
31
+ }
32
+ `;
33
+ var SEND_CHANNEL_MESSAGE = `
34
+ mutation SendChannelMessage($input: SendMessageInput!) {
35
+ sendMessage(input: $input) {
36
+ success messageId status sentAt
37
+ error { code message retryable }
38
+ }
39
+ }
40
+ `;
41
+ var GET_CHANNEL_DELIVERY_ATTEMPTS = `
42
+ query GetChannelDeliveryAttempts($channelId: ID!, $cursor: String, $limit: Int) {
43
+ getChannelDeliveryAttempts(channelId: $channelId, cursor: $cursor, limit: $limit) {
44
+ items { id channelId status sentAt retryCount errorMessage }
45
+ total hasMore
46
+ }
47
+ }
48
+ `;
49
+ var LIST_CHANNEL_USERS = `
50
+ query ListChannelUsers($channelId: ID!, $pagination: ChannelPaginationInput) {
51
+ listUserPlatformConnectionsByChannel(channelId: $channelId, pagination: $pagination) {
52
+ items { id externalUserId externalDisplayName platform dmAllowed presenceStatus }
53
+ total hasMore
54
+ }
55
+ }
56
+ `;
57
+ var GET_CHANNEL_WEBHOOK_EVENTS = `
58
+ query GetChannelWebhookEvents($channelId: ID!, $cursor: String, $limit: Int) {
59
+ getChannelWebhookEvents(channelId: $channelId, cursor: $cursor, limit: $limit) {
60
+ items { id eventType status createdAt }
61
+ total hasMore
62
+ }
63
+ }
64
+ `;
65
+ var GET_CONNECTIONS_BY_ORG = `
66
+ query GetConnectionsByOrg($organizationId: ID!, $pagination: ChannelPaginationInput) {
67
+ getConnectionsByOrganization(organizationId: $organizationId, pagination: $pagination) {
68
+ items { id channelId authType tokenExpiresAt isActive isHealthy }
69
+ total hasMore
70
+ }
71
+ }
72
+ `;
73
+ var CREATE_CHANNEL_CONNECTION = `
74
+ mutation CreateChannelConnection($input: CreateConnectionInput!) {
75
+ createConnection(input: $input) {
76
+ id channelId authType isActive
77
+ }
78
+ }
79
+ `;
80
+ var DELETE_CHANNEL_CONNECTION = `
81
+ mutation DeleteChannelConnection($id: ID!) {
82
+ deleteConnection(id: $id)
83
+ }
84
+ `;
85
+
86
+ // src/modules/channels/tools.ts
87
+ function registerChannelsTools(server, ctx, track) {
88
+ server.registerTool(
89
+ track(mcpToolName(ctx.productName, "channels_list")),
90
+ {
91
+ title: "List Channels",
92
+ description: "List channels with optional platform/status filters and pagination.",
93
+ inputSchema: {
94
+ platform: z.string().optional().describe("Filter by platform (will be uppercased)"),
95
+ status: z.string().optional().describe("Filter by status (will be uppercased)"),
96
+ limit: z.number().optional().describe("Page size (default 50)")
97
+ }
98
+ },
99
+ async ({ platform, status, limit }) => {
100
+ try {
101
+ const filter = {};
102
+ if (platform !== void 0) filter.platform = platform.toUpperCase();
103
+ if (status !== void 0) filter.status = status.toUpperCase();
104
+ const data = await ctx.gql.global.request(GET_CHANNELS, {
105
+ filter: Object.keys(filter).length ? filter : void 0,
106
+ pagination: { limit: limit ?? 50, offset: 0 }
107
+ });
108
+ return jsonResult(data.getChannels);
109
+ } catch (error) {
110
+ ctx.logger.error("channels_list failed", { error: String(error) });
111
+ return errorResult(
112
+ `Failed to list channels: ${error instanceof Error ? error.message : String(error)}`
113
+ );
114
+ }
115
+ }
116
+ );
117
+ server.registerTool(
118
+ track(mcpToolName(ctx.productName, "channels_get")),
119
+ {
120
+ title: "Get Channel",
121
+ description: "Get a channel by its ID.",
122
+ inputSchema: { id: z.string().describe("Channel ID") }
123
+ },
124
+ async ({ id }) => {
125
+ try {
126
+ const data = await ctx.gql.global.request(
127
+ GET_CHANNEL,
128
+ { id }
129
+ );
130
+ if (!data.getChannel) return errorResult(`Channel ${id} not found`);
131
+ return jsonResult(data.getChannel);
132
+ } catch (error) {
133
+ ctx.logger.error("channels_get failed", { error: String(error) });
134
+ return errorResult(
135
+ `Failed to get channel: ${error instanceof Error ? error.message : String(error)}`
136
+ );
137
+ }
138
+ }
139
+ );
140
+ server.registerTool(
141
+ track(mcpToolName(ctx.productName, "channels_create")),
142
+ {
143
+ title: "Create Channel",
144
+ description: "Create a new channel.",
145
+ inputSchema: {
146
+ name: z.string().describe("Channel name"),
147
+ platform: z.string().describe("EMAIL|SMS|SLACK|TEAMS|DISCORD|WHATSAPP|WEBHOOK (will be uppercased)"),
148
+ adapter: z.string().optional().describe("Adapter type (will be uppercased)")
149
+ }
150
+ },
151
+ async ({ name, platform, adapter }) => {
152
+ try {
153
+ const input = {
154
+ name,
155
+ platform: platform.toUpperCase()
156
+ };
157
+ if (adapter !== void 0) input.adapterType = adapter.toUpperCase();
158
+ const data = await ctx.gql.global.request(
159
+ CREATE_CHANNEL,
160
+ { input }
161
+ );
162
+ return jsonResult(data.createChannel);
163
+ } catch (error) {
164
+ ctx.logger.error("channels_create failed", { error: String(error) });
165
+ return errorResult(
166
+ `Failed to create channel: ${error instanceof Error ? error.message : String(error)}`
167
+ );
168
+ }
169
+ }
170
+ );
171
+ server.registerTool(
172
+ track(mcpToolName(ctx.productName, "channels_delete")),
173
+ {
174
+ title: "Delete Channel",
175
+ description: "Delete a channel by ID.",
176
+ inputSchema: { id: z.string().describe("Channel ID") }
177
+ },
178
+ async ({ id }) => {
179
+ try {
180
+ const data = await ctx.gql.global.request(DELETE_CHANNEL, {
181
+ id
182
+ });
183
+ return jsonResult({ deleted: data.deleteChannel, channelId: id });
184
+ } catch (error) {
185
+ ctx.logger.error("channels_delete failed", { error: String(error) });
186
+ return errorResult(
187
+ `Failed to delete channel: ${error instanceof Error ? error.message : String(error)}`
188
+ );
189
+ }
190
+ }
191
+ );
192
+ server.registerTool(
193
+ track(mcpToolName(ctx.productName, "channels_send")),
194
+ {
195
+ title: "Send Channel Message",
196
+ description: "Send a message via a channel.",
197
+ inputSchema: {
198
+ channelId: z.string().describe("Channel ID"),
199
+ content: z.string().describe("Message content"),
200
+ recipient: z.string().optional().describe("External recipient id (e.g. email)"),
201
+ subject: z.string().optional().describe("Message subject")
202
+ }
203
+ },
204
+ async ({ channelId, content, recipient, subject }) => {
205
+ try {
206
+ const input = { channelId, content };
207
+ if (recipient !== void 0) input.recipientId = recipient;
208
+ if (subject !== void 0) input.subject = subject;
209
+ const data = await ctx.gql.global.request(SEND_CHANNEL_MESSAGE, { input });
210
+ return jsonResult(data.sendMessage);
211
+ } catch (error) {
212
+ ctx.logger.error("channels_send failed", { error: String(error) });
213
+ return errorResult(
214
+ `Failed to send channel message: ${error instanceof Error ? error.message : String(error)}`
215
+ );
216
+ }
217
+ }
218
+ );
219
+ server.registerTool(
220
+ track(mcpToolName(ctx.productName, "channels_deliveries")),
221
+ {
222
+ title: "List Channel Deliveries",
223
+ description: "Recent delivery attempts for a channel.",
224
+ inputSchema: {
225
+ channelId: z.string().describe("Channel ID"),
226
+ cursor: z.string().optional().describe("Pagination cursor"),
227
+ limit: z.number().optional().describe("Page size (default 100)")
228
+ }
229
+ },
230
+ async ({ channelId, cursor, limit }) => {
231
+ try {
232
+ const data = await ctx.gql.global.request(GET_CHANNEL_DELIVERY_ATTEMPTS, {
233
+ channelId,
234
+ cursor,
235
+ limit: limit ?? 100
236
+ });
237
+ return jsonResult(data.getChannelDeliveryAttempts);
238
+ } catch (error) {
239
+ ctx.logger.error("channels_deliveries failed", { error: String(error) });
240
+ return errorResult(
241
+ `Failed to list channel deliveries: ${error instanceof Error ? error.message : String(error)}`
242
+ );
243
+ }
244
+ }
245
+ );
246
+ server.registerTool(
247
+ track(mcpToolName(ctx.productName, "channels_users")),
248
+ {
249
+ title: "List Channel Users",
250
+ description: "Users connected to this channel.",
251
+ inputSchema: {
252
+ channelId: z.string().describe("Channel ID"),
253
+ limit: z.number().optional().describe("Page size (default 100)")
254
+ }
255
+ },
256
+ async ({ channelId, limit }) => {
257
+ try {
258
+ const data = await ctx.gql.global.request(LIST_CHANNEL_USERS, {
259
+ channelId,
260
+ pagination: { limit: limit ?? 100, offset: 0 }
261
+ });
262
+ return jsonResult(data.listUserPlatformConnectionsByChannel);
263
+ } catch (error) {
264
+ ctx.logger.error("channels_users failed", { error: String(error) });
265
+ return errorResult(
266
+ `Failed to list channel users: ${error instanceof Error ? error.message : String(error)}`
267
+ );
268
+ }
269
+ }
270
+ );
271
+ server.registerTool(
272
+ track(mcpToolName(ctx.productName, "channels_webhooks_list")),
273
+ {
274
+ title: "List Channel Webhook Events",
275
+ description: "List webhook events for a channel.",
276
+ inputSchema: {
277
+ channelId: z.string().describe("Channel ID"),
278
+ cursor: z.string().optional().describe("Pagination cursor"),
279
+ limit: z.number().optional().describe("Page size (default 100)")
280
+ }
281
+ },
282
+ async ({ channelId, cursor, limit }) => {
283
+ try {
284
+ const data = await ctx.gql.global.request(GET_CHANNEL_WEBHOOK_EVENTS, {
285
+ channelId,
286
+ cursor,
287
+ limit: limit ?? 100
288
+ });
289
+ return jsonResult(data.getChannelWebhookEvents);
290
+ } catch (error) {
291
+ ctx.logger.error("channels_webhooks_list failed", { error: String(error) });
292
+ return errorResult(
293
+ `Failed to list channel webhook events: ${error instanceof Error ? error.message : String(error)}`
294
+ );
295
+ }
296
+ }
297
+ );
298
+ server.registerTool(
299
+ track(mcpToolName(ctx.productName, "channels_connections_list")),
300
+ {
301
+ title: "List Channel Connections",
302
+ description: "List channel connections for an organization.",
303
+ inputSchema: {
304
+ organizationId: z.string().describe("Organization ID"),
305
+ limit: z.number().optional().describe("Page size (default 100)")
306
+ }
307
+ },
308
+ async ({ organizationId, limit }) => {
309
+ try {
310
+ const data = await ctx.gql.global.request(GET_CONNECTIONS_BY_ORG, {
311
+ organizationId,
312
+ pagination: { limit: limit ?? 100, offset: 0 }
313
+ });
314
+ return jsonResult(data.getConnectionsByOrganization);
315
+ } catch (error) {
316
+ ctx.logger.error("channels_connections_list failed", { error: String(error) });
317
+ return errorResult(
318
+ `Failed to list channel connections: ${error instanceof Error ? error.message : String(error)}`
319
+ );
320
+ }
321
+ }
322
+ );
323
+ server.registerTool(
324
+ track(mcpToolName(ctx.productName, "channels_connections_create")),
325
+ {
326
+ title: "Create Channel Connection",
327
+ description: "Create a channel connection (OAuth/API key/webhook).",
328
+ inputSchema: {
329
+ channelId: z.string().describe("Channel ID"),
330
+ authType: z.string().describe("OAUTH|API_KEY|WEBHOOK (will be uppercased)")
331
+ }
332
+ },
333
+ async ({ channelId, authType }) => {
334
+ try {
335
+ const input = {
336
+ channelId,
337
+ authType: authType.toUpperCase()
338
+ };
339
+ const data = await ctx.gql.global.request(CREATE_CHANNEL_CONNECTION, { input });
340
+ return jsonResult(data.createConnection);
341
+ } catch (error) {
342
+ ctx.logger.error("channels_connections_create failed", { error: String(error) });
343
+ return errorResult(
344
+ `Failed to create channel connection: ${error instanceof Error ? error.message : String(error)}`
345
+ );
346
+ }
347
+ }
348
+ );
349
+ server.registerTool(
350
+ track(mcpToolName(ctx.productName, "channels_connections_delete")),
351
+ {
352
+ title: "Delete Channel Connection",
353
+ description: "Delete a channel connection by ID.",
354
+ inputSchema: { id: z.string().describe("Connection ID") }
355
+ },
356
+ async ({ id }) => {
357
+ try {
358
+ const data = await ctx.gql.global.request(
359
+ DELETE_CHANNEL_CONNECTION,
360
+ { id }
361
+ );
362
+ return jsonResult({ deleted: data.deleteConnection, connectionId: id });
363
+ } catch (error) {
364
+ ctx.logger.error("channels_connections_delete failed", { error: String(error) });
365
+ return errorResult(
366
+ `Failed to delete channel connection: ${error instanceof Error ? error.message : String(error)}`
367
+ );
368
+ }
369
+ }
370
+ );
371
+ }
372
+
373
+ // src/modules/channels/index.ts
374
+ var channelsModule = {
375
+ id: "channels",
376
+ version: "0.0.1",
377
+ displayName: "Channels",
378
+ dependsOn: ["auth"],
379
+ capabilities: { tools: {} },
380
+ register(server, ctx) {
381
+ const tools = [];
382
+ const track = (n) => {
383
+ tools.push(n);
384
+ return n;
385
+ };
386
+ registerChannelsTools(server, ctx, track);
387
+ return { tools, resources: [], prompts: [] };
388
+ }
389
+ };
390
+ var channels_default = channelsModule;
391
+
392
+ export { channels_default as default };
393
+ //# sourceMappingURL=index.js.map
394
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/modules/channels/operations.ts","../../../src/modules/channels/tools.ts","../../../src/modules/channels/index.ts"],"names":[],"mappings":";;;;AAAO,IAAM,YAAA,GAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;AASrB,IAAM,WAAA,GAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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Ac,EAAE,KAAA,EAAO,EAAC,EAAE;AAAA,EAE1B,QAAA,CAAS,QAAmB,GAAA,EAAqC;AAC/D,IAAA,MAAM,QAAkB,EAAC;AACzB,IAAA,MAAM,KAAA,GAAQ,CAAC,CAAA,KAAsB;AACnC,MAAA,KAAA,CAAM,KAAK,CAAC,CAAA;AACZ,MAAA,OAAO,CAAA;AAAA,IACT,CAAA;AAEA,IAAA,qBAAA,CAAsB,MAAA,EAAQ,KAAK,KAAK,CAAA;AAExC,IAAA,OAAO,EAAE,KAAA,EAAO,SAAA,EAAW,EAAC,EAAG,OAAA,EAAS,EAAC,EAAE;AAAA,EAC7C;AACF,CAAA;AAEA,IAAO,gBAAA,GAAQ","file":"index.js","sourcesContent":["export const GET_CHANNELS = `\n query GetChannels($filter: ChannelFilterInput, $pagination: ChannelPaginationInput) {\n getChannels(filter: $filter, pagination: $pagination) {\n items { id name platform adapterType status connectionHealth priority createdAt }\n total hasMore\n }\n }\n`;\n\nexport const GET_CHANNEL = `\n query GetChannel($id: ID!) {\n getChannel(id: $id) {\n id name platform adapterType status channelType\n connection { id authType isActive isHealthy }\n }\n }\n`;\n\nexport const CREATE_CHANNEL = `\n mutation CreateChannel($input: CreateChannelInput!) {\n createChannel(input: $input) {\n id name platform adapterType status\n }\n }\n`;\n\nexport const DELETE_CHANNEL = `\n mutation DeleteChannel($id: ID!) {\n deleteChannel(id: $id)\n }\n`;\n\nexport const SEND_CHANNEL_MESSAGE = `\n mutation SendChannelMessage($input: SendMessageInput!) {\n sendMessage(input: $input) {\n success messageId status sentAt\n error { code message retryable }\n }\n }\n`;\n\nexport const GET_CHANNEL_DELIVERY_ATTEMPTS = `\n query GetChannelDeliveryAttempts($channelId: ID!, $cursor: String, $limit: Int) {\n getChannelDeliveryAttempts(channelId: $channelId, cursor: $cursor, limit: $limit) {\n items { id channelId status sentAt retryCount errorMessage }\n total hasMore\n }\n }\n`;\n\nexport const LIST_CHANNEL_USERS = `\n query ListChannelUsers($channelId: ID!, $pagination: ChannelPaginationInput) {\n listUserPlatformConnectionsByChannel(channelId: $channelId, pagination: $pagination) {\n items { id externalUserId externalDisplayName platform dmAllowed presenceStatus }\n total hasMore\n }\n }\n`;\n\nexport const GET_CHANNEL_WEBHOOK_EVENTS = `\n query GetChannelWebhookEvents($channelId: ID!, $cursor: String, $limit: Int) {\n getChannelWebhookEvents(channelId: $channelId, cursor: $cursor, limit: $limit) {\n items { id eventType status createdAt }\n total hasMore\n }\n }\n`;\n\nexport const GET_CONNECTIONS_BY_ORG = `\n query GetConnectionsByOrg($organizationId: ID!, $pagination: ChannelPaginationInput) {\n getConnectionsByOrganization(organizationId: $organizationId, pagination: $pagination) {\n items { id channelId authType tokenExpiresAt isActive isHealthy }\n total hasMore\n }\n }\n`;\n\nexport const CREATE_CHANNEL_CONNECTION = `\n mutation CreateChannelConnection($input: CreateConnectionInput!) {\n createConnection(input: $input) {\n id channelId authType isActive\n }\n }\n`;\n\nexport const DELETE_CHANNEL_CONNECTION = `\n mutation DeleteChannelConnection($id: ID!) {\n deleteConnection(id: $id)\n }\n`;\n","/**\n * Channels MCP tools — multi-platform message channels (email/SMS/Slack/etc.).\n * Surface mirrors cli-sdk/src/modules/channels/commands.ts.\n */\n\nimport { z } from 'zod';\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { jsonResult, errorResult, mcpToolName, type McpContext } from '../../core/index.js';\nimport * as ops from './operations.js';\n\ninterface ChannelRow {\n id: string;\n name: string;\n platform: string;\n adapterType?: string;\n status?: string;\n priority?: number;\n createdAt?: string;\n}\n\nexport function registerChannelsTools(\n server: McpServer,\n ctx: McpContext,\n track: (n: string) => string,\n): void {\n server.registerTool(\n track(mcpToolName(ctx.productName, 'channels_list')),\n {\n title: 'List Channels',\n description: 'List channels with optional platform/status filters and pagination.',\n inputSchema: {\n platform: z.string().optional().describe('Filter by platform (will be uppercased)'),\n status: z.string().optional().describe('Filter by status (will be uppercased)'),\n limit: z.number().optional().describe('Page size (default 50)'),\n },\n },\n async ({ platform, status, limit }) => {\n try {\n const filter: Record<string, unknown> = {};\n if (platform !== undefined) filter.platform = platform.toUpperCase();\n if (status !== undefined) filter.status = status.toUpperCase();\n const data = await ctx.gql.global.request<{\n getChannels: { items: ChannelRow[]; total: number; hasMore: boolean };\n }>(ops.GET_CHANNELS, {\n filter: Object.keys(filter).length ? filter : undefined,\n pagination: { limit: limit ?? 50, offset: 0 },\n });\n return jsonResult(data.getChannels);\n } catch (error) {\n ctx.logger.error('channels_list failed', { error: String(error) });\n return errorResult(\n `Failed to list channels: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'channels_get')),\n {\n title: 'Get Channel',\n description: 'Get a channel by its ID.',\n inputSchema: { id: z.string().describe('Channel ID') },\n },\n async ({ id }) => {\n try {\n const data = await ctx.gql.global.request<{ getChannel: ChannelRow | null }>(\n ops.GET_CHANNEL,\n { id },\n );\n if (!data.getChannel) return errorResult(`Channel ${id} not found`);\n return jsonResult(data.getChannel);\n } catch (error) {\n ctx.logger.error('channels_get failed', { error: String(error) });\n return errorResult(\n `Failed to get channel: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'channels_create')),\n {\n title: 'Create Channel',\n description: 'Create a new channel.',\n inputSchema: {\n name: z.string().describe('Channel name'),\n platform: z\n .string()\n .describe('EMAIL|SMS|SLACK|TEAMS|DISCORD|WHATSAPP|WEBHOOK (will be uppercased)'),\n adapter: z.string().optional().describe('Adapter type (will be uppercased)'),\n },\n },\n async ({ name, platform, adapter }) => {\n try {\n const input: Record<string, unknown> = {\n name,\n platform: platform.toUpperCase(),\n };\n if (adapter !== undefined) input.adapterType = adapter.toUpperCase();\n const data = await ctx.gql.global.request<{ createChannel: ChannelRow }>(\n ops.CREATE_CHANNEL,\n { input },\n );\n return jsonResult(data.createChannel);\n } catch (error) {\n ctx.logger.error('channels_create failed', { error: String(error) });\n return errorResult(\n `Failed to create channel: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'channels_delete')),\n {\n title: 'Delete Channel',\n description: 'Delete a channel by ID.',\n inputSchema: { id: z.string().describe('Channel ID') },\n },\n async ({ id }) => {\n try {\n const data = await ctx.gql.global.request<{ deleteChannel: boolean }>(ops.DELETE_CHANNEL, {\n id,\n });\n return jsonResult({ deleted: data.deleteChannel, channelId: id });\n } catch (error) {\n ctx.logger.error('channels_delete failed', { error: String(error) });\n return errorResult(\n `Failed to delete channel: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'channels_send')),\n {\n title: 'Send Channel Message',\n description: 'Send a message via a channel.',\n inputSchema: {\n channelId: z.string().describe('Channel ID'),\n content: z.string().describe('Message content'),\n recipient: z.string().optional().describe('External recipient id (e.g. email)'),\n subject: z.string().optional().describe('Message subject'),\n },\n },\n async ({ channelId, content, recipient, subject }) => {\n try {\n const input: Record<string, unknown> = { channelId, content };\n if (recipient !== undefined) input.recipientId = recipient;\n if (subject !== undefined) input.subject = subject;\n const data = await ctx.gql.global.request<{\n sendMessage: {\n success: boolean;\n messageId?: string;\n status?: string;\n sentAt?: string;\n error?: { code: string; message: string; retryable: boolean };\n };\n }>(ops.SEND_CHANNEL_MESSAGE, { input });\n return jsonResult(data.sendMessage);\n } catch (error) {\n ctx.logger.error('channels_send failed', { error: String(error) });\n return errorResult(\n `Failed to send channel message: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'channels_deliveries')),\n {\n title: 'List Channel Deliveries',\n description: 'Recent delivery attempts for a channel.',\n inputSchema: {\n channelId: z.string().describe('Channel ID'),\n cursor: z.string().optional().describe('Pagination cursor'),\n limit: z.number().optional().describe('Page size (default 100)'),\n },\n },\n async ({ channelId, cursor, limit }) => {\n try {\n const data = await ctx.gql.global.request<{\n getChannelDeliveryAttempts: {\n items: Array<Record<string, unknown>>;\n total: number;\n hasMore: boolean;\n };\n }>(ops.GET_CHANNEL_DELIVERY_ATTEMPTS, {\n channelId,\n cursor,\n limit: limit ?? 100,\n });\n return jsonResult(data.getChannelDeliveryAttempts);\n } catch (error) {\n ctx.logger.error('channels_deliveries failed', { error: String(error) });\n return errorResult(\n `Failed to list channel deliveries: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'channels_users')),\n {\n title: 'List Channel Users',\n description: 'Users connected to this channel.',\n inputSchema: {\n channelId: z.string().describe('Channel ID'),\n limit: z.number().optional().describe('Page size (default 100)'),\n },\n },\n async ({ channelId, limit }) => {\n try {\n const data = await ctx.gql.global.request<{\n listUserPlatformConnectionsByChannel: {\n items: Array<Record<string, unknown>>;\n total: number;\n hasMore: boolean;\n };\n }>(ops.LIST_CHANNEL_USERS, {\n channelId,\n pagination: { limit: limit ?? 100, offset: 0 },\n });\n return jsonResult(data.listUserPlatformConnectionsByChannel);\n } catch (error) {\n ctx.logger.error('channels_users failed', { error: String(error) });\n return errorResult(\n `Failed to list channel users: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'channels_webhooks_list')),\n {\n title: 'List Channel Webhook Events',\n description: 'List webhook events for a channel.',\n inputSchema: {\n channelId: z.string().describe('Channel ID'),\n cursor: z.string().optional().describe('Pagination cursor'),\n limit: z.number().optional().describe('Page size (default 100)'),\n },\n },\n async ({ channelId, cursor, limit }) => {\n try {\n const data = await ctx.gql.global.request<{\n getChannelWebhookEvents: {\n items: Array<{ id: string; eventType: string; status: string; createdAt: string }>;\n total: number;\n hasMore: boolean;\n };\n }>(ops.GET_CHANNEL_WEBHOOK_EVENTS, {\n channelId,\n cursor,\n limit: limit ?? 100,\n });\n return jsonResult(data.getChannelWebhookEvents);\n } catch (error) {\n ctx.logger.error('channels_webhooks_list failed', { error: String(error) });\n return errorResult(\n `Failed to list channel webhook events: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'channels_connections_list')),\n {\n title: 'List Channel Connections',\n description: 'List channel connections for an organization.',\n inputSchema: {\n organizationId: z.string().describe('Organization ID'),\n limit: z.number().optional().describe('Page size (default 100)'),\n },\n },\n async ({ organizationId, limit }) => {\n try {\n const data = await ctx.gql.global.request<{\n getConnectionsByOrganization: {\n items: Array<Record<string, unknown>>;\n total: number;\n hasMore: boolean;\n };\n }>(ops.GET_CONNECTIONS_BY_ORG, {\n organizationId,\n pagination: { limit: limit ?? 100, offset: 0 },\n });\n return jsonResult(data.getConnectionsByOrganization);\n } catch (error) {\n ctx.logger.error('channels_connections_list failed', { error: String(error) });\n return errorResult(\n `Failed to list channel connections: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'channels_connections_create')),\n {\n title: 'Create Channel Connection',\n description: 'Create a channel connection (OAuth/API key/webhook).',\n inputSchema: {\n channelId: z.string().describe('Channel ID'),\n authType: z.string().describe('OAUTH|API_KEY|WEBHOOK (will be uppercased)'),\n },\n },\n async ({ channelId, authType }) => {\n try {\n const input: Record<string, unknown> = {\n channelId,\n authType: authType.toUpperCase(),\n };\n const data = await ctx.gql.global.request<{\n createConnection: Record<string, unknown>;\n }>(ops.CREATE_CHANNEL_CONNECTION, { input });\n return jsonResult(data.createConnection);\n } catch (error) {\n ctx.logger.error('channels_connections_create failed', { error: String(error) });\n return errorResult(\n `Failed to create channel connection: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n\n server.registerTool(\n track(mcpToolName(ctx.productName, 'channels_connections_delete')),\n {\n title: 'Delete Channel Connection',\n description: 'Delete a channel connection by ID.',\n inputSchema: { id: z.string().describe('Connection ID') },\n },\n async ({ id }) => {\n try {\n const data = await ctx.gql.global.request<{ deleteConnection: boolean }>(\n ops.DELETE_CHANNEL_CONNECTION,\n { id },\n );\n return jsonResult({ deleted: data.deleteConnection, connectionId: id });\n } catch (error) {\n ctx.logger.error('channels_connections_delete failed', { error: String(error) });\n return errorResult(\n `Failed to delete channel connection: ${error instanceof Error ? error.message : String(error)}`,\n );\n }\n },\n );\n}\n","/**\n * Channels module — multi-platform message channels CRUD + send + deliveries +\n * users + webhooks + connections. Mostly global gateway.\n * Surface mirrors cli-sdk/src/modules/channels/.\n */\n\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport type { McpContext, McpModule, ModuleRegistration } from '../../core/index.js';\nimport { registerChannelsTools } from './tools.js';\n\nconst channelsModule: McpModule = {\n id: 'channels',\n version: '0.0.1',\n displayName: 'Channels',\n dependsOn: ['auth'],\n capabilities: { tools: {} },\n\n register(server: McpServer, ctx: McpContext): ModuleRegistration {\n const tools: string[] = [];\n const track = (n: string): string => {\n tools.push(n);\n return n;\n };\n\n registerChannelsTools(server, ctx, track);\n\n return { tools, resources: [], prompts: [] };\n },\n};\n\nexport default channelsModule;\n"]}