@lexq/cli 0.1.35 → 0.1.36

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
@@ -1144,14 +1144,15 @@ function registerFactCommands(program) {
1144
1144
  });
1145
1145
  if (format === "table") {
1146
1146
  printTable(
1147
- ["ID", "Key", "Name", "Type", "System", "Required"],
1147
+ ["ID", "Key", "Name", "Type", "System", "Required", "PII"],
1148
1148
  data.content.map((f) => [
1149
1149
  f.id,
1150
1150
  f.key,
1151
1151
  f.name,
1152
1152
  f.type,
1153
1153
  f.isSystem ? "\u2713" : "\u2013",
1154
- f.isRequired ? "\u2713" : "\u2013"
1154
+ f.isRequired ? "\u2713" : "\u2013",
1155
+ f.isPii ? "\u2713" : "\u2013"
1155
1156
  ]),
1156
1157
  { truncate: 28 }
1157
1158
  );
@@ -1211,7 +1212,7 @@ ${data.length} unregistered`);
1211
1212
  process.exit(1);
1212
1213
  }
1213
1214
  });
1214
- facts.command("create").description("Create a new fact definition").option("--key <key>", "Fact key (lowercase, underscores)").option("--name <n>", "Display name").option("--type <type>", "Value type: STRING, NUMBER, BOOLEAN, LIST_STRING, LIST_NUMBER").option("--description <desc>", "Description").option("--required", "Mark as required", false).option("--json <body>", "Full request body as JSON (overrides other options)").addHelpText(
1215
+ facts.command("create").description("Create a new fact definition").option("--key <key>", "Fact key (lowercase, underscores)").option("--name <n>", "Display name").option("--type <type>", "Value type: STRING, NUMBER, BOOLEAN, LIST_STRING, LIST_NUMBER").option("--description <desc>", "Description").option("--required", "Mark as required", false).option("--pii", "Mark as PII \u2014 value is masked on every read surface", false).option("--json <body>", "Full request body as JSON (overrides other options)").addHelpText(
1215
1216
  "after",
1216
1217
  dedent6`
1217
1218
 
@@ -1247,7 +1248,7 @@ ${data.length} unregistered`);
1247
1248
  process.exit(1);
1248
1249
  }
1249
1250
  });
1250
- facts.command("update").description("Update a fact definition").requiredOption("--id <factId>", "Fact definition ID").option("--name <n>", "Display name").option("--description <desc>", "Description").option("--required", "Mark as required").option("--no-required", "Mark as not required").option("--json <body>", "Full request body as JSON (overrides other options)").addHelpText(
1251
+ facts.command("update").description("Update a fact definition").requiredOption("--id <factId>", "Fact definition ID").option("--name <n>", "Display name").option("--description <desc>", "Description").option("--required", "Mark as required").option("--no-required", "Mark as not required").option("--pii", "Mark as PII (enables masking)").option("--no-pii", "Unmark as PII (disables masking \u2014 value becomes visible)").option("--json <body>", "Full request body as JSON (overrides other options)").addHelpText(
1251
1252
  "after",
1252
1253
  dedent6`
1253
1254
 
@@ -1334,7 +1335,8 @@ function buildCreateBody2(opts) {
1334
1335
  key: opts.key,
1335
1336
  name: opts.name,
1336
1337
  type: opts.type,
1337
- isRequired: opts.required === true
1338
+ isRequired: opts.required === true,
1339
+ isPii: opts.pii === true
1338
1340
  };
1339
1341
  if (opts.description) body.description = opts.description;
1340
1342
  return body;
@@ -1344,6 +1346,7 @@ function buildUpdateBody2(opts) {
1344
1346
  if (opts.name) body.name = opts.name;
1345
1347
  if (opts.description !== void 0) body.description = opts.description;
1346
1348
  if (typeof opts.required === "boolean") body.isRequired = opts.required;
1349
+ if (typeof opts.isPii === "boolean") body.isPii = opts.isPii;
1347
1350
  return body;
1348
1351
  }
1349
1352
 
@@ -3138,7 +3141,12 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
3138
3141
  function createCallApiFromConfig() {
3139
3142
  return async (method, path, opts) => {
3140
3143
  try {
3141
- const config = loadConfig();
3144
+ const stored = loadConfig();
3145
+ const config = {
3146
+ ...stored,
3147
+ baseUrl: process.env.PARTNER_BASE_URL ?? stored.baseUrl,
3148
+ apiKey: process.env.LEXQ_API_KEY ?? stored.apiKey
3149
+ };
3142
3150
  if (opts?.upload) {
3143
3151
  const url = new URL(
3144
3152
  path,
@@ -3611,7 +3619,7 @@ function registerFactTools(server, callApi) {
3611
3619
  "lexq_facts_list",
3612
3620
  {
3613
3621
  title: "List Fact Definitions",
3614
- description: "List all fact definitions (input variable schema). Shows key, type, and required status. Always check this before creating rules.",
3622
+ description: "List all fact definitions (input variable schema). Shows key, type, required, and PII status. Always check this before creating rules.",
3615
3623
  inputSchema: {
3616
3624
  page: z4.number().int().min(0).default(0).describe("Page number"),
3617
3625
  size: z4.number().int().min(1).max(100).default(20).describe("Page size"),
@@ -3634,7 +3642,10 @@ function registerFactTools(server, callApi) {
3634
3642
  name: z4.string().describe("Display name"),
3635
3643
  type: z4.enum(["STRING", "NUMBER", "BOOLEAN", "LIST_STRING", "LIST_NUMBER"]).describe("Value type"),
3636
3644
  description: z4.string().optional().describe("Description"),
3637
- isRequired: z4.boolean().default(false).describe("Whether this fact is required for rule evaluation")
3645
+ isRequired: z4.boolean().default(false).describe("Whether this fact is required for rule evaluation"),
3646
+ isPii: z4.boolean().default(false).describe(
3647
+ "Mark as PII \u2014 masked on every read surface, revealable only in the console (audited)"
3648
+ )
3638
3649
  }
3639
3650
  },
3640
3651
  async (args) => callApi("POST", "schema/facts", { body: args })
@@ -3643,12 +3654,13 @@ function registerFactTools(server, callApi) {
3643
3654
  "lexq_facts_update",
3644
3655
  {
3645
3656
  title: "Update Fact Definition",
3646
- description: "Update a fact definition. Key and type cannot be changed. Only provided fields are updated. System facts only allow name and description changes.",
3657
+ 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.",
3647
3658
  inputSchema: {
3648
3659
  factId: z4.string().uuid().describe("Fact definition ID"),
3649
3660
  name: z4.string().optional().describe("Display name"),
3650
3661
  description: z4.string().optional().describe("Description"),
3651
- isRequired: z4.boolean().optional().describe("Required flag")
3662
+ isRequired: z4.boolean().optional().describe("Required flag"),
3663
+ isPii: z4.boolean().optional().describe("PII flag \u2014 enables/disables masking (changeable even on system facts)")
3652
3664
  }
3653
3665
  },
3654
3666
  async ({ factId, ...body }) => callApi("PUT", `schema/facts/${factId}`, { body })
@@ -432,7 +432,7 @@ function registerFactTools(server, callApi) {
432
432
  "lexq_facts_list",
433
433
  {
434
434
  title: "List Fact Definitions",
435
- description: "List all fact definitions (input variable schema). Shows key, type, and required status. Always check this before creating rules.",
435
+ description: "List all fact definitions (input variable schema). Shows key, type, required, and PII status. Always check this before creating rules.",
436
436
  inputSchema: {
437
437
  page: z4.number().int().min(0).default(0).describe("Page number"),
438
438
  size: z4.number().int().min(1).max(100).default(20).describe("Page size"),
@@ -455,7 +455,10 @@ function registerFactTools(server, callApi) {
455
455
  name: z4.string().describe("Display name"),
456
456
  type: z4.enum(["STRING", "NUMBER", "BOOLEAN", "LIST_STRING", "LIST_NUMBER"]).describe("Value type"),
457
457
  description: z4.string().optional().describe("Description"),
458
- isRequired: z4.boolean().default(false).describe("Whether this fact is required for rule evaluation")
458
+ isRequired: z4.boolean().default(false).describe("Whether this fact is required for rule evaluation"),
459
+ isPii: z4.boolean().default(false).describe(
460
+ "Mark as PII \u2014 masked on every read surface, revealable only in the console (audited)"
461
+ )
459
462
  }
460
463
  },
461
464
  async (args) => callApi("POST", "schema/facts", { body: args })
@@ -464,12 +467,13 @@ function registerFactTools(server, callApi) {
464
467
  "lexq_facts_update",
465
468
  {
466
469
  title: "Update Fact Definition",
467
- description: "Update a fact definition. Key and type cannot be changed. Only provided fields are updated. System facts only allow name and description changes.",
470
+ 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.",
468
471
  inputSchema: {
469
472
  factId: z4.string().uuid().describe("Fact definition ID"),
470
473
  name: z4.string().optional().describe("Display name"),
471
474
  description: z4.string().optional().describe("Description"),
472
- isRequired: z4.boolean().optional().describe("Required flag")
475
+ isRequired: z4.boolean().optional().describe("Required flag"),
476
+ isPii: z4.boolean().optional().describe("PII flag \u2014 enables/disables masking (changeable even on system facts)")
473
477
  }
474
478
  },
475
479
  async ({ factId, ...body }) => callApi("PUT", `schema/facts/${factId}`, { body })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lexq/cli",
3
- "version": "0.1.35",
3
+ "version": "0.1.36",
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": {