clishop 1.2.0 → 1.2.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.
- package/dist/index.js +2 -2
- package/dist/mcp.js +22 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -932,7 +932,7 @@ async function runSetupWizard() {
|
|
|
932
932
|
console.log();
|
|
933
933
|
console.log(chalk4.bold.cyan(" W E L C O M E T O C L I S H O P"));
|
|
934
934
|
console.log(chalk4.dim(" Order anything from your terminal."));
|
|
935
|
-
console.log(chalk4.dim(` Build: ${"2026-03-
|
|
935
|
+
console.log(chalk4.dim(` Build: ${"2026-03-03T19:05:40.427Z"}`));
|
|
936
936
|
console.log();
|
|
937
937
|
divider(chalk4.cyan);
|
|
938
938
|
console.log();
|
|
@@ -4587,7 +4587,7 @@ function registerFeedbackCommands(program2) {
|
|
|
4587
4587
|
|
|
4588
4588
|
// src/index.ts
|
|
4589
4589
|
var program = new Command();
|
|
4590
|
-
program.name("clishop").version("1.
|
|
4590
|
+
program.name("clishop").version("1.2.2").description(
|
|
4591
4591
|
chalk15.bold("CLISHOP") + ' \u2014 Order anything from your terminal.\n\n Use agents to set safety limits, addresses, and payment methods.\n The "default" agent is used when no agent is specified.'
|
|
4592
4592
|
).option("--agent <name>", "Use a specific agent for this command").hook("preAction", (thisCommand) => {
|
|
4593
4593
|
const agentOpt = thisCommand.opts().agent;
|
package/dist/mcp.js
CHANGED
|
@@ -13810,7 +13810,7 @@ function safeCall(fn) {
|
|
|
13810
13810
|
var server = new McpServer(
|
|
13811
13811
|
{
|
|
13812
13812
|
name: "clishop",
|
|
13813
|
-
version: "1.2.
|
|
13813
|
+
version: "1.2.2"
|
|
13814
13814
|
},
|
|
13815
13815
|
{
|
|
13816
13816
|
capabilities: {
|
|
@@ -13849,6 +13849,26 @@ server.registerTool("search_products", {
|
|
|
13849
13849
|
}, async (args) => {
|
|
13850
13850
|
return safeCall(async () => {
|
|
13851
13851
|
const api = getApiClient();
|
|
13852
|
+
let country = args.country;
|
|
13853
|
+
if (!country) {
|
|
13854
|
+
const agent = getActiveAgent();
|
|
13855
|
+
try {
|
|
13856
|
+
const addrRes = await api.get("/addresses", { params: { agent: agent.name } });
|
|
13857
|
+
const addresses = addrRes.data.addresses || [];
|
|
13858
|
+
const resolved = agent.defaultAddressId && addresses.find((a) => a.id === agent.defaultAddressId) || addresses[0];
|
|
13859
|
+
if (resolved) {
|
|
13860
|
+
country = resolved.country;
|
|
13861
|
+
if (!agent.defaultAddressId) {
|
|
13862
|
+
const { updateAgent } = await import("./config-WZBIQWME.js");
|
|
13863
|
+
updateAgent(agent.name, { defaultAddressId: resolved.id });
|
|
13864
|
+
}
|
|
13865
|
+
}
|
|
13866
|
+
} catch {
|
|
13867
|
+
}
|
|
13868
|
+
}
|
|
13869
|
+
if (!country) {
|
|
13870
|
+
throw new Error("No delivery country available. Add a shipping address first ('clishop address add') or pass the 'country' parameter (e.g. 'US', 'NL', 'BE').");
|
|
13871
|
+
}
|
|
13852
13872
|
const res = await api.get("/products/search", {
|
|
13853
13873
|
params: {
|
|
13854
13874
|
q: args.query,
|
|
@@ -13858,7 +13878,7 @@ server.registerTool("search_products", {
|
|
|
13858
13878
|
minPrice: args.minPrice,
|
|
13859
13879
|
maxPrice: args.maxPrice,
|
|
13860
13880
|
freeShipping: args.freeShipping || void 0,
|
|
13861
|
-
country
|
|
13881
|
+
country,
|
|
13862
13882
|
maxDeliveryDays: args.maxDeliveryDays,
|
|
13863
13883
|
inStock: args.inStock || void 0,
|
|
13864
13884
|
freeReturns: args.freeReturns || void 0,
|