@burdenoff/mcp-libs 2026.1008.4 → 2026.1009.2

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 (45) hide show
  1. package/dist/modules/files/index.cjs +101 -432
  2. package/dist/modules/files/index.cjs.map +1 -1
  3. package/dist/modules/files/index.js +102 -428
  4. package/dist/modules/files/index.js.map +1 -1
  5. package/dist/modules/groups/index.cjs +89 -360
  6. package/dist/modules/groups/index.cjs.map +1 -1
  7. package/dist/modules/groups/index.js +90 -356
  8. package/dist/modules/groups/index.js.map +1 -1
  9. package/dist/modules/rbac/index.cjs +85 -409
  10. package/dist/modules/rbac/index.cjs.map +1 -1
  11. package/dist/modules/rbac/index.js +86 -405
  12. package/dist/modules/rbac/index.js.map +1 -1
  13. package/dist/modules/sandbox/index.cjs +80 -1136
  14. package/dist/modules/sandbox/index.cjs.map +1 -1
  15. package/dist/modules/sandbox/index.js +80 -916
  16. package/dist/modules/sandbox/index.js.map +1 -1
  17. package/dist/modules/scheduler/index.cjs +70 -1044
  18. package/dist/modules/scheduler/index.cjs.map +1 -1
  19. package/dist/modules/scheduler/index.js +69 -1038
  20. package/dist/modules/scheduler/index.js.map +1 -1
  21. package/dist/modules/security/index.cjs +42 -507
  22. package/dist/modules/security/index.cjs.map +1 -1
  23. package/dist/modules/security/index.js +41 -501
  24. package/dist/modules/security/index.js.map +1 -1
  25. package/dist/modules/store/index.cjs +49 -479
  26. package/dist/modules/store/index.cjs.map +1 -1
  27. package/dist/modules/store/index.js +48 -473
  28. package/dist/modules/store/index.js.map +1 -1
  29. package/dist/modules/support/index.cjs +18 -19
  30. package/dist/modules/support/index.cjs.map +1 -1
  31. package/dist/modules/support/index.js +18 -19
  32. package/dist/modules/support/index.js.map +1 -1
  33. package/dist/modules/tags/index.cjs +43 -348
  34. package/dist/modules/tags/index.cjs.map +1 -1
  35. package/dist/modules/tags/index.js +42 -342
  36. package/dist/modules/tags/index.js.map +1 -1
  37. package/dist/modules/vibecontrols/index.js +1774 -1
  38. package/dist/modules/vibecontrols/index.js.map +1 -1
  39. package/dist/modules/workspaces/index.cjs +20 -29
  40. package/dist/modules/workspaces/index.cjs.map +1 -1
  41. package/dist/modules/workspaces/index.js +20 -29
  42. package/dist/modules/workspaces/index.js.map +1 -1
  43. package/package.json +1 -1
  44. package/dist/chunk-XITZQYB2.js +0 -1776
  45. package/dist/chunk-XITZQYB2.js.map +0 -1
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var zod = require('zod');
4
3
  require('graphql-request');
5
4
  require('cross-fetch');
6
5
  require('@modelcontextprotocol/sdk/server/mcp.js');
7
6
  require('@modelcontextprotocol/sdk/types.js');
7
+ require('zod');
8
8
 
9
- // src/modules/store/tools.ts
9
+ // src/core/auth/store.ts
10
10
 
11
11
  // src/core/errors.ts
12
12
  var McpInternalError = class extends Error {
@@ -37,12 +37,6 @@ function mcpToolName(productName, ...parts) {
37
37
  }
38
38
 
39
39
  // src/core/result.ts
40
- function jsonResult(data, structured) {
41
- const result = {
42
- content: [{ type: "text", text: JSON.stringify(data, null, 2) }]
43
- };
44
- return result;
45
- }
46
40
  function errorResult(message, hint) {
47
41
  const text = hint ? `${message}
48
42
 
@@ -50,483 +44,59 @@ Hint: ${hint}` : message;
50
44
  return { content: [{ type: "text", text }], isError: true };
51
45
  }
52
46
 
53
- // src/modules/store/operations.ts
54
- var BROWSE_STORE = `
55
- query BrowseStore($input: BrowseStoreInput!) {
56
- browseStore(input: $input) {
57
- products { id name description price currency type status }
58
- facets { categories types }
59
- totalCount hasMore
60
- }
61
- }
62
- `;
63
- var SEARCH_STORE = `
64
- query SearchStore($query: String!, $filters: StoreFiltersInput) {
65
- searchStore(query: $query, filters: $filters) {
66
- id name price currency type activeInstallCount
67
- }
68
- }
69
- `;
70
- var GET_STORE_PRODUCT = `
71
- query GetStoreProduct($id: ID!) {
72
- getProduct(id: $id) {
73
- id name description price currency type status
74
- publisher { name }
75
- }
76
- }
77
- `;
78
- var MY_CART = `
79
- query MyCart {
80
- myCart {
81
- id currency subtotal total itemCount isEmpty
82
- items { id productId quantity }
83
- }
84
- }
85
- `;
86
- var ADD_TO_CART = `
87
- mutation AddToCart($input: AddToCartInput!) {
88
- addToCart(input: $input) {
89
- id itemCount subtotal items { productId quantity }
90
- }
91
- }
92
- `;
93
- var REMOVE_FROM_CART = `
94
- mutation RemoveFromCart($cartId: ID!, $itemId: ID!) {
95
- removeFromCart(cartId: $cartId, itemId: $itemId) {
96
- id itemCount subtotal
97
- }
98
- }
99
- `;
100
- var CHECKOUT_CART = `
101
- mutation CheckoutCart($cartId: ID!) {
102
- checkoutCart(cartId: $cartId) {
103
- success order { id total status }
104
- }
105
- }
106
- `;
107
- var GET_ORDERS = `
108
- query GetOrders($limit: Int, $offset: Int) {
109
- getOrders(limit: $limit, offset: $offset) {
110
- id status total currency createdAt
111
- }
112
- }
113
- `;
114
- var GET_ORDER = `
115
- query GetOrder($id: ID!) {
116
- getOrder(id: $id) {
117
- id status total currency paidAt billingAccountId
118
- lineItems { productId quantity unitPrice }
119
- }
120
- }
121
- `;
122
- var GET_INSTALLED_PRODUCTS = `
123
- query GetInstalledProducts($workspaceId: ID!) {
124
- getInstalledProducts(workspaceId: $workspaceId) {
125
- id application { id name } status installedAt lastUsedAt
126
- }
127
- }
128
- `;
129
- var UNINSTALL_PRODUCT = `
130
- mutation UninstallProduct($installationId: ID!) {
131
- uninstallProduct(installationId: $installationId) { success }
132
- }
133
- `;
134
- var GET_LICENSES = `
135
- query GetLicenses($entitlementId: ID!) {
136
- getLicenses(entitlementId: $entitlementId) {
137
- id status validFrom expiresAt
138
- }
139
- }
140
- `;
141
- var CLEAR_CART = `
142
- mutation ClearCart {
143
- clearCart {
144
- cart {
145
- id currency subtotal total itemCount isEmpty
146
- items { id productId quantity }
147
- }
148
- errors { code field message }
149
- }
150
- }
151
- `;
152
- var GET_MY_PUBLISHER = `
153
- query MyPublisher {
154
- myPublisher {
155
- id name legalName email contactEmail websiteUrl
156
- bio logoUrl isVerified verificationStatus
157
- productCount totalSales totalEarnings tier
158
- createdAt updatedAt
159
- }
160
- }
161
- `;
162
- var GET_MY_PUBLISHER_PRODUCTS = `
163
- query MyPublisherProducts {
164
- myPublisher {
165
- id productCount
166
- products {
167
- id name slug description price currency type status downloads
168
- publisher { id name isVerified }
169
- }
170
- }
171
- }
172
- `;
173
-
174
47
  // src/modules/store/tools.ts
175
- function resolveWorkspaceId(ctx, override) {
176
- if (override !== void 0 && override !== "") return override;
177
- const auth = ctx.auth.read();
178
- if (!auth?.workspaceId) return null;
179
- return auth.workspaceId;
180
- }
181
- function registerStoreTools(server, ctx, track) {
182
- server.registerTool(
183
- track(mcpToolName(ctx.productName, "store_search")),
184
- {
185
- title: "Search Store",
186
- description: "Search the marketplace for products by query and optional filters.",
187
- inputSchema: {
188
- query: zod.z.string().describe("Search query"),
189
- type: zod.z.string().optional().describe("Product type filter"),
190
- category: zod.z.string().optional().describe("Category filter")
191
- }
192
- },
193
- async ({ query, type, category }) => {
194
- try {
195
- const filters = {};
196
- if (type !== void 0) filters.productType = type.toUpperCase();
197
- if (category !== void 0) filters.category = category;
198
- const data = await ctx.gql.global.request(SEARCH_STORE, {
199
- query,
200
- filters: Object.keys(filters).length ? filters : void 0
201
- });
202
- return jsonResult(data.searchStore);
203
- } catch (error) {
204
- ctx.logger.error("store_search failed", { error: String(error) });
205
- return errorResult(
206
- `Failed to search store: ${error instanceof Error ? error.message : String(error)}`
207
- );
208
- }
209
- }
210
- );
211
- server.registerTool(
212
- track(mcpToolName(ctx.productName, "store_browse")),
213
- {
214
- title: "Browse Store",
215
- description: "Browse the marketplace with structured input (categories, facets, paging).",
216
- inputSchema: {
217
- category: zod.z.string().optional().describe("Category filter"),
218
- type: zod.z.string().optional().describe("Product type filter"),
219
- limit: zod.z.number().optional().describe("Page size"),
220
- offset: zod.z.number().optional().describe("Skip results")
221
- }
222
- },
223
- async ({ category, type, limit, offset }) => {
224
- try {
225
- const input = {};
226
- if (category !== void 0) input.category = category;
227
- if (type !== void 0) input.productType = type.toUpperCase();
228
- if (limit !== void 0) input.limit = limit;
229
- if (offset !== void 0) input.offset = offset;
230
- const data = await ctx.gql.global.request(BROWSE_STORE, { input });
231
- return jsonResult(data.browseStore);
232
- } catch (error) {
233
- ctx.logger.error("store_browse failed", { error: String(error) });
234
- return errorResult(
235
- `Failed to browse store: ${error instanceof Error ? error.message : String(error)}`
236
- );
237
- }
238
- }
239
- );
240
- server.registerTool(
241
- track(mcpToolName(ctx.productName, "store_get_product")),
242
- {
243
- title: "Get Store Product",
244
- description: "Get a marketplace product by ID.",
245
- inputSchema: { id: zod.z.string().describe("Product ID") }
246
- },
247
- async ({ id }) => {
248
- try {
249
- const data = await ctx.gql.global.request(
250
- GET_STORE_PRODUCT,
251
- { id }
252
- );
253
- if (!data.getProduct) return errorResult(`Product ${id} not found`);
254
- return jsonResult(data.getProduct);
255
- } catch (error) {
256
- ctx.logger.error("store_get_product failed", { error: String(error) });
257
- return errorResult(
258
- `Failed to get product: ${error instanceof Error ? error.message : String(error)}`
259
- );
260
- }
261
- }
262
- );
263
- server.registerTool(
264
- track(mcpToolName(ctx.productName, "store_cart_list")),
265
- {
266
- title: "Show Cart",
267
- description: "Show the current user's cart.",
268
- inputSchema: {}
269
- },
270
- async () => {
271
- try {
272
- const data = await ctx.gql.global.request(MY_CART);
273
- return jsonResult(data.myCart);
274
- } catch (error) {
275
- ctx.logger.error("store_cart_list failed", { error: String(error) });
276
- return errorResult(
277
- `Failed to fetch cart: ${error instanceof Error ? error.message : String(error)}`
278
- );
279
- }
280
- }
281
- );
282
- server.registerTool(
283
- track(mcpToolName(ctx.productName, "store_cart_add")),
284
- {
285
- title: "Add to Cart",
286
- description: "Add a product (and optional variant) to the cart.",
287
- inputSchema: {
288
- product: zod.z.string().describe("Product ID"),
289
- quantity: zod.z.number().optional().describe("Quantity (default 1)"),
290
- variant: zod.z.string().optional().describe("Variant ID")
291
- }
292
- },
293
- async ({ product, quantity, variant }) => {
294
- try {
295
- const input = { productId: product };
296
- if (quantity !== void 0) input.quantity = quantity;
297
- if (variant !== void 0) input.variantId = variant;
298
- const data = await ctx.gql.global.request(ADD_TO_CART, { input });
299
- return jsonResult(data.addToCart);
300
- } catch (error) {
301
- ctx.logger.error("store_cart_add failed", { error: String(error) });
302
- return errorResult(
303
- `Failed to add to cart: ${error instanceof Error ? error.message : String(error)}`
304
- );
305
- }
306
- }
307
- );
48
+ function stubbedTool(server, toolName, title, description, featureNote, inputSchema, altSuggestions) {
308
49
  server.registerTool(
309
- track(mcpToolName(ctx.productName, "store_cart_remove")),
50
+ toolName,
310
51
  {
311
- title: "Remove from Cart",
312
- description: "Remove an item from the cart.",
313
- inputSchema: {
314
- cart: zod.z.string().describe("Cart ID"),
315
- item: zod.z.string().describe("Cart item ID")
316
- }
52
+ title,
53
+ description: `${description} [STUB]`,
54
+ inputSchema
317
55
  },
318
- async ({ cart, item }) => {
319
- try {
320
- await ctx.gql.global.request(REMOVE_FROM_CART, { cartId: cart, itemId: item });
321
- return jsonResult({ status: "success", message: "Item removed from cart", cart, item });
322
- } catch (error) {
323
- ctx.logger.error("store_cart_remove failed", { error: String(error) });
324
- return errorResult(
325
- `Failed to remove cart item: ${error instanceof Error ? error.message : String(error)}`
326
- );
327
- }
328
- }
329
- );
330
- server.registerTool(
331
- track(mcpToolName(ctx.productName, "store_cart_checkout")),
332
- {
333
- title: "Checkout Cart",
334
- description: "Check out the cart server-side (uses default payment method on the billing account).",
335
- inputSchema: { cartId: zod.z.string().describe("Cart ID") }
336
- },
337
- async ({ cartId }) => {
338
- try {
339
- const data = await ctx.gql.global.request(CHECKOUT_CART, { cartId });
340
- return jsonResult(data.checkoutCart);
341
- } catch (error) {
342
- ctx.logger.error("store_cart_checkout failed", { error: String(error) });
343
- return errorResult(
344
- `Failed to checkout cart: ${error instanceof Error ? error.message : String(error)}`
345
- );
346
- }
347
- }
348
- );
349
- server.registerTool(
350
- track(mcpToolName(ctx.productName, "store_cart_clear")),
351
- {
352
- title: "Clear Cart",
353
- description: "Remove every item from the current user's active cart. Returns the resulting empty cart payload.",
354
- inputSchema: {}
355
- },
356
- async () => {
357
- try {
358
- const data = await ctx.gql.global.request(CLEAR_CART);
359
- const payload = data.clearCart;
360
- if (payload?.errors && payload.errors.length > 0) {
361
- const first = payload.errors[0];
362
- return errorResult(`Failed to clear cart: ${first.code} ${first.message}`);
363
- }
364
- return jsonResult(payload?.cart ?? null);
365
- } catch (error) {
366
- ctx.logger.error("store_cart_clear failed", { error: String(error) });
367
- return errorResult(
368
- `Failed to clear cart: ${error instanceof Error ? error.message : String(error)}`
369
- );
370
- }
371
- }
372
- );
373
- server.registerTool(
374
- track(mcpToolName(ctx.productName, "store_orders_list")),
375
- {
376
- title: "List Orders",
377
- description: "List orders for the current user.",
378
- inputSchema: {
379
- limit: zod.z.number().optional().describe("Page size (default 50)"),
380
- offset: zod.z.number().optional().describe("Skip results (default 0)")
381
- }
382
- },
383
- async ({ limit, offset }) => {
384
- try {
385
- const data = await ctx.gql.global.request(GET_ORDERS, {
386
- limit,
387
- offset: offset ?? 0
388
- });
389
- return jsonResult(data.getOrders);
390
- } catch (error) {
391
- ctx.logger.error("store_orders_list failed", { error: String(error) });
392
- return errorResult(
393
- `Failed to list orders: ${error instanceof Error ? error.message : String(error)}`
394
- );
395
- }
396
- }
397
- );
398
- server.registerTool(
399
- track(mcpToolName(ctx.productName, "store_orders_get")),
400
- {
401
- title: "Get Order",
402
- description: "Get an order by ID.",
403
- inputSchema: { id: zod.z.string().describe("Order ID") }
404
- },
405
- async ({ id }) => {
406
- try {
407
- const data = await ctx.gql.global.request(GET_ORDER, { id });
408
- if (!data.getOrder) return errorResult(`Order ${id} not found`);
409
- return jsonResult(data.getOrder);
410
- } catch (error) {
411
- ctx.logger.error("store_orders_get failed", { error: String(error) });
412
- return errorResult(
413
- `Failed to get order: ${error instanceof Error ? error.message : String(error)}`
414
- );
415
- }
416
- }
417
- );
418
- server.registerTool(
419
- track(mcpToolName(ctx.productName, "store_installed_list")),
420
- {
421
- title: "List Installed Products",
422
- description: "List installed products in the current (or specified) workspace.",
423
- inputSchema: {
424
- workspace: zod.z.string().optional().describe("Workspace ID (defaults to current)")
425
- }
426
- },
427
- async ({ workspace }) => {
428
- try {
429
- const wid = resolveWorkspaceId(ctx, workspace);
430
- if (!wid) {
431
- return errorResult(
432
- "No active workspace. Bind a workspace via the auth login flow first."
433
- );
434
- }
435
- const data = await ctx.gql.global.request(GET_INSTALLED_PRODUCTS, { workspaceId: wid });
436
- return jsonResult(data.getInstalledProducts);
437
- } catch (error) {
438
- ctx.logger.error("store_installed_list failed", { error: String(error) });
439
- return errorResult(
440
- `Failed to list installed products: ${error instanceof Error ? error.message : String(error)}`
441
- );
442
- }
443
- }
444
- );
445
- server.registerTool(
446
- track(mcpToolName(ctx.productName, "store_installed_uninstall")),
447
- {
448
- title: "Uninstall Product",
449
- description: "Uninstall a product by installation ID.",
450
- inputSchema: { installationId: zod.z.string().describe("Installation ID") }
451
- },
452
- async ({ installationId }) => {
453
- try {
454
- await ctx.gql.global.request(UNINSTALL_PRODUCT, { installationId });
455
- return jsonResult({ status: "success", message: "Product uninstalled", installationId });
456
- } catch (error) {
457
- ctx.logger.error("store_installed_uninstall failed", { error: String(error) });
458
- return errorResult(
459
- `Failed to uninstall product: ${error instanceof Error ? error.message : String(error)}`
460
- );
461
- }
462
- }
463
- );
464
- server.registerTool(
465
- track(mcpToolName(ctx.productName, "store_licenses_list")),
466
- {
467
- title: "List Licenses",
468
- description: "List licenses for an entitlement.",
469
- inputSchema: { entitlement: zod.z.string().describe("Entitlement ID") }
470
- },
471
- async ({ entitlement }) => {
472
- try {
473
- const data = await ctx.gql.global.request(GET_LICENSES, { entitlementId: entitlement });
474
- return jsonResult(data.getLicenses);
475
- } catch (error) {
476
- ctx.logger.error("store_licenses_list failed", { error: String(error) });
477
- return errorResult(
478
- `Failed to list licenses: ${error instanceof Error ? error.message : String(error)}`
479
- );
480
- }
481
- }
482
- );
483
- server.registerTool(
484
- track(mcpToolName(ctx.productName, "store_publisher_get")),
485
- {
486
- title: "Get Publisher",
487
- description: "Fetch the current user's publisher profile (verification status, tier, totals). Returns null if no publisher profile exists yet.",
488
- inputSchema: {}
489
- },
490
- async () => {
491
- try {
492
- const data = await ctx.gql.global.request(
493
- GET_MY_PUBLISHER
494
- );
495
- return jsonResult(data.myPublisher);
496
- } catch (error) {
497
- ctx.logger.error("store_publisher_get failed", { error: String(error) });
498
- return errorResult(
499
- `Failed to get publisher: ${error instanceof Error ? error.message : String(error)}`
500
- );
501
- }
502
- }
503
- );
504
- server.registerTool(
505
- track(mcpToolName(ctx.productName, "store_publisher_products")),
506
- {
507
- title: "List Publisher Products",
508
- description: "List products published by the current user's publisher profile. Returns { publisherId, productCount, products } or null if no profile exists.",
509
- inputSchema: {}
510
- },
511
- async () => {
512
- try {
513
- const data = await ctx.gql.global.request(GET_MY_PUBLISHER_PRODUCTS);
514
- const p = data.myPublisher;
515
- if (!p) return jsonResult(null);
516
- return jsonResult({
517
- publisherId: p.id,
518
- productCount: p.productCount,
519
- products: p.products
520
- });
521
- } catch (error) {
522
- ctx.logger.error("store_publisher_products failed", { error: String(error) });
523
- return errorResult(
524
- `Failed to list publisher products: ${error instanceof Error ? error.message : String(error)}`
525
- );
526
- }
527
- }
56
+ async () => errorResult(
57
+ `[stubbed] ${featureNote} Use ${altSuggestions.join(", ")} instead. The tool remains registered so callers receive a meaningful response instead of a schema-validation error.`
58
+ )
528
59
  );
529
60
  }
61
+ function registerStoreTools(server, ctx, track) {
62
+ const featureNote = "Live alpha removed `Query.storeProducts` and the `searchStore` / `browseStore` / `myCart` family. The closest survivors (`searchProducts` / `featuredProducts`) are a different domain shape.";
63
+ const alts = [
64
+ "the next alpha release that restores the public `storeProducts` query",
65
+ "the SDK store API (which the MCP will mirror once it lands)"
66
+ ];
67
+ const tools = [
68
+ ["store_browse", "Browse Store", "Browse the marketplace."],
69
+ ["store_search", "Search Store", "Search the marketplace."],
70
+ ["store_get_product", "Get Product", "Get a product by ID."],
71
+ ["store_cart_list", "Get My Cart", "Get the current user's cart."],
72
+ ["store_cart_add", "Add to Cart", "Add a product to the cart."],
73
+ ["store_cart_remove", "Remove from Cart", "Remove a product from the cart."],
74
+ ["store_cart_checkout", "Checkout Cart", "Complete the cart checkout."],
75
+ ["store_cart_clear", "Clear Cart", "Clear the cart."],
76
+ ["store_orders_list", "List Orders", "List orders."],
77
+ ["store_orders_get", "Get Order", "Get an order by ID."],
78
+ ["store_installed_list", "List Installed Products", "List installed products."],
79
+ ["store_installed_uninstall", "Uninstall Product", "Uninstall a product."],
80
+ ["store_licenses_list", "List Licenses", "List product licenses."],
81
+ ["store_publisher_get", "Get My Publisher", "Get the caller's publisher profile."],
82
+ [
83
+ "store_publisher_products",
84
+ "List My Publisher Products",
85
+ "List products published by the caller."
86
+ ]
87
+ ];
88
+ for (const [tool, title, desc] of tools) {
89
+ stubbedTool(
90
+ server,
91
+ track(mcpToolName(ctx.productName, tool)),
92
+ title,
93
+ desc,
94
+ featureNote,
95
+ {},
96
+ alts
97
+ );
98
+ }
99
+ }
530
100
 
531
101
  // src/modules/store/index.ts
532
102
  var storeModule = {