@lexq/cli 0.1.13 → 0.1.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.js +23 -34
- package/dist/mcp/register.js +23 -34
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1942,18 +1942,14 @@ function registerGroupTools(server, callApi) {
|
|
|
1942
1942
|
"lexq_groups_list",
|
|
1943
1943
|
{
|
|
1944
1944
|
title: "List Policy Groups",
|
|
1945
|
-
description: "List all policy groups
|
|
1945
|
+
description: "List all policy groups with pagination.",
|
|
1946
1946
|
inputSchema: {
|
|
1947
1947
|
page: z.number().int().min(0).default(0).describe("Page number (0-indexed)"),
|
|
1948
|
-
size: z.number().int().min(1).max(100).default(20).describe("Page size")
|
|
1949
|
-
status: z.enum(["ACTIVE", "DISABLED", "ARCHIVED"]).optional().describe("Filter by status"),
|
|
1950
|
-
keyword: z.string().optional().describe("Search keyword")
|
|
1948
|
+
size: z.number().int().min(1).max(100).default(20).describe("Page size")
|
|
1951
1949
|
}
|
|
1952
1950
|
},
|
|
1953
|
-
async ({ page, size
|
|
1951
|
+
async ({ page, size }) => {
|
|
1954
1952
|
const params = paginationParams(page, size);
|
|
1955
|
-
if (status) params.status = status;
|
|
1956
|
-
if (keyword) params.keyword = keyword;
|
|
1957
1953
|
return callApi("GET", "policy-groups", { params });
|
|
1958
1954
|
}
|
|
1959
1955
|
);
|
|
@@ -2014,7 +2010,7 @@ function registerGroupTools(server, callApi) {
|
|
|
2014
2010
|
maxSelections: z.number().int().min(1).optional().describe("Max selections")
|
|
2015
2011
|
}
|
|
2016
2012
|
},
|
|
2017
|
-
async ({ groupId, ...body }) => callApi("
|
|
2013
|
+
async ({ groupId, ...body }) => callApi("PUT", `policy-groups/${groupId}`, { body })
|
|
2018
2014
|
);
|
|
2019
2015
|
server.registerTool(
|
|
2020
2016
|
"lexq_groups_delete",
|
|
@@ -2031,41 +2027,37 @@ function registerGroupTools(server, callApi) {
|
|
|
2031
2027
|
"lexq_ab_test_start",
|
|
2032
2028
|
{
|
|
2033
2029
|
title: "Start A/B Test",
|
|
2034
|
-
description: "Start an A/B test on a policy group. Requires a challenger version ID and traffic
|
|
2030
|
+
description: "Start an A/B test on a policy group. Requires a challenger version ID and traffic rate.",
|
|
2035
2031
|
inputSchema: {
|
|
2036
2032
|
groupId: z.string().uuid().describe("Policy group ID"),
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
challengerWeight: z.number().int().min(1).max(99).describe("Challenger traffic weight (%)"),
|
|
2040
|
-
identityKey: z.string().optional().describe("Fact key for sticky assignment (e.g. customer_id)")
|
|
2033
|
+
testVersionId: z.string().uuid().describe("Challenger version ID to test"),
|
|
2034
|
+
trafficRate: z.number().int().min(1).max(99).describe("Traffic percentage routed to challenger (1-99)")
|
|
2041
2035
|
}
|
|
2042
2036
|
},
|
|
2043
|
-
async ({ groupId, ...body }) => callApi("POST", `policy-groups/${groupId}/ab-test
|
|
2037
|
+
async ({ groupId, ...body }) => callApi("POST", `policy-groups/${groupId}/ab-test`, { body })
|
|
2044
2038
|
);
|
|
2045
2039
|
server.registerTool(
|
|
2046
2040
|
"lexq_ab_test_stop",
|
|
2047
2041
|
{
|
|
2048
2042
|
title: "Stop A/B Test",
|
|
2049
|
-
description: "Stop a running A/B test.
|
|
2043
|
+
description: "Stop a running A/B test. All traffic is restored to the control (current) version.",
|
|
2050
2044
|
inputSchema: {
|
|
2051
|
-
groupId: z.string().uuid().describe("Policy group ID")
|
|
2052
|
-
winnerVersionId: z.string().uuid().describe("Version ID to keep as live")
|
|
2045
|
+
groupId: z.string().uuid().describe("Policy group ID")
|
|
2053
2046
|
}
|
|
2054
2047
|
},
|
|
2055
|
-
async ({ groupId
|
|
2048
|
+
async ({ groupId }) => callApi("DELETE", `policy-groups/${groupId}/ab-test`)
|
|
2056
2049
|
);
|
|
2057
2050
|
server.registerTool(
|
|
2058
2051
|
"lexq_ab_test_adjust",
|
|
2059
2052
|
{
|
|
2060
2053
|
title: "Adjust A/B Test",
|
|
2061
|
-
description: "Adjust traffic
|
|
2054
|
+
description: "Adjust traffic rate of a running A/B test.",
|
|
2062
2055
|
inputSchema: {
|
|
2063
2056
|
groupId: z.string().uuid().describe("Policy group ID"),
|
|
2064
|
-
|
|
2065
|
-
challengerWeight: z.number().int().min(1).max(99).describe("New challenger weight (%)")
|
|
2057
|
+
trafficRate: z.number().int().min(1).max(99).describe("New traffic percentage for challenger (1-99)")
|
|
2066
2058
|
}
|
|
2067
2059
|
},
|
|
2068
|
-
async ({ groupId, ...body }) => callApi("
|
|
2060
|
+
async ({ groupId, ...body }) => callApi("PATCH", `policy-groups/${groupId}/ab-test/traffic-rate`, { body })
|
|
2069
2061
|
);
|
|
2070
2062
|
}
|
|
2071
2063
|
|
|
@@ -2126,7 +2118,7 @@ function registerVersionTools(server, callApi) {
|
|
|
2126
2118
|
effectiveTo: z2.string().optional().describe("New effective end date")
|
|
2127
2119
|
}
|
|
2128
2120
|
},
|
|
2129
|
-
async ({ groupId, versionId, ...body }) => callApi("
|
|
2121
|
+
async ({ groupId, versionId, ...body }) => callApi("PUT", `policy-groups/${groupId}/versions/${versionId}`, { body })
|
|
2130
2122
|
);
|
|
2131
2123
|
server.registerTool(
|
|
2132
2124
|
"lexq_versions_delete",
|
|
@@ -2147,15 +2139,12 @@ function registerVersionTools(server, callApi) {
|
|
|
2147
2139
|
description: "Clone an existing version to create a new DRAFT. Useful when the source version is already published.",
|
|
2148
2140
|
inputSchema: {
|
|
2149
2141
|
groupId: z2.string().uuid().describe("Policy group ID"),
|
|
2150
|
-
versionId: z2.string().uuid().describe("Source version ID to clone")
|
|
2151
|
-
commitMessage: z2.string().optional().describe("Commit message for the cloned version")
|
|
2142
|
+
versionId: z2.string().uuid().describe("Source version ID to clone")
|
|
2152
2143
|
}
|
|
2153
2144
|
},
|
|
2154
|
-
async ({ groupId, versionId
|
|
2155
|
-
const body = {};
|
|
2156
|
-
if (commitMessage !== void 0) body.commitMessage = commitMessage;
|
|
2145
|
+
async ({ groupId, versionId }) => {
|
|
2157
2146
|
return callApi("POST", `policy-groups/${groupId}/versions/${versionId}/clone`, {
|
|
2158
|
-
body
|
|
2147
|
+
body: {}
|
|
2159
2148
|
});
|
|
2160
2149
|
}
|
|
2161
2150
|
);
|
|
@@ -2205,7 +2194,7 @@ function registerRuleTools(server, callApi) {
|
|
|
2205
2194
|
Actions: [{ type, parameters }]
|
|
2206
2195
|
|
|
2207
2196
|
Action parameter schemas:
|
|
2208
|
-
- DISCOUNT: { refVar: string, method: "PERCENTAGE"|"AMOUNT", rate
|
|
2197
|
+
- DISCOUNT: { refVar: string, method: "PERCENTAGE"|"AMOUNT", rate?: number (when PERCENTAGE), value?: number (when AMOUNT) }
|
|
2209
2198
|
- POINT: { refVar: string, targetVar: string, method: "PERCENTAGE"|"AMOUNT", rate?: number (when PERCENTAGE), value?: number (when AMOUNT), integrationId: uuid }
|
|
2210
2199
|
- COUPON_ISSUE: { couponId: string, integrationId: uuid }- BLOCK: { reason: string }
|
|
2211
2200
|
- NOTIFICATION: { channel: "SMS"|"EMAIL"|"PUSH"|"KAKAO", targetVar: string, templateId: string, integrationId: uuid }
|
|
@@ -2241,7 +2230,7 @@ function registerRuleTools(server, callApi) {
|
|
|
2241
2230
|
},
|
|
2242
2231
|
async ({ groupId, versionId, ruleId, rule }) => {
|
|
2243
2232
|
const body = JSON.parse(rule);
|
|
2244
|
-
return callApi("
|
|
2233
|
+
return callApi("PUT", `policy-groups/${groupId}/versions/${versionId}/rules/${ruleId}`, {
|
|
2245
2234
|
body
|
|
2246
2235
|
});
|
|
2247
2236
|
}
|
|
@@ -2282,7 +2271,7 @@ function registerRuleTools(server, callApi) {
|
|
|
2282
2271
|
ruleId,
|
|
2283
2272
|
priority: index
|
|
2284
2273
|
}));
|
|
2285
|
-
return callApi("
|
|
2274
|
+
return callApi("PATCH", `policy-groups/${groupId}/versions/${versionId}/rules/reorder`, {
|
|
2286
2275
|
body: { rules }
|
|
2287
2276
|
});
|
|
2288
2277
|
}
|
|
@@ -2299,7 +2288,7 @@ function registerRuleTools(server, callApi) {
|
|
|
2299
2288
|
isEnabled: z3.boolean().describe("true to enable, false to disable")
|
|
2300
2289
|
}
|
|
2301
2290
|
},
|
|
2302
|
-
async ({ groupId, versionId, ruleId, isEnabled }) => callApi("PATCH", `policy-groups/${groupId}/versions/${versionId}/rules/${ruleId}/
|
|
2291
|
+
async ({ groupId, versionId, ruleId, isEnabled }) => callApi("PATCH", `policy-groups/${groupId}/versions/${versionId}/rules/${ruleId}/enabled`, {
|
|
2303
2292
|
body: { isEnabled }
|
|
2304
2293
|
})
|
|
2305
2294
|
);
|
|
@@ -2352,7 +2341,7 @@ function registerFactTools(server, callApi) {
|
|
|
2352
2341
|
isRequired: z4.boolean().describe("Required flag")
|
|
2353
2342
|
}
|
|
2354
2343
|
},
|
|
2355
|
-
async ({ factId, ...body }) => callApi("
|
|
2344
|
+
async ({ factId, ...body }) => callApi("PUT", `schema/facts/${factId}`, { body })
|
|
2356
2345
|
);
|
|
2357
2346
|
server.registerTool(
|
|
2358
2347
|
"lexq_facts_delete",
|
package/dist/mcp/register.js
CHANGED
|
@@ -35,18 +35,14 @@ function registerGroupTools(server, callApi) {
|
|
|
35
35
|
"lexq_groups_list",
|
|
36
36
|
{
|
|
37
37
|
title: "List Policy Groups",
|
|
38
|
-
description: "List all policy groups
|
|
38
|
+
description: "List all policy groups with pagination.",
|
|
39
39
|
inputSchema: {
|
|
40
40
|
page: z.number().int().min(0).default(0).describe("Page number (0-indexed)"),
|
|
41
|
-
size: z.number().int().min(1).max(100).default(20).describe("Page size")
|
|
42
|
-
status: z.enum(["ACTIVE", "DISABLED", "ARCHIVED"]).optional().describe("Filter by status"),
|
|
43
|
-
keyword: z.string().optional().describe("Search keyword")
|
|
41
|
+
size: z.number().int().min(1).max(100).default(20).describe("Page size")
|
|
44
42
|
}
|
|
45
43
|
},
|
|
46
|
-
async ({ page, size
|
|
44
|
+
async ({ page, size }) => {
|
|
47
45
|
const params = paginationParams(page, size);
|
|
48
|
-
if (status) params.status = status;
|
|
49
|
-
if (keyword) params.keyword = keyword;
|
|
50
46
|
return callApi("GET", "policy-groups", { params });
|
|
51
47
|
}
|
|
52
48
|
);
|
|
@@ -107,7 +103,7 @@ function registerGroupTools(server, callApi) {
|
|
|
107
103
|
maxSelections: z.number().int().min(1).optional().describe("Max selections")
|
|
108
104
|
}
|
|
109
105
|
},
|
|
110
|
-
async ({ groupId, ...body }) => callApi("
|
|
106
|
+
async ({ groupId, ...body }) => callApi("PUT", `policy-groups/${groupId}`, { body })
|
|
111
107
|
);
|
|
112
108
|
server.registerTool(
|
|
113
109
|
"lexq_groups_delete",
|
|
@@ -124,41 +120,37 @@ function registerGroupTools(server, callApi) {
|
|
|
124
120
|
"lexq_ab_test_start",
|
|
125
121
|
{
|
|
126
122
|
title: "Start A/B Test",
|
|
127
|
-
description: "Start an A/B test on a policy group. Requires a challenger version ID and traffic
|
|
123
|
+
description: "Start an A/B test on a policy group. Requires a challenger version ID and traffic rate.",
|
|
128
124
|
inputSchema: {
|
|
129
125
|
groupId: z.string().uuid().describe("Policy group ID"),
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
challengerWeight: z.number().int().min(1).max(99).describe("Challenger traffic weight (%)"),
|
|
133
|
-
identityKey: z.string().optional().describe("Fact key for sticky assignment (e.g. customer_id)")
|
|
126
|
+
testVersionId: z.string().uuid().describe("Challenger version ID to test"),
|
|
127
|
+
trafficRate: z.number().int().min(1).max(99).describe("Traffic percentage routed to challenger (1-99)")
|
|
134
128
|
}
|
|
135
129
|
},
|
|
136
|
-
async ({ groupId, ...body }) => callApi("POST", `policy-groups/${groupId}/ab-test
|
|
130
|
+
async ({ groupId, ...body }) => callApi("POST", `policy-groups/${groupId}/ab-test`, { body })
|
|
137
131
|
);
|
|
138
132
|
server.registerTool(
|
|
139
133
|
"lexq_ab_test_stop",
|
|
140
134
|
{
|
|
141
135
|
title: "Stop A/B Test",
|
|
142
|
-
description: "Stop a running A/B test.
|
|
136
|
+
description: "Stop a running A/B test. All traffic is restored to the control (current) version.",
|
|
143
137
|
inputSchema: {
|
|
144
|
-
groupId: z.string().uuid().describe("Policy group ID")
|
|
145
|
-
winnerVersionId: z.string().uuid().describe("Version ID to keep as live")
|
|
138
|
+
groupId: z.string().uuid().describe("Policy group ID")
|
|
146
139
|
}
|
|
147
140
|
},
|
|
148
|
-
async ({ groupId
|
|
141
|
+
async ({ groupId }) => callApi("DELETE", `policy-groups/${groupId}/ab-test`)
|
|
149
142
|
);
|
|
150
143
|
server.registerTool(
|
|
151
144
|
"lexq_ab_test_adjust",
|
|
152
145
|
{
|
|
153
146
|
title: "Adjust A/B Test",
|
|
154
|
-
description: "Adjust traffic
|
|
147
|
+
description: "Adjust traffic rate of a running A/B test.",
|
|
155
148
|
inputSchema: {
|
|
156
149
|
groupId: z.string().uuid().describe("Policy group ID"),
|
|
157
|
-
|
|
158
|
-
challengerWeight: z.number().int().min(1).max(99).describe("New challenger weight (%)")
|
|
150
|
+
trafficRate: z.number().int().min(1).max(99).describe("New traffic percentage for challenger (1-99)")
|
|
159
151
|
}
|
|
160
152
|
},
|
|
161
|
-
async ({ groupId, ...body }) => callApi("
|
|
153
|
+
async ({ groupId, ...body }) => callApi("PATCH", `policy-groups/${groupId}/ab-test/traffic-rate`, { body })
|
|
162
154
|
);
|
|
163
155
|
}
|
|
164
156
|
|
|
@@ -219,7 +211,7 @@ function registerVersionTools(server, callApi) {
|
|
|
219
211
|
effectiveTo: z2.string().optional().describe("New effective end date")
|
|
220
212
|
}
|
|
221
213
|
},
|
|
222
|
-
async ({ groupId, versionId, ...body }) => callApi("
|
|
214
|
+
async ({ groupId, versionId, ...body }) => callApi("PUT", `policy-groups/${groupId}/versions/${versionId}`, { body })
|
|
223
215
|
);
|
|
224
216
|
server.registerTool(
|
|
225
217
|
"lexq_versions_delete",
|
|
@@ -240,15 +232,12 @@ function registerVersionTools(server, callApi) {
|
|
|
240
232
|
description: "Clone an existing version to create a new DRAFT. Useful when the source version is already published.",
|
|
241
233
|
inputSchema: {
|
|
242
234
|
groupId: z2.string().uuid().describe("Policy group ID"),
|
|
243
|
-
versionId: z2.string().uuid().describe("Source version ID to clone")
|
|
244
|
-
commitMessage: z2.string().optional().describe("Commit message for the cloned version")
|
|
235
|
+
versionId: z2.string().uuid().describe("Source version ID to clone")
|
|
245
236
|
}
|
|
246
237
|
},
|
|
247
|
-
async ({ groupId, versionId
|
|
248
|
-
const body = {};
|
|
249
|
-
if (commitMessage !== void 0) body.commitMessage = commitMessage;
|
|
238
|
+
async ({ groupId, versionId }) => {
|
|
250
239
|
return callApi("POST", `policy-groups/${groupId}/versions/${versionId}/clone`, {
|
|
251
|
-
body
|
|
240
|
+
body: {}
|
|
252
241
|
});
|
|
253
242
|
}
|
|
254
243
|
);
|
|
@@ -298,7 +287,7 @@ function registerRuleTools(server, callApi) {
|
|
|
298
287
|
Actions: [{ type, parameters }]
|
|
299
288
|
|
|
300
289
|
Action parameter schemas:
|
|
301
|
-
- DISCOUNT: { refVar: string, method: "PERCENTAGE"|"AMOUNT", rate
|
|
290
|
+
- DISCOUNT: { refVar: string, method: "PERCENTAGE"|"AMOUNT", rate?: number (when PERCENTAGE), value?: number (when AMOUNT) }
|
|
302
291
|
- POINT: { refVar: string, targetVar: string, method: "PERCENTAGE"|"AMOUNT", rate?: number (when PERCENTAGE), value?: number (when AMOUNT), integrationId: uuid }
|
|
303
292
|
- COUPON_ISSUE: { couponId: string, integrationId: uuid }- BLOCK: { reason: string }
|
|
304
293
|
- NOTIFICATION: { channel: "SMS"|"EMAIL"|"PUSH"|"KAKAO", targetVar: string, templateId: string, integrationId: uuid }
|
|
@@ -334,7 +323,7 @@ function registerRuleTools(server, callApi) {
|
|
|
334
323
|
},
|
|
335
324
|
async ({ groupId, versionId, ruleId, rule }) => {
|
|
336
325
|
const body = JSON.parse(rule);
|
|
337
|
-
return callApi("
|
|
326
|
+
return callApi("PUT", `policy-groups/${groupId}/versions/${versionId}/rules/${ruleId}`, {
|
|
338
327
|
body
|
|
339
328
|
});
|
|
340
329
|
}
|
|
@@ -375,7 +364,7 @@ function registerRuleTools(server, callApi) {
|
|
|
375
364
|
ruleId,
|
|
376
365
|
priority: index
|
|
377
366
|
}));
|
|
378
|
-
return callApi("
|
|
367
|
+
return callApi("PATCH", `policy-groups/${groupId}/versions/${versionId}/rules/reorder`, {
|
|
379
368
|
body: { rules }
|
|
380
369
|
});
|
|
381
370
|
}
|
|
@@ -392,7 +381,7 @@ function registerRuleTools(server, callApi) {
|
|
|
392
381
|
isEnabled: z3.boolean().describe("true to enable, false to disable")
|
|
393
382
|
}
|
|
394
383
|
},
|
|
395
|
-
async ({ groupId, versionId, ruleId, isEnabled }) => callApi("PATCH", `policy-groups/${groupId}/versions/${versionId}/rules/${ruleId}/
|
|
384
|
+
async ({ groupId, versionId, ruleId, isEnabled }) => callApi("PATCH", `policy-groups/${groupId}/versions/${versionId}/rules/${ruleId}/enabled`, {
|
|
396
385
|
body: { isEnabled }
|
|
397
386
|
})
|
|
398
387
|
);
|
|
@@ -445,7 +434,7 @@ function registerFactTools(server, callApi) {
|
|
|
445
434
|
isRequired: z4.boolean().describe("Required flag")
|
|
446
435
|
}
|
|
447
436
|
},
|
|
448
|
-
async ({ factId, ...body }) => callApi("
|
|
437
|
+
async ({ factId, ...body }) => callApi("PUT", `schema/facts/${factId}`, { body })
|
|
449
438
|
);
|
|
450
439
|
server.registerTool(
|
|
451
440
|
"lexq_facts_delete",
|