@lexq/cli 0.1.39 → 0.1.41

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.
@@ -13,6 +13,24 @@ function registerStatusTools(server, callApi) {
13
13
 
14
14
  // src/mcp/tools/groups.ts
15
15
  import { z } from "zod";
16
+
17
+ // src/types/enums.ts
18
+ var ConflictResolutionMode = ["NONE", "EXCLUSIVE", "MAX_N"];
19
+ var ConflictResolutionStrategy = ["HIGHEST_PRIORITY"];
20
+ var FailureStatus = ["PENDING", "RESOLVED", "IGNORED"];
21
+ var FailureAction = ["IGNORE", "RESOLVE"];
22
+ var TaskType = ["PLATFORM_WEBHOOK", "SCHEDULED_DEPLOYMENT"];
23
+ var PlatformEventType = [
24
+ "VERSION_PUBLISHED",
25
+ "DEPLOYED",
26
+ "ROLLED_BACK",
27
+ "UNDEPLOYED",
28
+ "DEPLOY_SCHEDULED",
29
+ "DEPLOY_SCHEDULE_CANCELED"
30
+ ];
31
+ var WebhookPayloadFormat = ["GENERIC", "SLACK"];
32
+
33
+ // src/mcp/tools/groups.ts
16
34
  function registerGroupTools(server, callApi) {
17
35
  server.registerTool(
18
36
  "lexq_groups_list",
@@ -42,8 +60,8 @@ function registerGroupTools(server, callApi) {
42
60
  inputSchema: {
43
61
  name: z.string().describe("Group name (unique among non-ARCHIVED)"),
44
62
  description: z.string().optional().describe("Group description"),
45
- activationMode: z.enum(["NONE", "EXCLUSIVE", "MAX_N"]).optional().describe("Conflict resolution mode"),
46
- activationStrategy: z.enum(["FIRST_MATCH", "HIGHEST_PRIORITY", "MAX_BENEFIT"]).optional().describe("Strategy when mode is EXCLUSIVE or MAX_N"),
63
+ activationMode: z.enum(ConflictResolutionMode).optional().describe("Conflict resolution mode"),
64
+ activationStrategy: z.enum(ConflictResolutionStrategy).optional().describe("Strategy when mode is EXCLUSIVE or MAX_N"),
47
65
  executionLimit: z.number().int().min(1).optional().describe("Max rule executions (required when mode is MAX_N)"),
48
66
  activationGroup: z.string().optional().describe("Activation group name")
49
67
  }
@@ -71,8 +89,8 @@ function registerGroupTools(server, callApi) {
71
89
  description: z.string().optional().describe("New description"),
72
90
  status: z.enum(["ACTIVE", "DISABLED"]).optional().describe("Status (DISABLED = emergency stop)"),
73
91
  activationGroup: z.string().optional().describe("Activation group (Execution Group) cluster key"),
74
- activationMode: z.enum(["NONE", "EXCLUSIVE", "MAX_N"]).optional().describe("Conflict resolution mode"),
75
- activationStrategy: z.enum(["FIRST_MATCH", "HIGHEST_PRIORITY", "MAX_BENEFIT"]).optional().describe("Strategy"),
92
+ activationMode: z.enum(ConflictResolutionMode).optional().describe("Conflict resolution mode"),
93
+ activationStrategy: z.enum(ConflictResolutionStrategy).optional().describe("Strategy"),
76
94
  executionLimit: z.number().int().min(1).optional().describe("Max rule executions")
77
95
  }
78
96
  },
@@ -323,26 +341,54 @@ function registerRuleTools(server, callApi) {
323
341
  defined (non-blocking, version-wide) — use it to decide what to register.
324
342
 
325
343
  Condition: { type: "SINGLE", field, operator, value, valueType } or { type: "GROUP", operator: "AND"|"OR", children: [...] }
326
- Operators: EQUALS, NOT_EQUALS, GREATER_THAN, GREATER_THAN_OR_EQUAL, LESS_THAN, LESS_THAN_OR_EQUAL, CONTAINS, IN, NOT_IN
327
344
  Value types: STRING, NUMBER, BOOLEAN, LIST_STRING, LIST_NUMBER
345
+
346
+ Operators are constrained by the LEFT fact's type (from lexq_facts_list). Using one outside
347
+ its type is rejected by the server — check the fact type before choosing an operator.
348
+ - STRING fact: EQUALS, NOT_EQUALS, CONTAINS, IN, NOT_IN
349
+ - NUMBER fact: EQUALS, NOT_EQUALS, GREATER_THAN, GREATER_THAN_OR_EQUAL, LESS_THAN, LESS_THAN_OR_EQUAL, IN, NOT_IN
350
+ - BOOLEAN fact: EQUALS, NOT_EQUALS
351
+ - LIST_* fact: HAS_ANY, HAS_ALL, HAS_NONE (only these)
352
+
353
+ HAS_* query list-typed facts. Value is always an array whose element type matches the fact:
354
+ - HAS_ANY: fact has at least one of the given values
355
+ - HAS_ALL: fact has all of the given values
356
+ - HAS_NONE: fact has none of the given values
357
+ Example: { "type": "SINGLE", "field": "user_tags", "operator": "HAS_ANY", "value": ["VIP","GOLD"], "valueType": "LIST_STRING" }
358
+
359
+ Do NOT use CONTAINS on a list fact — CONTAINS is substring match on STRING facts only.
360
+ IN is the mirror of HAS_*: IN takes a scalar fact with a list value; HAS_* takes lists on both sides.
328
361
 
329
362
  Actions: [{ type, parameters }]
330
363
 
331
364
  Action parameter schemas:
332
- - 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.
333
- - 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.
334
- - 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.
335
- - BLOCK: { reason: string }
336
- - 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.
337
- - EMIT_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).
338
- Platform examples:
339
- Slack: { "text": "Rule {{ruleName}} fired{{fact.customer_tier}}" }
340
- Discord: { "content": "Rule {{ruleName}} fired {{fact.customer_tier}}" }
341
- Generic: { "event": "rule_matched", "rule": "{{ruleName}}", "amount": "{{output.payment_amount}}" }
342
- - SET_FACT: { key: string, value: string|number|boolean }
343
- - ADD_TAG: { tag: string, targetVar: string }
344
-
345
- RoundingOption (optional, MUTATE_FACT / INCREMENT_FACT only): { scale: integer (0..16), mode?: "HALF_UP"|"HALF_DOWN"|"HALF_EVEN"|"FLOOR"|"CEILING"|"DOWN"|"UP" } mode defaults to HALF_UP. When omitted, calculator output is preserved at full precision (lossless).
365
+ - MUTATE_FACT: { targetVar: string, operator: "ASSIGN"|"ADD"|"SUB"|"MUL"|"DIV", method: "PERCENTAGE"|"AMOUNT", operand: number, refVar?: string, rounding?: RoundingOption }
366
+ targetVar is the fact this action reads and writes. It must exist in facts at execution
367
+ time as a number supplied as an input fact or written by a prior action in this rule.
368
+ A missing required fact throws (no 0 default).
369
+ operand is the arithmetic operand; the unit is dictated by method (percent when
370
+ PERCENTAGE, absolute amount when AMOUNT). Ranges are not constrained negative values
371
+ and >100 percentages are valid (refunds, surcharges).
372
+ refVar is the base for percentage calculation and is OPTIONAL omit it to use targetVar
373
+ itself. It is only meaningful in PERCENTAGE × {ASSIGN, ADD, SUB}; specifying it in any
374
+ other cell is an error. Use it when the base differs from the target, e.g.
375
+ "points += order_total × 5%" → { targetVar: "points", refVar: "order_total",
376
+ operator: "ADD", method: "PERCENTAGE", operand: 5 }.
377
+ operator × method matrix:
378
+ ASSIGN targetVar = operand | targetVar = refVar × operand/100
379
+ ADD targetVar += operand | targetVar += refVar × operand/100
380
+ SUB targetVar -= operand | targetVar -= refVar × operand/100
381
+ MUL targetVar *= operand | targetVar *= (operand/100 + 1)
382
+ DIV targetVar /= operand | invalid
383
+ Constraints: DIV + PERCENTAGE is invalid (use MUL with the inverse). DIV + AMOUNT
384
+ requires operand !== 0.
385
+ - SET_FACT: { targetVar: string, value: string|number|boolean } Creates the fact if absent
386
+ — this is the only action that does. MUTATE_FACT requires the target to already exist.
387
+ - BLOCK: { reason: string } Records a rejection decision. It does NOT halt rule execution —
388
+ subsequent actions and subsequent winning rules still run. Enforcement is the caller's
389
+ responsibility; the decision surfaces as the is_blocked fact.
390
+
391
+ RoundingOption (optional, MUTATE_FACT only): { scale: integer (0..16), mode?: "HALF_UP"|"HALF_DOWN"|"HALF_EVEN"|"FLOOR"|"CEILING"|"DOWN"|"UP" } mode defaults to HALF_UP. When omitted, calculator output is preserved at full precision (lossless).
346
392
  `,
347
393
  inputSchema: {
348
394
  groupId: z3.string().uuid().describe("Policy group ID"),
@@ -505,7 +551,7 @@ function registerFactTools(server, callApi) {
505
551
  "lexq_facts_action_metadata",
506
552
  {
507
553
  title: "Get Action Runtime Fact Metadata",
508
- 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.",
554
+ description: "Retrieve runtime fact requirements per Action type. For each Action, shows which input facts must be present in the execution payload \u2014 e.g. MUTATE_FACT always requires its targetVar fact, plus refVar when one is specified. The factRequired flag describes the FACT, not the parameter: refVar is an optional parameter, but if you specify it the named fact must exist. 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; only SET_FACT creates a fact from nothing. Static data, safe to cache in-session.",
509
555
  inputSchema: {}
510
556
  },
511
557
  async () => callApi("GET", "schema/action-metadata")
@@ -714,14 +760,13 @@ function registerAnalyticsTools(server, callApi) {
714
760
  inputSchema: {
715
761
  versionId: z6.string().uuid().describe("Policy version ID to test against"),
716
762
  facts: z6.string().describe('JSON string of facts object, e.g. {"payment_amount":100000}'),
717
- includeDebugInfo: z6.boolean().default(true).describe("Include execution and decision traces"),
718
- mockExternalCalls: z6.boolean().default(true).describe("Mock external integration calls")
763
+ includeDebugInfo: z6.boolean().default(true).describe("Include execution and decision traces")
719
764
  }
720
765
  },
721
- async ({ versionId, facts, includeDebugInfo, mockExternalCalls }) => {
766
+ async ({ versionId, facts, includeDebugInfo }) => {
722
767
  const parsedFacts = JSON.parse(facts);
723
768
  return callApi("POST", `analytics/dry-run/versions/${versionId}`, {
724
- body: { facts: parsedFacts, includeDebugInfo, mockExternalCalls }
769
+ body: { facts: parsedFacts, includeDebugInfo }
725
770
  });
726
771
  }
727
772
  );
@@ -1135,135 +1180,26 @@ function registerProvenanceTools(server, callApi) {
1135
1180
  );
1136
1181
  }
1137
1182
 
1138
- // src/mcp/tools/integrations.ts
1139
- import { z as z11 } from "zod";
1140
- function registerIntegrationTools(server, callApi) {
1141
- server.registerTool(
1142
- "lexq_integrations_list",
1143
- {
1144
- title: "List Integrations",
1145
- description: "List all external integrations (webhooks, CRM, notification, etc.).",
1146
- inputSchema: {
1147
- page: z11.number().int().min(0).default(0).describe("Page number"),
1148
- size: z11.number().int().min(1).max(100).default(20).describe("Page size"),
1149
- type: z11.enum(["COUPON", "POINT", "NOTIFICATION", "CRM", "MESSENGER", "WEBHOOK"]).optional().describe("Filter by integration type")
1150
- }
1151
- },
1152
- async ({ page, size, type }) => {
1153
- const params = paginationParams(page, size);
1154
- if (type) params.type = type;
1155
- return callApi("GET", "integrations", { params });
1156
- }
1157
- );
1158
- server.registerTool(
1159
- "lexq_integrations_get",
1160
- {
1161
- title: "Get Integration",
1162
- description: "Get integration detail by ID.",
1163
- inputSchema: {
1164
- integrationId: z11.string().uuid().describe("Integration ID")
1165
- }
1166
- },
1167
- async ({ integrationId }) => callApi("GET", `integrations/${integrationId}`)
1168
- );
1169
- server.registerTool(
1170
- "lexq_integrations_save",
1171
- {
1172
- title: "Save Integration",
1173
- description: "Create or update an integration. Provide id to update an existing one; omit id to create new. Types: COUPON, POINT, NOTIFICATION, CRM, MESSENGER, WEBHOOK.",
1174
- inputSchema: {
1175
- id: z11.string().uuid().optional().describe("Integration ID (omit to create, provide to update)"),
1176
- type: z11.enum(["COUPON", "POINT", "NOTIFICATION", "CRM", "MESSENGER", "WEBHOOK"]).describe("Integration type"),
1177
- name: z11.string().describe("Integration name"),
1178
- baseUrl: z11.string().describe("Base URL of the external service"),
1179
- credential: z11.string().optional().describe("API key or token for the service"),
1180
- additionalConfig: z11.string().optional().describe("JSON string of additional config key-value pairs"),
1181
- isActive: z11.boolean().default(true).describe("Whether the integration is active")
1182
- }
1183
- },
1184
- async ({ additionalConfig, ...rest }) => {
1185
- const body = { ...rest };
1186
- if (additionalConfig) body.additionalConfig = JSON.parse(additionalConfig);
1187
- return callApi("POST", "integrations", { body });
1188
- }
1189
- );
1190
- server.registerTool(
1191
- "lexq_integrations_delete",
1192
- {
1193
- title: "Delete Integration",
1194
- description: "Delete an integration by ID.",
1195
- inputSchema: {
1196
- integrationId: z11.string().uuid().describe("Integration ID")
1197
- }
1198
- },
1199
- async ({ integrationId }) => callApi("DELETE", `integrations/${integrationId}`)
1200
- );
1201
- server.registerTool(
1202
- "lexq_integrations_config_spec",
1203
- {
1204
- title: "Integration Config Spec",
1205
- description: "Show available integration types and their required configuration fields.",
1206
- inputSchema: {}
1207
- },
1208
- async () => callApi("GET", "integrations/config-spec")
1209
- );
1210
- }
1211
-
1212
- // src/mcp/tools/logs.ts
1213
- import { z as z12 } from "zod";
1214
-
1215
- // src/types/enums.ts
1216
- var FailureStatus = ["PENDING", "RESOLVED", "IGNORED"];
1217
- var FailureAction = ["RETRY", "IGNORE", "RESOLVE"];
1218
- var TaskCategory = ["INTEGRATION", "INTERNAL"];
1219
- var TaskType = [
1220
- // Integration
1221
- "COUPON_ISSUE",
1222
- "COUPON_CANCEL",
1223
- "POINT_EARN",
1224
- "POINT_USE",
1225
- "POINT_REFUND",
1226
- "NOTIFICATION_SEND",
1227
- "CRM_SYNC_USER",
1228
- "CRM_ADD_TAG",
1229
- "WEBHOOK_EXECUTE",
1230
- // Internal
1231
- "IMAGE_PROCESSING",
1232
- "DAILY_SETTLEMENT",
1233
- "PLATFORM_WEBHOOK",
1234
- "SCHEDULED_DEPLOYMENT"
1235
- ];
1236
- var PlatformEventType = [
1237
- "VERSION_PUBLISHED",
1238
- "DEPLOYED",
1239
- "ROLLED_BACK",
1240
- "UNDEPLOYED",
1241
- "DEPLOY_SCHEDULED",
1242
- "DEPLOY_SCHEDULE_CANCELED"
1243
- ];
1244
- var WebhookPayloadFormat = ["GENERIC", "SLACK"];
1245
-
1246
1183
  // src/mcp/tools/logs.ts
1184
+ import { z as z11 } from "zod";
1247
1185
  function registerLogTools(server, callApi) {
1248
1186
  server.registerTool(
1249
1187
  "lexq_logs_list",
1250
1188
  {
1251
1189
  title: "List Failure Logs",
1252
- description: "List system failure logs from background tasks (webhook calls, coupon issuance, etc.).",
1190
+ description: "List system failure logs from background tasks (platform event webhooks, scheduled deployments).",
1253
1191
  inputSchema: {
1254
- page: z12.number().int().min(0).default(0).describe("Page number"),
1255
- size: z12.number().int().min(1).max(100).default(20).describe("Page size"),
1256
- category: z12.enum(TaskCategory).optional().describe("Task category"),
1257
- taskType: z12.enum(TaskType).optional().describe("Task type"),
1258
- status: z12.enum(FailureStatus).optional().describe("Log status"),
1259
- keyword: z12.string().optional().describe("Search in refId, refSubId, errorMessage"),
1260
- startDate: z12.string().optional().describe("Start date (yyyy-MM-dd)"),
1261
- endDate: z12.string().optional().describe("End date (yyyy-MM-dd)")
1192
+ page: z11.number().int().min(0).default(0).describe("Page number"),
1193
+ size: z11.number().int().min(1).max(100).default(20).describe("Page size"),
1194
+ taskType: z11.enum(TaskType).optional().describe("Task type"),
1195
+ status: z11.enum(FailureStatus).optional().describe("Log status"),
1196
+ keyword: z11.string().optional().describe("Search in refId, refSubId, errorMessage"),
1197
+ startDate: z11.string().optional().describe("Start date (yyyy-MM-dd)"),
1198
+ endDate: z11.string().optional().describe("End date (yyyy-MM-dd)")
1262
1199
  }
1263
1200
  },
1264
- async ({ page, size, category, taskType, status, keyword, startDate, endDate }) => {
1201
+ async ({ page, size, taskType, status, keyword, startDate, endDate }) => {
1265
1202
  const params = paginationParams(page, size);
1266
- if (category) params.category = category;
1267
1203
  if (taskType) params.taskType = taskType;
1268
1204
  if (status) params.status = status;
1269
1205
  if (keyword) params.keyword = keyword;
@@ -1278,7 +1214,7 @@ function registerLogTools(server, callApi) {
1278
1214
  title: "Get Failure Log",
1279
1215
  description: "Get failure log detail by ID.",
1280
1216
  inputSchema: {
1281
- logId: z12.string().uuid().describe("Failure log ID")
1217
+ logId: z11.string().uuid().describe("Failure log ID")
1282
1218
  }
1283
1219
  },
1284
1220
  async ({ logId }) => callApi("GET", `failure-logs/${logId}`)
@@ -1287,10 +1223,10 @@ function registerLogTools(server, callApi) {
1287
1223
  "lexq_logs_action",
1288
1224
  {
1289
1225
  title: "Process Failure Log",
1290
- description: "Process a single failure log: RETRY (re-execute with original payload), RESOLVE (mark as manually fixed), or IGNORE (skip intentionally).",
1226
+ description: "Process a single failure log: RESOLVE (mark as manually fixed) or IGNORE (skip intentionally).",
1291
1227
  inputSchema: {
1292
- logId: z12.string().uuid().describe("Failure log ID"),
1293
- action: z12.enum(FailureAction).describe("Action to take")
1228
+ logId: z11.string().uuid().describe("Failure log ID"),
1229
+ action: z11.enum(FailureAction).describe("Action to take")
1294
1230
  }
1295
1231
  },
1296
1232
  async ({ logId, action }) => callApi("POST", `failure-logs/${logId}/actions`, {
@@ -1303,8 +1239,8 @@ function registerLogTools(server, callApi) {
1303
1239
  title: "Bulk Process Failure Logs",
1304
1240
  description: "Process multiple failure logs at once. Provide an array of log IDs and the action.",
1305
1241
  inputSchema: {
1306
- logIds: z12.array(z12.string().uuid()).describe("Array of failure log IDs"),
1307
- action: z12.enum(FailureAction).describe("Action to apply to all logs")
1242
+ logIds: z11.array(z11.string().uuid()).describe("Array of failure log IDs"),
1243
+ action: z11.enum(FailureAction).describe("Action to apply to all logs")
1308
1244
  }
1309
1245
  },
1310
1246
  async ({ logIds, action }) => callApi("POST", "failure-logs/bulk-actions", {
@@ -1314,7 +1250,7 @@ function registerLogTools(server, callApi) {
1314
1250
  }
1315
1251
 
1316
1252
  // src/mcp/tools/webhook-subscriptions.ts
1317
- import { z as z13 } from "zod";
1253
+ import { z as z12 } from "zod";
1318
1254
  function registerWebhookSubscriptionTools(server, callApi) {
1319
1255
  server.registerTool(
1320
1256
  "lexq_webhook_subscriptions_list",
@@ -1322,8 +1258,8 @@ function registerWebhookSubscriptionTools(server, callApi) {
1322
1258
  title: "List Webhook Subscriptions",
1323
1259
  description: "List platform event webhook subscriptions. These receive deployment lifecycle notifications (publish, deploy, rollback, undeploy).",
1324
1260
  inputSchema: {
1325
- page: z13.number().int().min(0).default(0).describe("Page number"),
1326
- size: z13.number().int().min(1).max(100).default(20).describe("Page size")
1261
+ page: z12.number().int().min(0).default(0).describe("Page number"),
1262
+ size: z12.number().int().min(1).max(100).default(20).describe("Page size")
1327
1263
  }
1328
1264
  },
1329
1265
  async ({ page, size }) => {
@@ -1337,7 +1273,7 @@ function registerWebhookSubscriptionTools(server, callApi) {
1337
1273
  title: "Get Webhook Subscription",
1338
1274
  description: "Get webhook subscription detail by ID.",
1339
1275
  inputSchema: {
1340
- id: z13.string().uuid().describe("Webhook subscription ID")
1276
+ id: z12.string().uuid().describe("Webhook subscription ID")
1341
1277
  }
1342
1278
  },
1343
1279
  async ({ id }) => callApi("GET", `webhook-subscriptions/${id}`)
@@ -1348,13 +1284,13 @@ function registerWebhookSubscriptionTools(server, callApi) {
1348
1284
  title: "Save Webhook Subscription",
1349
1285
  description: 'Create or update a webhook subscription. Omit id to create, provide id to update. Events: VERSION_PUBLISHED, DEPLOYED, ROLLED_BACK, UNDEPLOYED. Formats: GENERIC (full JSON), SLACK ({"text": "..."}).',
1350
1286
  inputSchema: {
1351
- id: z13.string().uuid().optional().describe("Subscription ID (omit to create, provide to update)"),
1352
- name: z13.string().min(1).describe("Subscription name (unique per tenant)"),
1353
- webhookUrl: z13.string().url().describe("Webhook endpoint URL"),
1354
- subscribedEvents: z13.array(z13.enum(PlatformEventType)).min(1).describe("Events to subscribe to"),
1355
- payloadFormat: z13.enum(WebhookPayloadFormat).optional().default("GENERIC").describe("Payload format"),
1356
- secret: z13.string().optional().describe("HMAC-SHA256 signing secret"),
1357
- isActive: z13.boolean().optional().default(true).describe("Whether the subscription is active")
1287
+ id: z12.string().uuid().optional().describe("Subscription ID (omit to create, provide to update)"),
1288
+ name: z12.string().min(1).describe("Subscription name (unique per tenant)"),
1289
+ webhookUrl: z12.string().url().describe("Webhook endpoint URL"),
1290
+ subscribedEvents: z12.array(z12.enum(PlatformEventType)).min(1).describe("Events to subscribe to"),
1291
+ payloadFormat: z12.enum(WebhookPayloadFormat).optional().default("GENERIC").describe("Payload format"),
1292
+ secret: z12.string().optional().describe("HMAC-SHA256 signing secret"),
1293
+ isActive: z12.boolean().optional().default(true).describe("Whether the subscription is active")
1358
1294
  }
1359
1295
  },
1360
1296
  async ({ ...body }) => callApi("POST", "webhook-subscriptions", { body })
@@ -1365,7 +1301,7 @@ function registerWebhookSubscriptionTools(server, callApi) {
1365
1301
  title: "Delete Webhook Subscription",
1366
1302
  description: "Delete a webhook subscription by ID.",
1367
1303
  inputSchema: {
1368
- id: z13.string().uuid().describe("Webhook subscription ID")
1304
+ id: z12.string().uuid().describe("Webhook subscription ID")
1369
1305
  }
1370
1306
  },
1371
1307
  async ({ id }) => callApi("DELETE", `webhook-subscriptions/${id}`)
@@ -1376,7 +1312,7 @@ function registerWebhookSubscriptionTools(server, callApi) {
1376
1312
  title: "Test Webhook Subscription",
1377
1313
  description: "Send a test event to verify webhook connectivity. Returns the HTTP status code and success/failure message.",
1378
1314
  inputSchema: {
1379
- id: z13.string().uuid().describe("Webhook subscription ID")
1315
+ id: z12.string().uuid().describe("Webhook subscription ID")
1380
1316
  }
1381
1317
  },
1382
1318
  async ({ id }) => callApi("POST", `webhook-subscriptions/${id}/test`)
@@ -1384,7 +1320,7 @@ function registerWebhookSubscriptionTools(server, callApi) {
1384
1320
  }
1385
1321
 
1386
1322
  // src/mcp/tools/domain-templates.ts
1387
- import { z as z14 } from "zod";
1323
+ import { z as z13 } from "zod";
1388
1324
  function registerDomainTemplateTools(server, callApi) {
1389
1325
  server.registerTool(
1390
1326
  "lexq_domain_templates_list",
@@ -1401,7 +1337,7 @@ function registerDomainTemplateTools(server, callApi) {
1401
1337
  title: "Preview Domain Template",
1402
1338
  description: "Preview exactly what a domain template will provision before applying it: the fact definitions it registers, the sample rules it creates, and an apply plan. This is a read-only dry run \u2014 nothing is created. Only ACTIVE templates can be previewed.",
1403
1339
  inputSchema: {
1404
- template: z14.string().describe(
1340
+ template: z13.string().describe(
1405
1341
  "Domain template key (e.g. ECOMMERCE). Use lexq_domain_templates_list to see available keys \u2014 currently only ECOMMERCE is ACTIVE."
1406
1342
  )
1407
1343
  }
@@ -1414,8 +1350,8 @@ function registerDomainTemplateTools(server, callApi) {
1414
1350
  title: "Apply Domain Template",
1415
1351
  description: "Apply a domain template to the current tenant. Creates the template's fact definitions and a new policy group pre-populated with its sample rules as a DRAFT version. Existing facts are skipped \u2014 apply is additive and never overwrites existing schema. Run lexq_domain_templates_preview first to review what will be created. Only ACTIVE templates can be applied.",
1416
1352
  inputSchema: {
1417
- template: z14.string().describe("Domain template key to apply (e.g. ECOMMERCE)."),
1418
- customName: z14.string().optional().describe(
1353
+ template: z13.string().describe("Domain template key to apply (e.g. ECOMMERCE)."),
1354
+ customName: z13.string().optional().describe(
1419
1355
  "Optional custom name for the policy group that gets created. If omitted, the template's default name is used."
1420
1356
  )
1421
1357
  }
@@ -1441,7 +1377,6 @@ function registerAllTools(server, callApi) {
1441
1377
  registerReplayTools(server, callApi);
1442
1378
  registerHistoryTools(server, callApi);
1443
1379
  registerProvenanceTools(server, callApi);
1444
- registerIntegrationTools(server, callApi);
1445
1380
  registerLogTools(server, callApi);
1446
1381
  registerDomainTemplateTools(server, callApi);
1447
1382
  registerWebhookSubscriptionTools(server, callApi);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lexq/cli",
3
- "version": "0.1.39",
3
+ "version": "0.1.41",
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": {