@lexq/cli 0.1.15 → 0.1.17
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 +9 -2
- package/dist/mcp/register.js +9 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2186,7 +2186,10 @@ function registerRuleTools(server, callApi) {
|
|
|
2186
2186
|
title: "Create Rule",
|
|
2187
2187
|
description: `Create a rule in a DRAFT version. Requires name, priority, condition tree, and actions array.
|
|
2188
2188
|
|
|
2189
|
-
|
|
2189
|
+
Before creating rules with new fact keys, call lexq_facts_list to check existing facts.
|
|
2190
|
+
If a required key is missing, ask the user to confirm the type, isRequired, and description
|
|
2191
|
+
before calling lexq_facts_create \u2014 registering facts enables type validation, Console UI
|
|
2192
|
+
autocomplete, and the dry-run requirements analyzer.
|
|
2190
2193
|
|
|
2191
2194
|
Condition: { type: "SINGLE", field, operator, value, valueType } or { type: "GROUP", operator: "AND"|"OR", children: [...] }
|
|
2192
2195
|
Operators: EQUALS, NOT_EQUALS, GREATER_THAN, GREATER_THAN_OR_EQUAL, LESS_THAN, LESS_THAN_OR_EQUAL, CONTAINS, IN, NOT_IN
|
|
@@ -2200,7 +2203,11 @@ function registerRuleTools(server, callApi) {
|
|
|
2200
2203
|
- COUPON_ISSUE: { couponId: string, integrationId: uuid }
|
|
2201
2204
|
- BLOCK: { reason: string }
|
|
2202
2205
|
- NOTIFICATION: { channel: "SMS"|"EMAIL"|"PUSH"|"KAKAO", targetVar: string, templateId: string, integrationId: uuid }
|
|
2203
|
-
- WEBHOOK: { url: string, method: "POST" }
|
|
2206
|
+
- WEBHOOK: { url: string, method: "POST", payloadTemplate?: object } payloadTemplate is optional. Without it, all facts are sent as-is. With it, the object is sent as the HTTP body with {{variables}} replaced at execution time. Variables: {{fact.xxx}}, {{output.xxx}}, {{timestamp}}, {{ruleName}}, {{groupName}}, {{versionNo}}, {{xxx}} (shorthand).
|
|
2207
|
+
Platform examples:
|
|
2208
|
+
Slack: { "text": "Rule {{ruleName}} fired \u2014 {{fact.customer_tier}}" }
|
|
2209
|
+
Discord: { "content": "Rule {{ruleName}} fired \u2014 {{fact.customer_tier}}" }
|
|
2210
|
+
Generic: { "event": "rule_matched", "rule": "{{ruleName}}", "amount": "{{output.payment_amount}}" }
|
|
2204
2211
|
- SET_FACT: { key: string, value: string|number|boolean }
|
|
2205
2212
|
- ADD_TAG: { tag: string, targetVar: string }`,
|
|
2206
2213
|
inputSchema: {
|
package/dist/mcp/register.js
CHANGED
|
@@ -279,7 +279,10 @@ function registerRuleTools(server, callApi) {
|
|
|
279
279
|
title: "Create Rule",
|
|
280
280
|
description: `Create a rule in a DRAFT version. Requires name, priority, condition tree, and actions array.
|
|
281
281
|
|
|
282
|
-
|
|
282
|
+
Before creating rules with new fact keys, call lexq_facts_list to check existing facts.
|
|
283
|
+
If a required key is missing, ask the user to confirm the type, isRequired, and description
|
|
284
|
+
before calling lexq_facts_create \u2014 registering facts enables type validation, Console UI
|
|
285
|
+
autocomplete, and the dry-run requirements analyzer.
|
|
283
286
|
|
|
284
287
|
Condition: { type: "SINGLE", field, operator, value, valueType } or { type: "GROUP", operator: "AND"|"OR", children: [...] }
|
|
285
288
|
Operators: EQUALS, NOT_EQUALS, GREATER_THAN, GREATER_THAN_OR_EQUAL, LESS_THAN, LESS_THAN_OR_EQUAL, CONTAINS, IN, NOT_IN
|
|
@@ -293,7 +296,11 @@ function registerRuleTools(server, callApi) {
|
|
|
293
296
|
- COUPON_ISSUE: { couponId: string, integrationId: uuid }
|
|
294
297
|
- BLOCK: { reason: string }
|
|
295
298
|
- NOTIFICATION: { channel: "SMS"|"EMAIL"|"PUSH"|"KAKAO", targetVar: string, templateId: string, integrationId: uuid }
|
|
296
|
-
- WEBHOOK: { url: string, method: "POST" }
|
|
299
|
+
- WEBHOOK: { url: string, method: "POST", payloadTemplate?: object } payloadTemplate is optional. Without it, all facts are sent as-is. With it, the object is sent as the HTTP body with {{variables}} replaced at execution time. Variables: {{fact.xxx}}, {{output.xxx}}, {{timestamp}}, {{ruleName}}, {{groupName}}, {{versionNo}}, {{xxx}} (shorthand).
|
|
300
|
+
Platform examples:
|
|
301
|
+
Slack: { "text": "Rule {{ruleName}} fired \u2014 {{fact.customer_tier}}" }
|
|
302
|
+
Discord: { "content": "Rule {{ruleName}} fired \u2014 {{fact.customer_tier}}" }
|
|
303
|
+
Generic: { "event": "rule_matched", "rule": "{{ruleName}}", "amount": "{{output.payment_amount}}" }
|
|
297
304
|
- SET_FACT: { key: string, value: string|number|boolean }
|
|
298
305
|
- ADD_TAG: { tag: string, targetVar: string }`,
|
|
299
306
|
inputSchema: {
|