@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.
- package/README.md +76 -0
- package/dist/chunk-4GBVJ4OY.js +847 -0
- package/dist/chunk-4GBVJ4OY.js.map +1 -0
- package/dist/chunk-H2OYWLOA.js +919 -0
- package/dist/chunk-H2OYWLOA.js.map +1 -0
- package/dist/chunk-JFEQYSWM.js +174 -0
- package/dist/chunk-JFEQYSWM.js.map +1 -0
- package/dist/chunk-WWFVD7BO.js +273 -0
- package/dist/chunk-WWFVD7BO.js.map +1 -0
- package/dist/context-1jV4NsLv.d.cts +138 -0
- package/dist/context-1jV4NsLv.d.ts +138 -0
- package/dist/core/index.cjs +953 -0
- package/dist/core/index.cjs.map +1 -0
- package/dist/core/index.d.cts +59 -0
- package/dist/core/index.d.ts +59 -0
- package/dist/core/index.js +3 -0
- package/dist/core/index.js.map +1 -0
- package/dist/http-BP4c721D.d.cts +22 -0
- package/dist/http-DXTeCD5r.d.ts +22 -0
- package/dist/index.cjs +1013 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +7 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/module-DBcfA-i3.d.ts +67 -0
- package/dist/module-DFQBZNK6.d.cts +67 -0
- package/dist/modules/auth/index.cjs +533 -0
- package/dist/modules/auth/index.cjs.map +1 -0
- package/dist/modules/auth/index.d.cts +51 -0
- package/dist/modules/auth/index.d.ts +51 -0
- package/dist/modules/auth/index.js +159 -0
- package/dist/modules/auth/index.js.map +1 -0
- package/dist/modules/billing/index.cjs +655 -0
- package/dist/modules/billing/index.cjs.map +1 -0
- package/dist/modules/billing/index.d.cts +8 -0
- package/dist/modules/billing/index.d.ts +8 -0
- package/dist/modules/billing/index.js +606 -0
- package/dist/modules/billing/index.js.map +1 -0
- package/dist/modules/channels/index.cjs +443 -0
- package/dist/modules/channels/index.cjs.map +1 -0
- package/dist/modules/channels/index.d.cts +8 -0
- package/dist/modules/channels/index.d.ts +8 -0
- package/dist/modules/channels/index.js +394 -0
- package/dist/modules/channels/index.js.map +1 -0
- package/dist/modules/conversations/index.cjs +288 -0
- package/dist/modules/conversations/index.cjs.map +1 -0
- package/dist/modules/conversations/index.d.cts +8 -0
- package/dist/modules/conversations/index.d.ts +8 -0
- package/dist/modules/conversations/index.js +239 -0
- package/dist/modules/conversations/index.js.map +1 -0
- package/dist/modules/devportal/index.cjs +796 -0
- package/dist/modules/devportal/index.cjs.map +1 -0
- package/dist/modules/devportal/index.d.cts +8 -0
- package/dist/modules/devportal/index.d.ts +8 -0
- package/dist/modules/devportal/index.js +747 -0
- package/dist/modules/devportal/index.js.map +1 -0
- package/dist/modules/export/index.cjs +333 -0
- package/dist/modules/export/index.cjs.map +1 -0
- package/dist/modules/export/index.d.cts +8 -0
- package/dist/modules/export/index.d.ts +8 -0
- package/dist/modules/export/index.js +284 -0
- package/dist/modules/export/index.js.map +1 -0
- package/dist/modules/files/index.cjs +278 -0
- package/dist/modules/files/index.cjs.map +1 -0
- package/dist/modules/files/index.d.cts +8 -0
- package/dist/modules/files/index.d.ts +8 -0
- package/dist/modules/files/index.js +229 -0
- package/dist/modules/files/index.js.map +1 -0
- package/dist/modules/groups/index.cjs +451 -0
- package/dist/modules/groups/index.cjs.map +1 -0
- package/dist/modules/groups/index.d.cts +8 -0
- package/dist/modules/groups/index.d.ts +8 -0
- package/dist/modules/groups/index.js +402 -0
- package/dist/modules/groups/index.js.map +1 -0
- package/dist/modules/health/index.cjs +159 -0
- package/dist/modules/health/index.cjs.map +1 -0
- package/dist/modules/health/index.d.cts +8 -0
- package/dist/modules/health/index.d.ts +8 -0
- package/dist/modules/health/index.js +36 -0
- package/dist/modules/health/index.js.map +1 -0
- package/dist/modules/integrations/index.cjs +316 -0
- package/dist/modules/integrations/index.cjs.map +1 -0
- package/dist/modules/integrations/index.d.cts +8 -0
- package/dist/modules/integrations/index.d.ts +8 -0
- package/dist/modules/integrations/index.js +267 -0
- package/dist/modules/integrations/index.js.map +1 -0
- package/dist/modules/notifications/index.cjs +222 -0
- package/dist/modules/notifications/index.cjs.map +1 -0
- package/dist/modules/notifications/index.d.cts +8 -0
- package/dist/modules/notifications/index.d.ts +8 -0
- package/dist/modules/notifications/index.js +173 -0
- package/dist/modules/notifications/index.js.map +1 -0
- package/dist/modules/organizations/index.cjs +267 -0
- package/dist/modules/organizations/index.cjs.map +1 -0
- package/dist/modules/organizations/index.d.cts +8 -0
- package/dist/modules/organizations/index.d.ts +8 -0
- package/dist/modules/organizations/index.js +218 -0
- package/dist/modules/organizations/index.js.map +1 -0
- package/dist/modules/products/index.cjs +736 -0
- package/dist/modules/products/index.cjs.map +1 -0
- package/dist/modules/products/index.d.cts +8 -0
- package/dist/modules/products/index.d.ts +8 -0
- package/dist/modules/products/index.js +687 -0
- package/dist/modules/products/index.js.map +1 -0
- package/dist/modules/rbac/index.cjs +378 -0
- package/dist/modules/rbac/index.cjs.map +1 -0
- package/dist/modules/rbac/index.d.cts +8 -0
- package/dist/modules/rbac/index.d.ts +8 -0
- package/dist/modules/rbac/index.js +329 -0
- package/dist/modules/rbac/index.js.map +1 -0
- package/dist/modules/sandbox/index.cjs +318 -0
- package/dist/modules/sandbox/index.cjs.map +1 -0
- package/dist/modules/sandbox/index.d.cts +8 -0
- package/dist/modules/sandbox/index.d.ts +8 -0
- package/dist/modules/sandbox/index.js +225 -0
- package/dist/modules/sandbox/index.js.map +1 -0
- package/dist/modules/scheduler/index.cjs +267 -0
- package/dist/modules/scheduler/index.cjs.map +1 -0
- package/dist/modules/scheduler/index.d.cts +8 -0
- package/dist/modules/scheduler/index.d.ts +8 -0
- package/dist/modules/scheduler/index.js +218 -0
- package/dist/modules/scheduler/index.js.map +1 -0
- package/dist/modules/security/index.cjs +529 -0
- package/dist/modules/security/index.cjs.map +1 -0
- package/dist/modules/security/index.d.cts +8 -0
- package/dist/modules/security/index.d.ts +8 -0
- package/dist/modules/security/index.js +480 -0
- package/dist/modules/security/index.js.map +1 -0
- package/dist/modules/store/index.cjs +450 -0
- package/dist/modules/store/index.cjs.map +1 -0
- package/dist/modules/store/index.d.cts +8 -0
- package/dist/modules/store/index.d.ts +8 -0
- package/dist/modules/store/index.js +401 -0
- package/dist/modules/store/index.js.map +1 -0
- package/dist/modules/support/index.cjs +285 -0
- package/dist/modules/support/index.cjs.map +1 -0
- package/dist/modules/support/index.d.cts +8 -0
- package/dist/modules/support/index.d.ts +8 -0
- package/dist/modules/support/index.js +236 -0
- package/dist/modules/support/index.js.map +1 -0
- package/dist/modules/tags/index.cjs +421 -0
- package/dist/modules/tags/index.cjs.map +1 -0
- package/dist/modules/tags/index.d.cts +8 -0
- package/dist/modules/tags/index.d.ts +8 -0
- package/dist/modules/tags/index.js +372 -0
- package/dist/modules/tags/index.js.map +1 -0
- package/dist/modules/tours/index.cjs +225 -0
- package/dist/modules/tours/index.cjs.map +1 -0
- package/dist/modules/tours/index.d.cts +8 -0
- package/dist/modules/tours/index.d.ts +8 -0
- package/dist/modules/tours/index.js +176 -0
- package/dist/modules/tours/index.js.map +1 -0
- package/dist/modules/vibecontrols/index.cjs +5551 -0
- package/dist/modules/vibecontrols/index.cjs.map +1 -0
- package/dist/modules/vibecontrols/index.d.cts +8 -0
- package/dist/modules/vibecontrols/index.d.ts +8 -0
- package/dist/modules/vibecontrols/index.js +4380 -0
- package/dist/modules/vibecontrols/index.js.map +1 -0
- package/dist/modules/workspaces/index.cjs +552 -0
- package/dist/modules/workspaces/index.cjs.map +1 -0
- package/dist/modules/workspaces/index.d.cts +8 -0
- package/dist/modules/workspaces/index.d.ts +8 -0
- package/dist/modules/workspaces/index.js +503 -0
- package/dist/modules/workspaces/index.js.map +1 -0
- package/dist/tool-name-CQf_IqAj.d.cts +47 -0
- package/dist/tool-name-DlnrBsZ6.d.ts +47 -0
- package/dist/transports/index.cjs +183 -0
- package/dist/transports/index.cjs.map +1 -0
- package/dist/transports/index.d.cts +13 -0
- package/dist/transports/index.d.ts +13 -0
- package/dist/transports/index.js +3 -0
- package/dist/transports/index.js.map +1 -0
- package/package.json +125 -0
|
@@ -0,0 +1,687 @@
|
|
|
1
|
+
import { mcpToolName, jsonResult, errorResult } from '../../chunk-H2OYWLOA.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
// src/modules/products/operations.ts
|
|
5
|
+
var LIST_PRODUCTS = `
|
|
6
|
+
query ListProducts($filter: PlatformProductFilterInput, $limit: Int, $offset: Int) {
|
|
7
|
+
platformProducts(filter: $filter, limit: $limit, offset: $offset) {
|
|
8
|
+
items { id name slug status logoUrl appUrl }
|
|
9
|
+
total
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
`;
|
|
13
|
+
var GET_PRODUCT = `
|
|
14
|
+
query GetProduct($id: ID!) {
|
|
15
|
+
platformProduct(id: $id) {
|
|
16
|
+
id name slug description status metadata logoUrl appUrl
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
`;
|
|
20
|
+
var CREATE_PRODUCT = `
|
|
21
|
+
mutation CreatePlatformProduct($input: CreatePlatformProductInput!) {
|
|
22
|
+
createPlatformProduct(input: $input) {
|
|
23
|
+
id name slug status
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
`;
|
|
27
|
+
var UPDATE_PRODUCT = `
|
|
28
|
+
mutation UpdatePlatformProduct($id: ID!, $input: UpdatePlatformProductInput!) {
|
|
29
|
+
updatePlatformProduct(id: $id, input: $input) {
|
|
30
|
+
id name status
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
`;
|
|
34
|
+
var DELETE_PRODUCT = `
|
|
35
|
+
mutation DeletePlatformProduct($id: ID!) {
|
|
36
|
+
deletePlatformProduct(id: $id)
|
|
37
|
+
}
|
|
38
|
+
`;
|
|
39
|
+
var LIST_SHORTCUTS = `
|
|
40
|
+
query ListShortcuts($filter: KeyboardShortcutFilterInput, $limit: Int) {
|
|
41
|
+
keyboardShortcuts(filter: $filter, limit: $limit) {
|
|
42
|
+
items { id label shortcutKey category eventName isEnabled productId }
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
`;
|
|
46
|
+
var CREATE_SHORTCUT = `
|
|
47
|
+
mutation CreateKeyboardShortcut($input: CreateKeyboardShortcutInput!) {
|
|
48
|
+
createKeyboardShortcut(input: $input) {
|
|
49
|
+
id label shortcutKey isEnabled
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
`;
|
|
53
|
+
var UPDATE_SHORTCUT = `
|
|
54
|
+
mutation UpdateKeyboardShortcut($id: ID!, $input: UpdateKeyboardShortcutInput!) {
|
|
55
|
+
updateKeyboardShortcut(id: $id, input: $input) {
|
|
56
|
+
id label shortcutKey isEnabled
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
`;
|
|
60
|
+
var DELETE_SHORTCUT = `
|
|
61
|
+
mutation DeleteKeyboardShortcut($id: ID!) {
|
|
62
|
+
deleteKeyboardShortcut(id: $id)
|
|
63
|
+
}
|
|
64
|
+
`;
|
|
65
|
+
var LIST_CONTENT_PAGES = `
|
|
66
|
+
query ListContentPages($productId: ID!, $filter: ContentPageFilterInput, $limit: Int) {
|
|
67
|
+
contentPages(productId: $productId, filter: $filter, limit: $limit) {
|
|
68
|
+
items { id slug title visibility isPublished }
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
`;
|
|
72
|
+
var CREATE_CONTENT_PAGE = `
|
|
73
|
+
mutation CreateContentPage($input: CreateContentPageInput!) {
|
|
74
|
+
createContentPage(input: $input) {
|
|
75
|
+
id slug title visibility
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
`;
|
|
79
|
+
var UPDATE_CONTENT_PAGE = `
|
|
80
|
+
mutation UpdateContentPage($id: ID!, $input: UpdateContentPageInput!) {
|
|
81
|
+
updateContentPage(id: $id, input: $input) {
|
|
82
|
+
id slug title isPublished
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
`;
|
|
86
|
+
var DELETE_CONTENT_PAGE = `
|
|
87
|
+
mutation DeleteContentPage($id: ID!) {
|
|
88
|
+
deleteContentPage(id: $id)
|
|
89
|
+
}
|
|
90
|
+
`;
|
|
91
|
+
var LIST_FEATURE_FLAGS = `
|
|
92
|
+
query ListFeatureFlags($filter: FeatureFlagFilterInput, $limit: Int) {
|
|
93
|
+
featureFlags(filter: $filter, limit: $limit) {
|
|
94
|
+
items { id key name flagType status defaultValue category productId }
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
`;
|
|
98
|
+
var CREATE_FEATURE_FLAG = `
|
|
99
|
+
mutation CreateFeatureFlag($input: CreateFeatureFlagInput!) {
|
|
100
|
+
createFeatureFlag(input: $input) {
|
|
101
|
+
id key name flagType status
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
`;
|
|
105
|
+
var UPDATE_FEATURE_FLAG = `
|
|
106
|
+
mutation UpdateFeatureFlag($id: ID!, $input: UpdateFeatureFlagInput!) {
|
|
107
|
+
updateFeatureFlag(id: $id, input: $input) {
|
|
108
|
+
id key status defaultValue
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
`;
|
|
112
|
+
var DELETE_FEATURE_FLAG = `
|
|
113
|
+
mutation DeleteFeatureFlag($id: ID!) {
|
|
114
|
+
deleteFeatureFlag(id: $id)
|
|
115
|
+
}
|
|
116
|
+
`;
|
|
117
|
+
var EVALUATE_FEATURE_FLAGS = `
|
|
118
|
+
query EvaluateFeatureFlags($input: EvaluateFeatureFlagsInput!) {
|
|
119
|
+
evaluateFeatureFlags(input: $input) {
|
|
120
|
+
evaluations { key flagType value variant reason }
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
`;
|
|
124
|
+
|
|
125
|
+
// src/modules/products/tools.ts
|
|
126
|
+
function registerProductsTools(server, ctx, track) {
|
|
127
|
+
server.registerTool(
|
|
128
|
+
track(mcpToolName(ctx.productName, "products_list")),
|
|
129
|
+
{
|
|
130
|
+
title: "List Platform Products",
|
|
131
|
+
description: "List platform products with optional search/status filters.",
|
|
132
|
+
inputSchema: {
|
|
133
|
+
search: z.string().optional().describe("Free-text search"),
|
|
134
|
+
status: z.string().optional().describe("Filter by status (DRAFT|ACTIVE|ARCHIVED)"),
|
|
135
|
+
limit: z.number().optional().describe("Page size (default 50)"),
|
|
136
|
+
offset: z.number().optional().describe("Skip results")
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
async ({ search, status, limit, offset }) => {
|
|
140
|
+
try {
|
|
141
|
+
const filter = {};
|
|
142
|
+
if (search !== void 0) filter.search = search;
|
|
143
|
+
if (status !== void 0) filter.status = status.toUpperCase();
|
|
144
|
+
const data = await ctx.gql.global.request(LIST_PRODUCTS, {
|
|
145
|
+
filter: Object.keys(filter).length ? filter : void 0,
|
|
146
|
+
limit: limit ?? 50,
|
|
147
|
+
offset: offset ?? 0
|
|
148
|
+
});
|
|
149
|
+
return jsonResult(data.platformProducts);
|
|
150
|
+
} catch (error) {
|
|
151
|
+
ctx.logger.error("products_list failed", { error: String(error) });
|
|
152
|
+
return errorResult(
|
|
153
|
+
`Failed to list products: ${error instanceof Error ? error.message : String(error)}`
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
);
|
|
158
|
+
server.registerTool(
|
|
159
|
+
track(mcpToolName(ctx.productName, "products_get")),
|
|
160
|
+
{
|
|
161
|
+
title: "Get Platform Product",
|
|
162
|
+
description: "Get a platform product by ID.",
|
|
163
|
+
inputSchema: { id: z.string().describe("Product ID") }
|
|
164
|
+
},
|
|
165
|
+
async ({ id }) => {
|
|
166
|
+
try {
|
|
167
|
+
const data = await ctx.gql.global.request(
|
|
168
|
+
GET_PRODUCT,
|
|
169
|
+
{ id }
|
|
170
|
+
);
|
|
171
|
+
if (!data.platformProduct) return errorResult(`Product ${id} not found`);
|
|
172
|
+
return jsonResult(data.platformProduct);
|
|
173
|
+
} catch (error) {
|
|
174
|
+
ctx.logger.error("products_get failed", { error: String(error) });
|
|
175
|
+
return errorResult(
|
|
176
|
+
`Failed to get product: ${error instanceof Error ? error.message : String(error)}`
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
);
|
|
181
|
+
server.registerTool(
|
|
182
|
+
track(mcpToolName(ctx.productName, "products_create")),
|
|
183
|
+
{
|
|
184
|
+
title: "Create Platform Product",
|
|
185
|
+
description: "Create a new platform product.",
|
|
186
|
+
inputSchema: {
|
|
187
|
+
name: z.string().describe("Product name"),
|
|
188
|
+
slug: z.string().describe("URL slug"),
|
|
189
|
+
description: z.string().optional(),
|
|
190
|
+
status: z.string().optional().describe("DRAFT|ACTIVE|ARCHIVED (default DRAFT)"),
|
|
191
|
+
appUrl: z.string().optional(),
|
|
192
|
+
logoUrl: z.string().optional()
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
async ({ name, slug, description, status, appUrl, logoUrl }) => {
|
|
196
|
+
try {
|
|
197
|
+
const input = {
|
|
198
|
+
name,
|
|
199
|
+
slug,
|
|
200
|
+
status: (status ?? "DRAFT").toUpperCase()
|
|
201
|
+
};
|
|
202
|
+
if (description !== void 0) input.description = description;
|
|
203
|
+
if (appUrl !== void 0) input.appUrl = appUrl;
|
|
204
|
+
if (logoUrl !== void 0) input.logoUrl = logoUrl;
|
|
205
|
+
const data = await ctx.gql.global.request(
|
|
206
|
+
CREATE_PRODUCT,
|
|
207
|
+
{ input }
|
|
208
|
+
);
|
|
209
|
+
return jsonResult(data.createPlatformProduct);
|
|
210
|
+
} catch (error) {
|
|
211
|
+
ctx.logger.error("products_create failed", { error: String(error) });
|
|
212
|
+
return errorResult(
|
|
213
|
+
`Failed to create product: ${error instanceof Error ? error.message : String(error)}`
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
);
|
|
218
|
+
server.registerTool(
|
|
219
|
+
track(mcpToolName(ctx.productName, "products_update")),
|
|
220
|
+
{
|
|
221
|
+
title: "Update Platform Product",
|
|
222
|
+
description: "Update a platform product.",
|
|
223
|
+
inputSchema: {
|
|
224
|
+
id: z.string().describe("Product ID"),
|
|
225
|
+
name: z.string().optional(),
|
|
226
|
+
description: z.string().optional(),
|
|
227
|
+
status: z.string().optional()
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
async ({ id, name, description, status }) => {
|
|
231
|
+
try {
|
|
232
|
+
const input = {};
|
|
233
|
+
if (name !== void 0) input.name = name;
|
|
234
|
+
if (description !== void 0) input.description = description;
|
|
235
|
+
if (status !== void 0) input.status = status.toUpperCase();
|
|
236
|
+
if (!Object.keys(input).length) return errorResult("No updates specified");
|
|
237
|
+
const data = await ctx.gql.global.request(
|
|
238
|
+
UPDATE_PRODUCT,
|
|
239
|
+
{ id, input }
|
|
240
|
+
);
|
|
241
|
+
return jsonResult(data.updatePlatformProduct);
|
|
242
|
+
} catch (error) {
|
|
243
|
+
ctx.logger.error("products_update failed", { error: String(error) });
|
|
244
|
+
return errorResult(
|
|
245
|
+
`Failed to update product: ${error instanceof Error ? error.message : String(error)}`
|
|
246
|
+
);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
);
|
|
250
|
+
server.registerTool(
|
|
251
|
+
track(mcpToolName(ctx.productName, "products_delete")),
|
|
252
|
+
{
|
|
253
|
+
title: "Delete Platform Product",
|
|
254
|
+
description: "Delete a platform product.",
|
|
255
|
+
inputSchema: { id: z.string().describe("Product ID") }
|
|
256
|
+
},
|
|
257
|
+
async ({ id }) => {
|
|
258
|
+
try {
|
|
259
|
+
await ctx.gql.global.request(DELETE_PRODUCT, { id });
|
|
260
|
+
return jsonResult({ status: "success", message: "Product deleted", productId: id });
|
|
261
|
+
} catch (error) {
|
|
262
|
+
ctx.logger.error("products_delete failed", { error: String(error) });
|
|
263
|
+
return errorResult(
|
|
264
|
+
`Failed to delete product: ${error instanceof Error ? error.message : String(error)}`
|
|
265
|
+
);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
);
|
|
269
|
+
server.registerTool(
|
|
270
|
+
track(mcpToolName(ctx.productName, "products_shortcuts_list")),
|
|
271
|
+
{
|
|
272
|
+
title: "List Keyboard Shortcuts",
|
|
273
|
+
description: "List keyboard shortcuts.",
|
|
274
|
+
inputSchema: {
|
|
275
|
+
productId: z.string().optional().describe("Filter by product ID"),
|
|
276
|
+
category: z.string().optional().describe("Filter by category"),
|
|
277
|
+
limit: z.number().optional().describe("Page size (default 100)")
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
async ({ productId, category, limit }) => {
|
|
281
|
+
try {
|
|
282
|
+
const filter = {};
|
|
283
|
+
if (productId !== void 0) filter.productId = productId;
|
|
284
|
+
if (category !== void 0) filter.category = category;
|
|
285
|
+
const data = await ctx.gql.global.request(LIST_SHORTCUTS, {
|
|
286
|
+
filter: Object.keys(filter).length ? filter : void 0,
|
|
287
|
+
limit: limit ?? 100
|
|
288
|
+
});
|
|
289
|
+
return jsonResult(data.keyboardShortcuts);
|
|
290
|
+
} catch (error) {
|
|
291
|
+
ctx.logger.error("products_shortcuts_list failed", { error: String(error) });
|
|
292
|
+
return errorResult(
|
|
293
|
+
`Failed to list shortcuts: ${error instanceof Error ? error.message : String(error)}`
|
|
294
|
+
);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
);
|
|
298
|
+
server.registerTool(
|
|
299
|
+
track(mcpToolName(ctx.productName, "products_shortcuts_create")),
|
|
300
|
+
{
|
|
301
|
+
title: "Create Keyboard Shortcut",
|
|
302
|
+
description: "Create a keyboard shortcut.",
|
|
303
|
+
inputSchema: {
|
|
304
|
+
label: z.string().describe("Display label"),
|
|
305
|
+
shortcutKey: z.string().describe('Shortcut key sequence (e.g. "g h")'),
|
|
306
|
+
eventName: z.string().describe("Event emitted when shortcut fires"),
|
|
307
|
+
productId: z.string().describe("Owning product ID"),
|
|
308
|
+
category: z.string().optional(),
|
|
309
|
+
isEnabled: z.boolean().optional().describe("Default true")
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
async ({ label, shortcutKey, eventName, productId, category, isEnabled }) => {
|
|
313
|
+
try {
|
|
314
|
+
const input = {
|
|
315
|
+
label,
|
|
316
|
+
shortcutKey,
|
|
317
|
+
eventName,
|
|
318
|
+
productId,
|
|
319
|
+
isEnabled: isEnabled !== false
|
|
320
|
+
};
|
|
321
|
+
if (category !== void 0) input.category = category;
|
|
322
|
+
const data = await ctx.gql.global.request(
|
|
323
|
+
CREATE_SHORTCUT,
|
|
324
|
+
{ input }
|
|
325
|
+
);
|
|
326
|
+
return jsonResult(data.createKeyboardShortcut);
|
|
327
|
+
} catch (error) {
|
|
328
|
+
ctx.logger.error("products_shortcuts_create failed", { error: String(error) });
|
|
329
|
+
return errorResult(
|
|
330
|
+
`Failed to create shortcut: ${error instanceof Error ? error.message : String(error)}`
|
|
331
|
+
);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
);
|
|
335
|
+
server.registerTool(
|
|
336
|
+
track(mcpToolName(ctx.productName, "products_shortcuts_update")),
|
|
337
|
+
{
|
|
338
|
+
title: "Update Keyboard Shortcut",
|
|
339
|
+
description: "Update a keyboard shortcut.",
|
|
340
|
+
inputSchema: {
|
|
341
|
+
id: z.string().describe("Shortcut ID"),
|
|
342
|
+
label: z.string().optional(),
|
|
343
|
+
shortcutKey: z.string().optional(),
|
|
344
|
+
isEnabled: z.boolean().optional()
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
async ({ id, label, shortcutKey, isEnabled }) => {
|
|
348
|
+
try {
|
|
349
|
+
const input = {};
|
|
350
|
+
if (label !== void 0) input.label = label;
|
|
351
|
+
if (shortcutKey !== void 0) input.shortcutKey = shortcutKey;
|
|
352
|
+
if (isEnabled !== void 0) input.isEnabled = isEnabled;
|
|
353
|
+
if (!Object.keys(input).length) return errorResult("No updates specified");
|
|
354
|
+
const data = await ctx.gql.global.request(
|
|
355
|
+
UPDATE_SHORTCUT,
|
|
356
|
+
{ id, input }
|
|
357
|
+
);
|
|
358
|
+
return jsonResult(data.updateKeyboardShortcut);
|
|
359
|
+
} catch (error) {
|
|
360
|
+
ctx.logger.error("products_shortcuts_update failed", { error: String(error) });
|
|
361
|
+
return errorResult(
|
|
362
|
+
`Failed to update shortcut: ${error instanceof Error ? error.message : String(error)}`
|
|
363
|
+
);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
);
|
|
367
|
+
server.registerTool(
|
|
368
|
+
track(mcpToolName(ctx.productName, "products_shortcuts_delete")),
|
|
369
|
+
{
|
|
370
|
+
title: "Delete Keyboard Shortcut",
|
|
371
|
+
description: "Delete a keyboard shortcut.",
|
|
372
|
+
inputSchema: { id: z.string().describe("Shortcut ID") }
|
|
373
|
+
},
|
|
374
|
+
async ({ id }) => {
|
|
375
|
+
try {
|
|
376
|
+
await ctx.gql.global.request(DELETE_SHORTCUT, { id });
|
|
377
|
+
return jsonResult({ status: "success", message: "Shortcut deleted", shortcutId: id });
|
|
378
|
+
} catch (error) {
|
|
379
|
+
ctx.logger.error("products_shortcuts_delete failed", { error: String(error) });
|
|
380
|
+
return errorResult(
|
|
381
|
+
`Failed to delete shortcut: ${error instanceof Error ? error.message : String(error)}`
|
|
382
|
+
);
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
);
|
|
386
|
+
server.registerTool(
|
|
387
|
+
track(mcpToolName(ctx.productName, "products_content_pages_list")),
|
|
388
|
+
{
|
|
389
|
+
title: "List Content Pages",
|
|
390
|
+
description: "List content pages for a product.",
|
|
391
|
+
inputSchema: {
|
|
392
|
+
productId: z.string().describe("Product ID"),
|
|
393
|
+
isPublished: z.boolean().optional(),
|
|
394
|
+
visibility: z.string().optional().describe("PUBLIC|PRIVATE"),
|
|
395
|
+
limit: z.number().optional().describe("Page size (default 100)")
|
|
396
|
+
}
|
|
397
|
+
},
|
|
398
|
+
async ({ productId, isPublished, visibility, limit }) => {
|
|
399
|
+
try {
|
|
400
|
+
const filter = {};
|
|
401
|
+
if (isPublished !== void 0) filter.isPublished = isPublished;
|
|
402
|
+
if (visibility !== void 0) filter.visibility = visibility.toUpperCase();
|
|
403
|
+
const data = await ctx.gql.global.request(LIST_CONTENT_PAGES, {
|
|
404
|
+
productId,
|
|
405
|
+
filter: Object.keys(filter).length ? filter : void 0,
|
|
406
|
+
limit: limit ?? 100
|
|
407
|
+
});
|
|
408
|
+
return jsonResult(data.contentPages);
|
|
409
|
+
} catch (error) {
|
|
410
|
+
ctx.logger.error("products_content_pages_list failed", { error: String(error) });
|
|
411
|
+
return errorResult(
|
|
412
|
+
`Failed to list content pages: ${error instanceof Error ? error.message : String(error)}`
|
|
413
|
+
);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
);
|
|
417
|
+
server.registerTool(
|
|
418
|
+
track(mcpToolName(ctx.productName, "products_content_pages_create")),
|
|
419
|
+
{
|
|
420
|
+
title: "Create Content Page",
|
|
421
|
+
description: "Create a content page.",
|
|
422
|
+
inputSchema: {
|
|
423
|
+
productId: z.string().describe("Product ID"),
|
|
424
|
+
slug: z.string().describe("Page slug"),
|
|
425
|
+
title: z.string().describe("Page title"),
|
|
426
|
+
content: z.string().describe("Page content (markdown/html)"),
|
|
427
|
+
visibility: z.string().optional().describe("PUBLIC|PRIVATE (default PUBLIC)"),
|
|
428
|
+
isPublished: z.boolean().optional()
|
|
429
|
+
}
|
|
430
|
+
},
|
|
431
|
+
async ({ productId, slug, title, content, visibility, isPublished }) => {
|
|
432
|
+
try {
|
|
433
|
+
const input = {
|
|
434
|
+
productId,
|
|
435
|
+
slug,
|
|
436
|
+
title,
|
|
437
|
+
content,
|
|
438
|
+
visibility: (visibility ?? "PUBLIC").toUpperCase(),
|
|
439
|
+
isPublished: isPublished === true
|
|
440
|
+
};
|
|
441
|
+
const data = await ctx.gql.global.request(
|
|
442
|
+
CREATE_CONTENT_PAGE,
|
|
443
|
+
{ input }
|
|
444
|
+
);
|
|
445
|
+
return jsonResult(data.createContentPage);
|
|
446
|
+
} catch (error) {
|
|
447
|
+
ctx.logger.error("products_content_pages_create failed", { error: String(error) });
|
|
448
|
+
return errorResult(
|
|
449
|
+
`Failed to create content page: ${error instanceof Error ? error.message : String(error)}`
|
|
450
|
+
);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
);
|
|
454
|
+
server.registerTool(
|
|
455
|
+
track(mcpToolName(ctx.productName, "products_content_pages_update")),
|
|
456
|
+
{
|
|
457
|
+
title: "Update Content Page",
|
|
458
|
+
description: "Update a content page.",
|
|
459
|
+
inputSchema: {
|
|
460
|
+
id: z.string().describe("Content page ID"),
|
|
461
|
+
title: z.string().optional(),
|
|
462
|
+
content: z.string().optional(),
|
|
463
|
+
visibility: z.string().optional(),
|
|
464
|
+
isPublished: z.boolean().optional()
|
|
465
|
+
}
|
|
466
|
+
},
|
|
467
|
+
async ({ id, title, content, visibility, isPublished }) => {
|
|
468
|
+
try {
|
|
469
|
+
const input = {};
|
|
470
|
+
if (title !== void 0) input.title = title;
|
|
471
|
+
if (content !== void 0) input.content = content;
|
|
472
|
+
if (visibility !== void 0) input.visibility = visibility.toUpperCase();
|
|
473
|
+
if (isPublished !== void 0) input.isPublished = isPublished;
|
|
474
|
+
if (!Object.keys(input).length) return errorResult("No updates specified");
|
|
475
|
+
const data = await ctx.gql.global.request(
|
|
476
|
+
UPDATE_CONTENT_PAGE,
|
|
477
|
+
{ id, input }
|
|
478
|
+
);
|
|
479
|
+
return jsonResult(data.updateContentPage);
|
|
480
|
+
} catch (error) {
|
|
481
|
+
ctx.logger.error("products_content_pages_update failed", { error: String(error) });
|
|
482
|
+
return errorResult(
|
|
483
|
+
`Failed to update content page: ${error instanceof Error ? error.message : String(error)}`
|
|
484
|
+
);
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
);
|
|
488
|
+
server.registerTool(
|
|
489
|
+
track(mcpToolName(ctx.productName, "products_content_pages_delete")),
|
|
490
|
+
{
|
|
491
|
+
title: "Delete Content Page",
|
|
492
|
+
description: "Delete a content page.",
|
|
493
|
+
inputSchema: { id: z.string().describe("Content page ID") }
|
|
494
|
+
},
|
|
495
|
+
async ({ id }) => {
|
|
496
|
+
try {
|
|
497
|
+
await ctx.gql.global.request(DELETE_CONTENT_PAGE, { id });
|
|
498
|
+
return jsonResult({ status: "success", message: "Content page deleted", pageId: id });
|
|
499
|
+
} catch (error) {
|
|
500
|
+
ctx.logger.error("products_content_pages_delete failed", { error: String(error) });
|
|
501
|
+
return errorResult(
|
|
502
|
+
`Failed to delete content page: ${error instanceof Error ? error.message : String(error)}`
|
|
503
|
+
);
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
);
|
|
507
|
+
server.registerTool(
|
|
508
|
+
track(mcpToolName(ctx.productName, "products_feature_flags_list")),
|
|
509
|
+
{
|
|
510
|
+
title: "List Feature Flags",
|
|
511
|
+
description: "List feature flags.",
|
|
512
|
+
inputSchema: {
|
|
513
|
+
productId: z.string().optional(),
|
|
514
|
+
status: z.string().optional(),
|
|
515
|
+
category: z.string().optional(),
|
|
516
|
+
limit: z.number().optional().describe("Page size (default 100)")
|
|
517
|
+
}
|
|
518
|
+
},
|
|
519
|
+
async ({ productId, status, category, limit }) => {
|
|
520
|
+
try {
|
|
521
|
+
const filter = {};
|
|
522
|
+
if (productId !== void 0) filter.productId = productId;
|
|
523
|
+
if (status !== void 0) filter.status = status.toUpperCase();
|
|
524
|
+
if (category !== void 0) filter.category = category;
|
|
525
|
+
const data = await ctx.gql.global.request(LIST_FEATURE_FLAGS, {
|
|
526
|
+
filter: Object.keys(filter).length ? filter : void 0,
|
|
527
|
+
limit: limit ?? 100
|
|
528
|
+
});
|
|
529
|
+
return jsonResult(data.featureFlags);
|
|
530
|
+
} catch (error) {
|
|
531
|
+
ctx.logger.error("products_feature_flags_list failed", { error: String(error) });
|
|
532
|
+
return errorResult(
|
|
533
|
+
`Failed to list feature flags: ${error instanceof Error ? error.message : String(error)}`
|
|
534
|
+
);
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
);
|
|
538
|
+
server.registerTool(
|
|
539
|
+
track(mcpToolName(ctx.productName, "products_feature_flags_create")),
|
|
540
|
+
{
|
|
541
|
+
title: "Create Feature Flag",
|
|
542
|
+
description: "Create a feature flag.",
|
|
543
|
+
inputSchema: {
|
|
544
|
+
key: z.string().describe("Stable key (e.g. enable-beta-ui)"),
|
|
545
|
+
name: z.string().describe("Human label"),
|
|
546
|
+
productId: z.string().describe("Owning product ID"),
|
|
547
|
+
flagType: z.string().optional().describe("BOOLEAN|STRING|NUMBER|JSON (default BOOLEAN)"),
|
|
548
|
+
defaultValue: z.unknown().optional().describe("Default value (any JSON value)"),
|
|
549
|
+
description: z.string().optional(),
|
|
550
|
+
category: z.string().optional(),
|
|
551
|
+
previewable: z.boolean().optional(),
|
|
552
|
+
tags: z.array(z.string()).optional()
|
|
553
|
+
}
|
|
554
|
+
},
|
|
555
|
+
async ({
|
|
556
|
+
key,
|
|
557
|
+
name,
|
|
558
|
+
productId,
|
|
559
|
+
flagType,
|
|
560
|
+
defaultValue,
|
|
561
|
+
description,
|
|
562
|
+
category,
|
|
563
|
+
previewable,
|
|
564
|
+
tags
|
|
565
|
+
}) => {
|
|
566
|
+
try {
|
|
567
|
+
const input = {
|
|
568
|
+
key,
|
|
569
|
+
name,
|
|
570
|
+
productId,
|
|
571
|
+
flagType: (flagType ?? "BOOLEAN").toUpperCase(),
|
|
572
|
+
defaultValue: defaultValue ?? false,
|
|
573
|
+
previewable: previewable === true
|
|
574
|
+
};
|
|
575
|
+
if (description !== void 0) input.description = description;
|
|
576
|
+
if (category !== void 0) input.category = category;
|
|
577
|
+
if (tags !== void 0) input.tags = tags;
|
|
578
|
+
const data = await ctx.gql.global.request(
|
|
579
|
+
CREATE_FEATURE_FLAG,
|
|
580
|
+
{ input }
|
|
581
|
+
);
|
|
582
|
+
return jsonResult(data.createFeatureFlag);
|
|
583
|
+
} catch (error) {
|
|
584
|
+
ctx.logger.error("products_feature_flags_create failed", { error: String(error) });
|
|
585
|
+
return errorResult(
|
|
586
|
+
`Failed to create feature flag: ${error instanceof Error ? error.message : String(error)}`
|
|
587
|
+
);
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
);
|
|
591
|
+
server.registerTool(
|
|
592
|
+
track(mcpToolName(ctx.productName, "products_feature_flags_update")),
|
|
593
|
+
{
|
|
594
|
+
title: "Update Feature Flag",
|
|
595
|
+
description: "Update a feature flag.",
|
|
596
|
+
inputSchema: {
|
|
597
|
+
id: z.string().describe("Feature flag ID"),
|
|
598
|
+
name: z.string().optional(),
|
|
599
|
+
defaultValue: z.unknown().optional(),
|
|
600
|
+
status: z.string().optional().describe("ACTIVE|ARCHIVED")
|
|
601
|
+
}
|
|
602
|
+
},
|
|
603
|
+
async ({ id, name, defaultValue, status }) => {
|
|
604
|
+
try {
|
|
605
|
+
const input = {};
|
|
606
|
+
if (name !== void 0) input.name = name;
|
|
607
|
+
if (defaultValue !== void 0) input.defaultValue = defaultValue;
|
|
608
|
+
if (status !== void 0) input.status = status.toUpperCase();
|
|
609
|
+
if (!Object.keys(input).length) return errorResult("No updates specified");
|
|
610
|
+
const data = await ctx.gql.global.request(
|
|
611
|
+
UPDATE_FEATURE_FLAG,
|
|
612
|
+
{ id, input }
|
|
613
|
+
);
|
|
614
|
+
return jsonResult(data.updateFeatureFlag);
|
|
615
|
+
} catch (error) {
|
|
616
|
+
ctx.logger.error("products_feature_flags_update failed", { error: String(error) });
|
|
617
|
+
return errorResult(
|
|
618
|
+
`Failed to update feature flag: ${error instanceof Error ? error.message : String(error)}`
|
|
619
|
+
);
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
);
|
|
623
|
+
server.registerTool(
|
|
624
|
+
track(mcpToolName(ctx.productName, "products_feature_flags_delete")),
|
|
625
|
+
{
|
|
626
|
+
title: "Delete Feature Flag",
|
|
627
|
+
description: "Delete a feature flag.",
|
|
628
|
+
inputSchema: { id: z.string().describe("Feature flag ID") }
|
|
629
|
+
},
|
|
630
|
+
async ({ id }) => {
|
|
631
|
+
try {
|
|
632
|
+
await ctx.gql.global.request(DELETE_FEATURE_FLAG, { id });
|
|
633
|
+
return jsonResult({ status: "success", message: "Feature flag deleted", flagId: id });
|
|
634
|
+
} catch (error) {
|
|
635
|
+
ctx.logger.error("products_feature_flags_delete failed", { error: String(error) });
|
|
636
|
+
return errorResult(
|
|
637
|
+
`Failed to delete feature flag: ${error instanceof Error ? error.message : String(error)}`
|
|
638
|
+
);
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
);
|
|
642
|
+
server.registerTool(
|
|
643
|
+
track(mcpToolName(ctx.productName, "products_feature_flags_evaluate")),
|
|
644
|
+
{
|
|
645
|
+
title: "Evaluate Feature Flags",
|
|
646
|
+
description: "Evaluate feature flags in a workspace context.",
|
|
647
|
+
inputSchema: {
|
|
648
|
+
workspaceId: z.string().describe("Workspace ID"),
|
|
649
|
+
keys: z.array(z.string()).describe("Flag keys to evaluate")
|
|
650
|
+
}
|
|
651
|
+
},
|
|
652
|
+
async ({ workspaceId, keys }) => {
|
|
653
|
+
try {
|
|
654
|
+
const data = await ctx.gql.global.request(EVALUATE_FEATURE_FLAGS, { input: { workspaceId, keys } });
|
|
655
|
+
return jsonResult(data.evaluateFeatureFlags.evaluations);
|
|
656
|
+
} catch (error) {
|
|
657
|
+
ctx.logger.error("products_feature_flags_evaluate failed", { error: String(error) });
|
|
658
|
+
return errorResult(
|
|
659
|
+
`Failed to evaluate feature flags: ${error instanceof Error ? error.message : String(error)}`
|
|
660
|
+
);
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
);
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
// src/modules/products/index.ts
|
|
667
|
+
var productsModule = {
|
|
668
|
+
id: "products",
|
|
669
|
+
version: "0.0.1",
|
|
670
|
+
displayName: "Platform Products",
|
|
671
|
+
dependsOn: ["auth"],
|
|
672
|
+
capabilities: { tools: {} },
|
|
673
|
+
register(server, ctx) {
|
|
674
|
+
const tools = [];
|
|
675
|
+
const track = (n) => {
|
|
676
|
+
tools.push(n);
|
|
677
|
+
return n;
|
|
678
|
+
};
|
|
679
|
+
registerProductsTools(server, ctx, track);
|
|
680
|
+
return { tools, resources: [], prompts: [] };
|
|
681
|
+
}
|
|
682
|
+
};
|
|
683
|
+
var products_default = productsModule;
|
|
684
|
+
|
|
685
|
+
export { products_default as default };
|
|
686
|
+
//# sourceMappingURL=index.js.map
|
|
687
|
+
//# sourceMappingURL=index.js.map
|