@wisewandtools/mcp-server 2.0.13 → 2.0.14
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 +0 -1
- package/dist/index.js +0 -221
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -545,32 +545,6 @@ var WisewandAPIClient = class {
|
|
|
545
545
|
async deleteFeed(id) {
|
|
546
546
|
return this.request("DELETE", `/v1/feeds/${id}`);
|
|
547
547
|
}
|
|
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
548
|
// ============= Transactions =============
|
|
575
549
|
async listTransactions(params = {}) {
|
|
576
550
|
const query = this.buildQuery(params);
|
|
@@ -4627,198 +4601,6 @@ var RSSToolHandler = class {
|
|
|
4627
4601
|
}
|
|
4628
4602
|
};
|
|
4629
4603
|
|
|
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
4604
|
// src/handlers/tools/TransactionsToolHandler.ts
|
|
4823
4605
|
var TransactionsToolHandler = class {
|
|
4824
4606
|
constructor(apiClient, _cache, metrics) {
|
|
@@ -6283,7 +6065,6 @@ var WisewandMCPServer = class {
|
|
|
6283
6065
|
this.productPagesHandler = new ProductPagesToolHandler(this.apiClient, this.cacheManager, this.metrics);
|
|
6284
6066
|
this.discoverHandler = new DiscoverToolHandler(this.apiClient, this.cacheManager, this.metrics);
|
|
6285
6067
|
this.rssHandler = new RSSToolHandler(this.apiClient, this.cacheManager, this.metrics);
|
|
6286
|
-
this.updatePostsHandler = new UpdatePostsToolHandler(this.apiClient, this.cacheManager, this.metrics);
|
|
6287
6068
|
this.transactionsHandler = new TransactionsToolHandler(this.apiClient, this.cacheManager, this.metrics);
|
|
6288
6069
|
this.jobsHandler = new JobsToolHandler(this.apiClient, this.cacheManager, this.metrics);
|
|
6289
6070
|
this.resourceHandler = new ResourceHandler(this.apiClient, this.cacheManager);
|
|
@@ -6316,7 +6097,6 @@ var WisewandMCPServer = class {
|
|
|
6316
6097
|
productPagesHandler;
|
|
6317
6098
|
discoverHandler;
|
|
6318
6099
|
rssHandler;
|
|
6319
|
-
updatePostsHandler;
|
|
6320
6100
|
transactionsHandler;
|
|
6321
6101
|
jobsHandler;
|
|
6322
6102
|
resourceHandler;
|
|
@@ -6334,7 +6114,6 @@ var WisewandMCPServer = class {
|
|
|
6334
6114
|
...this.productPagesHandler.getTools(),
|
|
6335
6115
|
...this.discoverHandler.getTools(),
|
|
6336
6116
|
...this.rssHandler.getTools(),
|
|
6337
|
-
...this.updatePostsHandler.getTools(),
|
|
6338
6117
|
...this.transactionsHandler.getTools(),
|
|
6339
6118
|
...this.jobsHandler.getTools()
|
|
6340
6119
|
];
|