@lexq/cli 0.1.28 → 0.1.30

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
@@ -187,7 +187,7 @@ function registerAuthCommands(program) {
187
187
 
188
188
  Example:
189
189
  $ lexq auth login
190
- Enter your API Key: sk_live_****
190
+ Enter your API Key: lexq_us_****
191
191
 
192
192
  ✓ API key saved to ~/.lexq/config.json
193
193
  `
@@ -218,7 +218,7 @@ function registerAuthCommands(program) {
218
218
 
219
219
  Example:
220
220
  $ lexq auth whoami
221
- { "tenantId": "abc-123", "userId": "...", "role": "ADMIN", "apiKey": "sk_live_****abcd" }
221
+ { "tenantId": "abc-123", "userId": "...", "role": "ADMIN", "apiKey": "lexq_us_****abcd" }
222
222
  `
223
223
  ).action(async () => {
224
224
  try {
@@ -1067,7 +1067,7 @@ function registerFactCommands(program) {
1067
1067
  delete Remove a fact definition
1068
1068
  action-metadata Show action runtime fact metadata
1069
1069
 
1070
- System facts (payment_amount, user_id, etc.) are auto-created and immutable.
1070
+ System facts (user_id, user_tags) are auto-created.
1071
1071
  `
1072
1072
  );
1073
1073
  facts.command("list").description("List fact definitions").option("--keyword <keyword>", "Filter by keyword").option("--page <number>", "Page number", "0").option("--size <number>", "Page size", "20").action(async (opts) => {
@@ -1715,18 +1715,20 @@ function registerAnalyticsCommands(program) {
1715
1715
  $ lexq analytics simulation start --json '{
1716
1716
  "policyVersionId": "<vid>",
1717
1717
  "dataset": {
1718
- "type": "EXECUTION_LOG",
1719
- "source": "RECENT",
1720
- "maxRecords": 1000
1718
+ "type": "HISTORICAL",
1719
+ "source": "EXECUTION_LOGS",
1720
+ "from": "2026-01-01",
1721
+ "to": "2026-01-31"
1721
1722
  },
1722
1723
  "options": {
1723
1724
  "baselinePolicyVersionId": "<baseline-vid>",
1724
- "includeRuleStats": true
1725
+ "includeRuleStats": true,
1726
+ "maxRecords": 1000
1725
1727
  }
1726
1728
  }'
1727
-
1728
- Dataset types: EXECUTION_LOG, MANUAL
1729
- Dataset sources: RECENT, DATE_RANGE, MANUAL
1729
+
1730
+ Dataset types: HISTORICAL, UPLOADED, MANUAL
1731
+ Dataset sources: EXECUTION_LOGS, S3_BUCKET, REQUEST_BODY
1730
1732
  `
1731
1733
  ).action(async (opts) => {
1732
1734
  try {
@@ -3125,7 +3127,7 @@ function registerRuleTools(server, callApi) {
3125
3127
 
3126
3128
  Action parameter schemas:
3127
3129
  - MUTATE_FACT: { refVar: string, operator: "ASSIGN"|"ADD"|"SUB"|"MUL"|"DIV", method: "PERCENTAGE"|"AMOUNT", rate?: number (when PERCENTAGE), value?: number (when AMOUNT), rounding?: RoundingOption } Constraints: DIV + PERCENTAGE is invalid (use MUL with rate/100 inverse). DIV + AMOUNT requires value !== 0.
3128
- - INCREMENT_FACT: { targetVar: string, method: "PERCENTAGE"|"AMOUNT", refVar?: string (required when PERCENTAGE), rate?: number (when PERCENTAGE), value?: number (when AMOUNT), rounding?: RoundingOption } Note: external system call (e.g. point system sync) is NOT a primitive responsibility. Compose [INCREMENT_FACT, EMIT_EVENT] chain instead.
3130
+ - INCREMENT_FACT: { targetVar: string, method: "PERCENTAGE"|"AMOUNT", refVar?: string (required when PERCENTAGE), rate?: number (when PERCENTAGE), value?: number (when AMOUNT), rounding?: RoundingOption } targetVar (accumulation target) must exist at execution; refVar (PERCENTAGE source) must exist when method is PERCENTAGE. Each is supplied as an input fact or written by a prior action in this rule — a missing required fact throws (no 0 default). Note: external system call (e.g. point system sync) is NOT a primitive responsibility. Compose [INCREMENT_FACT, EMIT_EVENT] chain instead.
3129
3131
  - EMIT_EVENT: { integrationId: uuid, eventPayload: object (Map<string,unknown>, ≥1 entry) } eventPayload is passed through to the integration provider as-is. Domain-specific keys (couponId, ticketId, etc.) are routed by the provider, not validated by the engine.
3130
3132
  - BLOCK: { reason: string }
3131
3133
  - EMIT_NOTIFICATION: { integrationId: uuid, targetVar: string, notificationPayload: object (Map<string,unknown>, ≥1 entry) } targetVar identifies the recipient fact (e.g. phone_number / email / device_token). notificationPayload (channel, templateId, body, variables, etc.) is passed through to the provider.
@@ -3296,7 +3298,7 @@ function registerFactTools(server, callApi) {
3296
3298
  "lexq_facts_action_metadata",
3297
3299
  {
3298
3300
  title: "Get Action Runtime Fact Metadata",
3299
- description: "Retrieve runtime Facts metadata for each Action type. Shows which Facts are required as input, produced as output, or consumed at runtime by each Action (MUTATE_FACT, INCREMENT_FACT, EMIT_EVENT, BLOCK, EMIT_NOTIFICATION, EMIT_WEBHOOK, SET_FACT, ADD_TAG). Use this BEFORE designing rules to understand which Action mutates which fact (e.g., MUTATE_FACT mutates the refVar fact and auto-generates {fact_name}__delta in generatedVariables). Data is static and changes only on engine deployment \u2014 safe to cache in-session.",
3301
+ description: "Retrieve runtime fact requirements per Action type. For each Action, shows which input facts must be present in the execution payload (e.g. MUTATE_FACT requires its refVar fact; INCREMENT_FACT always requires targetVar, plus refVar when method is PERCENTAGE). A required fact absent at runtime throws \u2014 the engine never defaults to 0. Facts are supplied as input or written by a prior action in the same rule; Actions never create a fact from nothing. Static data, safe to cache in-session.",
3300
3302
  inputSchema: {}
3301
3303
  },
3302
3304
  async () => callApi("GET", "schema/action-metadata")
@@ -294,7 +294,7 @@ function registerRuleTools(server, callApi) {
294
294
 
295
295
  Action parameter schemas:
296
296
  - MUTATE_FACT: { refVar: string, operator: "ASSIGN"|"ADD"|"SUB"|"MUL"|"DIV", method: "PERCENTAGE"|"AMOUNT", rate?: number (when PERCENTAGE), value?: number (when AMOUNT), rounding?: RoundingOption } Constraints: DIV + PERCENTAGE is invalid (use MUL with rate/100 inverse). DIV + AMOUNT requires value !== 0.
297
- - INCREMENT_FACT: { targetVar: string, method: "PERCENTAGE"|"AMOUNT", refVar?: string (required when PERCENTAGE), rate?: number (when PERCENTAGE), value?: number (when AMOUNT), rounding?: RoundingOption } Note: external system call (e.g. point system sync) is NOT a primitive responsibility. Compose [INCREMENT_FACT, EMIT_EVENT] chain instead.
297
+ - INCREMENT_FACT: { targetVar: string, method: "PERCENTAGE"|"AMOUNT", refVar?: string (required when PERCENTAGE), rate?: number (when PERCENTAGE), value?: number (when AMOUNT), rounding?: RoundingOption } targetVar (accumulation target) must exist at execution; refVar (PERCENTAGE source) must exist when method is PERCENTAGE. Each is supplied as an input fact or written by a prior action in this rule — a missing required fact throws (no 0 default). Note: external system call (e.g. point system sync) is NOT a primitive responsibility. Compose [INCREMENT_FACT, EMIT_EVENT] chain instead.
298
298
  - EMIT_EVENT: { integrationId: uuid, eventPayload: object (Map<string,unknown>, ≥1 entry) } eventPayload is passed through to the integration provider as-is. Domain-specific keys (couponId, ticketId, etc.) are routed by the provider, not validated by the engine.
299
299
  - BLOCK: { reason: string }
300
300
  - EMIT_NOTIFICATION: { integrationId: uuid, targetVar: string, notificationPayload: object (Map<string,unknown>, ≥1 entry) } targetVar identifies the recipient fact (e.g. phone_number / email / device_token). notificationPayload (channel, templateId, body, variables, etc.) is passed through to the provider.
@@ -465,7 +465,7 @@ function registerFactTools(server, callApi) {
465
465
  "lexq_facts_action_metadata",
466
466
  {
467
467
  title: "Get Action Runtime Fact Metadata",
468
- description: "Retrieve runtime Facts metadata for each Action type. Shows which Facts are required as input, produced as output, or consumed at runtime by each Action (MUTATE_FACT, INCREMENT_FACT, EMIT_EVENT, BLOCK, EMIT_NOTIFICATION, EMIT_WEBHOOK, SET_FACT, ADD_TAG). Use this BEFORE designing rules to understand which Action mutates which fact (e.g., MUTATE_FACT mutates the refVar fact and auto-generates {fact_name}__delta in generatedVariables). Data is static and changes only on engine deployment \u2014 safe to cache in-session.",
468
+ description: "Retrieve runtime fact requirements per Action type. For each Action, shows which input facts must be present in the execution payload (e.g. MUTATE_FACT requires its refVar fact; INCREMENT_FACT always requires targetVar, plus refVar when method is PERCENTAGE). A required fact absent at runtime throws \u2014 the engine never defaults to 0. Facts are supplied as input or written by a prior action in the same rule; Actions never create a fact from nothing. Static data, safe to cache in-session.",
469
469
  inputSchema: {}
470
470
  },
471
471
  async () => callApi("GET", "schema/action-metadata")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lexq/cli",
3
- "version": "0.1.28",
3
+ "version": "0.1.30",
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": {
@@ -13,7 +13,7 @@ simulation** and **A/B testing** for rule versions.
13
13
  ```bash
14
14
  # Store your API key (persisted at ~/.lexq/config.json)
15
15
  lexq auth login
16
- # Enter your API Key: sk_live_xxxxxxxxxxxxx
16
+ # Enter your API Key: lexq_us_xxxxxxxxxxxxx
17
17
 
18
18
  # Verify authentication
19
19
  lexq auth whoami
@@ -22,7 +22,7 @@ lexq auth whoami
22
22
  The API key is passed as `X-API-KEY` header on every request. You can also override per-command:
23
23
 
24
24
  ```bash
25
- lexq groups list --api-key sk_live_override_key
25
+ lexq groups list --api-key lexq_us_override_key
26
26
  ```
27
27
 
28
28
  **Base URL:** `https://api.lexq.io/api/v1/partners` (default). Override with `--base-url`.