@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 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
- Note: Rules can reference fact keys that are not yet registered in Fact Definitions. The engine allows this for flexibility. However, registering facts via lexq_facts_create is recommended \u2014 it enables type validation, the Console UI autocomplete, and the dry-run requirements analyzer.
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: {
@@ -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
- Note: Rules can reference fact keys that are not yet registered in Fact Definitions. The engine allows this for flexibility. However, registering facts via lexq_facts_create is recommended \u2014 it enables type validation, the Console UI autocomplete, and the dry-run requirements analyzer.
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: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lexq/cli",
3
- "version": "0.1.15",
3
+ "version": "0.1.17",
4
4
  "description": "LexQ CLI — manage policies, simulate rules, and deploy from the terminal. Built for humans and AI agents.",
5
5
  "type": "module",
6
6
  "bin": {