@lexq/cli 0.1.53 → 0.1.54

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/AGENTS.md CHANGED
@@ -129,8 +129,9 @@ Place this file in the project root. The IDE will auto-discover it.
129
129
 
130
130
  ### Claude Code
131
131
 
132
- Reads this file via the root `CLAUDE.md` pointer. No separate context file this document and `skills/` are the whole
133
- guide.
132
+ Reads this file through the root `CLAUDE.md`, which is a one-line import rather than a copy. There is no
133
+ Claude-specific document to keep in sync. The CLI guide is this file plus `skills/`; `CONTEXT.md` covers platform
134
+ architecture separately and ships alongside.
134
135
 
135
136
  ### Gemini CLI
136
137
 
package/dist/index.js CHANGED
@@ -2359,6 +2359,7 @@ import "commander";
2359
2359
  import dedent9 from "dedent";
2360
2360
 
2361
2361
  // src/types/enums.ts
2362
+ var ValueType = ["STRING", "NUMBER", "BOOLEAN", "LIST_STRING", "LIST_NUMBER"];
2362
2363
  var ConflictResolutionMode = ["NONE", "EXCLUSIVE", "MAX_N"];
2363
2364
  var ConflictResolutionStrategy = ["HIGHEST_PRIORITY"];
2364
2365
  var ProfileCacheState = ["HIT", "MISS"];
@@ -3722,6 +3723,7 @@ import { z as z4 } from "zod";
3722
3723
  var FACT_KEY_PATTERN = /^[a-zA-Z][a-zA-Z0-9_]*$/;
3723
3724
 
3724
3725
  // src/mcp/tools/facts.ts
3726
+ var VALUE_TYPES = ValueType;
3725
3727
  function registerFactTools(server, callApi) {
3726
3728
  server.registerTool(
3727
3729
  "lexq_facts_list",
@@ -3748,7 +3750,7 @@ function registerFactTools(server, callApi) {
3748
3750
  inputSchema: {
3749
3751
  key: z4.string().regex(FACT_KEY_PATTERN).describe("Variable key. Any casing; must start with a letter."),
3750
3752
  name: z4.string().describe("Display name"),
3751
- type: z4.enum(["STRING", "NUMBER", "BOOLEAN", "LIST_STRING", "LIST_NUMBER"]).describe("Value type"),
3753
+ type: z4.enum(VALUE_TYPES).describe("Value type"),
3752
3754
  description: z4.string().optional().describe("Description"),
3753
3755
  isRequired: z4.boolean().default(false).describe("Whether this fact is required for rule evaluation"),
3754
3756
  isPii: z4.boolean().default(false).describe(
@@ -3762,11 +3764,14 @@ function registerFactTools(server, callApi) {
3762
3764
  "lexq_facts_update",
3763
3765
  {
3764
3766
  title: "Update Fact Definition",
3765
- description: "Update a fact definition. Key and type cannot be changed. Only provided fields are updated. System facts only allow name, description, and PII changes.",
3767
+ description: "Update a fact definition. The key is immutable. The type can change only while no rule references the fact; if any does, the call fails with FD-007 and reports the count. Only the fields you send are changed. System facts accept name, description, and PII only.",
3766
3768
  inputSchema: {
3767
3769
  factId: z4.string().uuid().describe("Fact definition ID"),
3768
3770
  name: z4.string().optional().describe("Display name"),
3769
3771
  description: z4.string().optional().describe("Description"),
3772
+ type: z4.enum(VALUE_TYPES).optional().describe(
3773
+ "Value type. Omit to leave it unchanged. Changing it fails with FD-007 while any rule references the fact."
3774
+ ),
3770
3775
  isRequired: z4.boolean().optional().describe("Required flag"),
3771
3776
  isPii: z4.boolean().optional().describe("PII flag \u2014 enables/disables masking (changeable even on system facts)")
3772
3777
  }
@@ -3777,7 +3782,7 @@ function registerFactTools(server, callApi) {
3777
3782
  "lexq_facts_delete",
3778
3783
  {
3779
3784
  title: "Delete Fact Definition",
3780
- description: "Delete a fact definition. System facts cannot be deleted.",
3785
+ description: "Delete a fact definition. System facts cannot be deleted. Neither can a fact that any rule references: that call fails with FD-006 and reports the count. Remove the references first.",
3781
3786
  inputSchema: {
3782
3787
  factId: z4.string().uuid().describe("Fact definition ID")
3783
3788
  }
@@ -15,6 +15,7 @@ function registerStatusTools(server, callApi) {
15
15
  import { z } from "zod";
16
16
 
17
17
  // src/types/enums.ts
18
+ var ValueType = ["STRING", "NUMBER", "BOOLEAN", "LIST_STRING", "LIST_NUMBER"];
18
19
  var ConflictResolutionMode = ["NONE", "EXCLUSIVE", "MAX_N"];
19
20
  var ConflictResolutionStrategy = ["HIGHEST_PRIORITY"];
20
21
  var FailureStatus = ["PENDING", "RESOLVED", "IGNORED"];
@@ -514,6 +515,7 @@ import { z as z4 } from "zod";
514
515
  var FACT_KEY_PATTERN = /^[a-zA-Z][a-zA-Z0-9_]*$/;
515
516
 
516
517
  // src/mcp/tools/facts.ts
518
+ var VALUE_TYPES = ValueType;
517
519
  function registerFactTools(server, callApi) {
518
520
  server.registerTool(
519
521
  "lexq_facts_list",
@@ -540,7 +542,7 @@ function registerFactTools(server, callApi) {
540
542
  inputSchema: {
541
543
  key: z4.string().regex(FACT_KEY_PATTERN).describe("Variable key. Any casing; must start with a letter."),
542
544
  name: z4.string().describe("Display name"),
543
- type: z4.enum(["STRING", "NUMBER", "BOOLEAN", "LIST_STRING", "LIST_NUMBER"]).describe("Value type"),
545
+ type: z4.enum(VALUE_TYPES).describe("Value type"),
544
546
  description: z4.string().optional().describe("Description"),
545
547
  isRequired: z4.boolean().default(false).describe("Whether this fact is required for rule evaluation"),
546
548
  isPii: z4.boolean().default(false).describe(
@@ -554,11 +556,14 @@ function registerFactTools(server, callApi) {
554
556
  "lexq_facts_update",
555
557
  {
556
558
  title: "Update Fact Definition",
557
- description: "Update a fact definition. Key and type cannot be changed. Only provided fields are updated. System facts only allow name, description, and PII changes.",
559
+ description: "Update a fact definition. The key is immutable. The type can change only while no rule references the fact; if any does, the call fails with FD-007 and reports the count. Only the fields you send are changed. System facts accept name, description, and PII only.",
558
560
  inputSchema: {
559
561
  factId: z4.string().uuid().describe("Fact definition ID"),
560
562
  name: z4.string().optional().describe("Display name"),
561
563
  description: z4.string().optional().describe("Description"),
564
+ type: z4.enum(VALUE_TYPES).optional().describe(
565
+ "Value type. Omit to leave it unchanged. Changing it fails with FD-007 while any rule references the fact."
566
+ ),
562
567
  isRequired: z4.boolean().optional().describe("Required flag"),
563
568
  isPii: z4.boolean().optional().describe("PII flag \u2014 enables/disables masking (changeable even on system facts)")
564
569
  }
@@ -569,7 +574,7 @@ function registerFactTools(server, callApi) {
569
574
  "lexq_facts_delete",
570
575
  {
571
576
  title: "Delete Fact Definition",
572
- description: "Delete a fact definition. System facts cannot be deleted.",
577
+ description: "Delete a fact definition. System facts cannot be deleted. Neither can a fact that any rule references: that call fails with FD-006 and reports the count. Remove the references first.",
573
578
  inputSchema: {
574
579
  factId: z4.string().uuid().describe("Fact definition ID")
575
580
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lexq/cli",
3
- "version": "0.1.53",
3
+ "version": "0.1.54",
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": {
@@ -141,7 +141,7 @@ Prefixes you will encounter through the CLI:
141
141
  | `A-` | Auth | Invalid or missing API key |
142
142
  | `P-` | Policy group/version | Not found, wrong lifecycle state, already live |
143
143
  | `ACT-` | Action parameters | Missing or invalid action parameter |
144
- | `FD-` | Fact definitions | Duplicate key, system fact immutable |
144
+ | `FD-` | Fact definitions | Duplicate key, system fact immutable, fact still referenced by rules |
145
145
  | `AN-` | Analytics | Dry-run or simulation failure |
146
146
  | `FL-` | Failure logs | Log not found |
147
147
  | `WH-` | Webhook subscriptions | Invalid URL, delivery failure |