@wisewandtools/mcp-server 2.0.13 → 2.0.15

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/dist/index.d.ts CHANGED
@@ -296,7 +296,6 @@ declare class WisewandMCPServer {
296
296
  private productPagesHandler;
297
297
  private discoverHandler;
298
298
  private rssHandler;
299
- private updatePostsHandler;
300
299
  private transactionsHandler;
301
300
  private jobsHandler;
302
301
  private resourceHandler;
package/dist/index.js CHANGED
@@ -1,12 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  var __defProp = Object.defineProperty;
3
3
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
4
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
5
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
6
- }) : x)(function(x) {
7
- if (typeof require !== "undefined") return require.apply(this, arguments);
8
- throw Error('Dynamic require of "' + x + '" is not supported');
9
- });
10
4
 
11
5
  // src/index.ts
12
6
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
@@ -545,32 +539,6 @@ var WisewandAPIClient = class {
545
539
  async deleteFeed(id) {
546
540
  return this.request("DELETE", `/v1/feeds/${id}`);
547
541
  }
548
- // ============= Update Posts =============
549
- async createUpdatePost(input) {
550
- return this.request("POST", "/v1/updateposts/", input);
551
- }
552
- async getUpdatePost(id) {
553
- return this.request("GET", `/v1/updateposts/${id}`);
554
- }
555
- async listUpdatePosts(params = {}) {
556
- const query = this.buildQuery(params);
557
- return this.request("GET", `/v1/updateposts/?${query}`);
558
- }
559
- async updateUpdatePost(id, updates) {
560
- return this.request("PATCH", `/v1/updateposts/${id}`, updates);
561
- }
562
- async getUpdatePostOutput(id) {
563
- return this.request("GET", `/v1/updateposts/${id}/output`);
564
- }
565
- async runUpdatePost(id) {
566
- return this.request("POST", `/v1/updateposts/${id}/run`, {});
567
- }
568
- async calculateUpdatePostCost(input) {
569
- return this.request("POST", "/v1/updateposts/cost", input);
570
- }
571
- async createBulkUpdatePosts(items) {
572
- return this.request("POST", "/v1/updateposts/bulk", { items });
573
- }
574
542
  // ============= Transactions =============
575
543
  async listTransactions(params = {}) {
576
544
  const query = this.buildQuery(params);
@@ -4627,198 +4595,6 @@ var RSSToolHandler = class {
4627
4595
  }
4628
4596
  };
4629
4597
 
4630
- // src/handlers/tools/UpdatePostsToolHandler.ts
4631
- var UpdatePostsToolHandler = class {
4632
- constructor(apiClient, cache, metrics) {
4633
- this.apiClient = apiClient;
4634
- this.cache = cache;
4635
- this.metrics = metrics;
4636
- }
4637
- static {
4638
- __name(this, "UpdatePostsToolHandler");
4639
- }
4640
- getTools() {
4641
- return [
4642
- this.createUpdatePostTool(),
4643
- this.getUpdatePostTool(),
4644
- this.listUpdatePostsTool(),
4645
- this.updateUpdatePostTool(),
4646
- this.runUpdatePostTool(),
4647
- this.getUpdatePostOutputTool(),
4648
- this.estimateUpdatePostCostTool(),
4649
- this.bulkCreateUpdatePostsTool()
4650
- ];
4651
- }
4652
- createUpdatePostTool() {
4653
- return {
4654
- name: "create_update_post",
4655
- description: "Create a new update post for refreshing existing content",
4656
- inputSchema: {
4657
- type: "object",
4658
- properties: {
4659
- data: { type: "object", description: "Update post configuration", properties: { input: { type: "object", description: "Update post input configuration" } }, required: ["input"] }
4660
- },
4661
- required: ["data"]
4662
- },
4663
- handler: /* @__PURE__ */ __name(async (args) => {
4664
- try {
4665
- const updatePost = await this.apiClient.createUpdatePost(args);
4666
- await this.cache.set(`update_post:${updatePost.id}`, updatePost, 300);
4667
- this.metrics.recordAPICall("create_update_post", "success");
4668
- return { content: [{ type: "text", text: JSON.stringify({ success: true, update_post_id: updatePost.id, message: "Update post created successfully", next_steps: [`Use 'run_update_post' with id: ${updatePost.id}`, `Use 'get_update_post' with id: ${updatePost.id}`] }, null, 2) }] };
4669
- } catch (error) {
4670
- logger.error("Failed to create update post", { error: error.message });
4671
- this.metrics.recordAPICall("create_update_post", "error");
4672
- return { content: [{ type: "text", text: JSON.stringify({ error: true, message: error.message || "Failed to create update post" }, null, 2) }], isError: true };
4673
- }
4674
- }, "handler")
4675
- };
4676
- }
4677
- getUpdatePostTool() {
4678
- return {
4679
- name: "get_update_post",
4680
- description: "Get update post details and status",
4681
- inputSchema: { type: "object", properties: { id: { type: "string", format: "uuid" } }, required: ["id"] },
4682
- handler: /* @__PURE__ */ __name(async (args) => {
4683
- try {
4684
- const { id } = args;
4685
- const cached = await this.cache.get(`update_post:${id}`);
4686
- if (cached) {
4687
- return { content: [{ type: "text", text: JSON.stringify({ success: true, update_post: cached, from_cache: true }, null, 2) }] };
4688
- }
4689
- const updatePost = await this.apiClient.getUpdatePost(id);
4690
- await this.cache.set(`update_post:${id}`, updatePost, 300);
4691
- this.metrics.recordAPICall("get_update_post", "success");
4692
- return { content: [{ type: "text", text: JSON.stringify({ success: true, update_post: updatePost }, null, 2) }] };
4693
- } catch (error) {
4694
- logger.error("Failed to get update post", { error: error.message });
4695
- this.metrics.recordAPICall("get_update_post", "error");
4696
- return { content: [{ type: "text", text: JSON.stringify({ error: true, message: error.message || "Failed to get update post" }, null, 2) }], isError: true };
4697
- }
4698
- }, "handler")
4699
- };
4700
- }
4701
- listUpdatePostsTool() {
4702
- return {
4703
- name: "list_update_posts",
4704
- description: "List all update posts",
4705
- inputSchema: { type: "object", properties: { skip: { type: "number", default: 0 }, take: { type: "number", default: 10 }, search: { type: "string" }, status: { type: "string" }, project_id: { type: "string", format: "uuid" } } },
4706
- handler: /* @__PURE__ */ __name(async (args) => {
4707
- try {
4708
- const result2 = await this.apiClient.listUpdatePosts(args);
4709
- this.metrics.recordAPICall("list_update_posts", "success");
4710
- return { content: [{ type: "text", text: JSON.stringify({ success: true, total: result2.total, count: result2.items.length, update_posts: result2.items.map((u) => ({ id: u.id, name: u.name, status: u.status, created_at: u.created_at })) }, null, 2) }] };
4711
- } catch (error) {
4712
- logger.error("Failed to list update posts", { error: error.message });
4713
- this.metrics.recordAPICall("list_update_posts", "error");
4714
- return { content: [{ type: "text", text: JSON.stringify({ error: true, message: error.message || "Failed to list update posts" }, null, 2) }], isError: true };
4715
- }
4716
- }, "handler")
4717
- };
4718
- }
4719
- updateUpdatePostTool() {
4720
- return {
4721
- name: "update_update_post",
4722
- description: "Update an existing update post",
4723
- inputSchema: { type: "object", properties: { id: { type: "string", format: "uuid" }, updates: { type: "object", description: "Fields to update" } }, required: ["id", "updates"] },
4724
- handler: /* @__PURE__ */ __name(async (args) => {
4725
- try {
4726
- const { id, updates } = args;
4727
- await this.apiClient.updateUpdatePost(id, updates);
4728
- await this.cache.delete(`update_post:${id}`);
4729
- this.metrics.recordAPICall("update_update_post", "success");
4730
- return { content: [{ type: "text", text: JSON.stringify({ success: true, message: "Update post updated successfully", id, updated_fields: Object.keys(updates) }, null, 2) }] };
4731
- } catch (error) {
4732
- logger.error("Failed to update update post", { error: error.message });
4733
- this.metrics.recordAPICall("update_update_post", "error");
4734
- return { content: [{ type: "text", text: JSON.stringify({ error: true, message: error.message || "Failed to update update post" }, null, 2) }], isError: true };
4735
- }
4736
- }, "handler")
4737
- };
4738
- }
4739
- runUpdatePostTool() {
4740
- return {
4741
- name: "run_update_post",
4742
- description: "Run generation for an update post",
4743
- inputSchema: { type: "object", properties: { id: { type: "string", format: "uuid" } }, required: ["id"] },
4744
- handler: /* @__PURE__ */ __name(async (args) => {
4745
- try {
4746
- const { id } = args;
4747
- await this.apiClient.runUpdatePost(id);
4748
- await this.cache.delete(`update_post:${id}`);
4749
- this.metrics.recordAPICall("run_update_post", "success");
4750
- return { content: [{ type: "text", text: JSON.stringify({ success: true, message: "Update post generation started", update_post_id: id, next_step: `Use 'get_update_post' or 'get_update_post_output' to check status` }, null, 2) }] };
4751
- } catch (error) {
4752
- logger.error("Failed to run update post", { error: error.message });
4753
- this.metrics.recordAPICall("run_update_post", "error");
4754
- return { content: [{ type: "text", text: JSON.stringify({ error: true, message: error.message || "Failed to run update post" }, null, 2) }], isError: true };
4755
- }
4756
- }, "handler")
4757
- };
4758
- }
4759
- getUpdatePostOutputTool() {
4760
- return {
4761
- name: "get_update_post_output",
4762
- description: "Get the generated output of an update post",
4763
- inputSchema: { type: "object", properties: { id: { type: "string", format: "uuid" } }, required: ["id"] },
4764
- handler: /* @__PURE__ */ __name(async (args) => {
4765
- try {
4766
- const { id } = args;
4767
- const cacheKey = `update_post:output:${id}`;
4768
- const cached = await this.cache.get(cacheKey);
4769
- const output = cached || await this.apiClient.getUpdatePostOutput(id);
4770
- if (!cached && output) {
4771
- await this.cache.set(cacheKey, output, 600);
4772
- }
4773
- this.metrics.recordAPICall("get_update_post_output", "success");
4774
- return { content: [{ type: "text", text: JSON.stringify({ success: true, update_post_id: id, output, from_cache: !!cached }, null, 2) }] };
4775
- } catch (error) {
4776
- logger.error("Failed to get update post output", { error: error.message });
4777
- this.metrics.recordAPICall("get_update_post_output", "error");
4778
- return { content: [{ type: "text", text: JSON.stringify({ error: true, message: error.message || "Failed to get update post output" }, null, 2) }], isError: true };
4779
- }
4780
- }, "handler")
4781
- };
4782
- }
4783
- estimateUpdatePostCostTool() {
4784
- return {
4785
- name: "estimate_update_post_cost",
4786
- description: "Estimate the cost of an update post",
4787
- inputSchema: { type: "object", properties: { data: { type: "object", description: "Update post configuration for cost estimation" } }, required: ["data"] },
4788
- handler: /* @__PURE__ */ __name(async (args) => {
4789
- try {
4790
- const cost = await this.apiClient.calculateUpdatePostCost(args);
4791
- this.metrics.recordAPICall("estimate_update_post_cost", "success");
4792
- return { content: [{ type: "text", text: JSON.stringify({ success: true, cost_estimate: cost }, null, 2) }] };
4793
- } catch (error) {
4794
- logger.error("Failed to estimate update post cost", { error: error.message });
4795
- this.metrics.recordAPICall("estimate_update_post_cost", "error");
4796
- return { content: [{ type: "text", text: JSON.stringify({ error: true, message: error.message || "Failed to estimate cost" }, null, 2) }], isError: true };
4797
- }
4798
- }, "handler")
4799
- };
4800
- }
4801
- bulkCreateUpdatePostsTool() {
4802
- return {
4803
- name: "bulk_create_update_posts",
4804
- description: "Create multiple update posts at once",
4805
- inputSchema: { type: "object", properties: { items: { type: "array", items: { type: "object" } } }, required: ["items"] },
4806
- handler: /* @__PURE__ */ __name(async (args) => {
4807
- try {
4808
- const { items } = args;
4809
- const result2 = await this.apiClient.createBulkUpdatePosts(items);
4810
- this.metrics.recordAPICall("bulk_create_update_posts", "success");
4811
- return { content: [{ type: "text", text: JSON.stringify({ success: true, message: `Bulk created ${items.length} update posts`, result: result2 }, null, 2) }] };
4812
- } catch (error) {
4813
- logger.error("Failed to bulk create update posts", { error: error.message });
4814
- this.metrics.recordAPICall("bulk_create_update_posts", "error");
4815
- return { content: [{ type: "text", text: JSON.stringify({ error: true, message: error.message || "Failed to bulk create update posts" }, null, 2) }], isError: true };
4816
- }
4817
- }, "handler")
4818
- };
4819
- }
4820
- };
4821
-
4822
4598
  // src/handlers/tools/TransactionsToolHandler.ts
4823
4599
  var TransactionsToolHandler = class {
4824
4600
  constructor(apiClient, _cache, metrics) {
@@ -6283,7 +6059,6 @@ var WisewandMCPServer = class {
6283
6059
  this.productPagesHandler = new ProductPagesToolHandler(this.apiClient, this.cacheManager, this.metrics);
6284
6060
  this.discoverHandler = new DiscoverToolHandler(this.apiClient, this.cacheManager, this.metrics);
6285
6061
  this.rssHandler = new RSSToolHandler(this.apiClient, this.cacheManager, this.metrics);
6286
- this.updatePostsHandler = new UpdatePostsToolHandler(this.apiClient, this.cacheManager, this.metrics);
6287
6062
  this.transactionsHandler = new TransactionsToolHandler(this.apiClient, this.cacheManager, this.metrics);
6288
6063
  this.jobsHandler = new JobsToolHandler(this.apiClient, this.cacheManager, this.metrics);
6289
6064
  this.resourceHandler = new ResourceHandler(this.apiClient, this.cacheManager);
@@ -6316,7 +6091,6 @@ var WisewandMCPServer = class {
6316
6091
  productPagesHandler;
6317
6092
  discoverHandler;
6318
6093
  rssHandler;
6319
- updatePostsHandler;
6320
6094
  transactionsHandler;
6321
6095
  jobsHandler;
6322
6096
  resourceHandler;
@@ -6334,7 +6108,6 @@ var WisewandMCPServer = class {
6334
6108
  ...this.productPagesHandler.getTools(),
6335
6109
  ...this.discoverHandler.getTools(),
6336
6110
  ...this.rssHandler.getTools(),
6337
- ...this.updatePostsHandler.getTools(),
6338
6111
  ...this.transactionsHandler.getTools(),
6339
6112
  ...this.jobsHandler.getTools()
6340
6113
  ];
@@ -6490,6 +6263,7 @@ var WisewandMCPServer = class {
6490
6263
  };
6491
6264
 
6492
6265
  // src/utils/shutdown.ts
6266
+ import * as readline from "readline";
6493
6267
  function gracefulShutdown(server) {
6494
6268
  let isShuttingDown = false;
6495
6269
  const shutdown = /* @__PURE__ */ __name(async (signal) => {
@@ -6518,7 +6292,6 @@ function gracefulShutdown(server) {
6518
6292
  process.on("SIGINT", () => shutdown("SIGINT"));
6519
6293
  process.on("SIGHUP", () => shutdown("SIGHUP"));
6520
6294
  if (process.platform === "win32") {
6521
- const readline = __require("readline");
6522
6295
  const rl = readline.createInterface({
6523
6296
  input: process.stdin,
6524
6297
  output: process.stdout