@lexq/cli 0.1.36 → 0.1.38

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.
@@ -871,8 +871,56 @@ function registerAnalyticsTools(server, callApi) {
871
871
  );
872
872
  }
873
873
 
874
- // src/mcp/tools/replay.ts
874
+ // src/mcp/tools/profile.ts
875
875
  import { z as z7 } from "zod";
876
+ var RELATIVE_THRESHOLD = "flagged = p50 \u2265 10\xD7 median of per-rule p50s within the group; absolute thresholds are intentionally not supported.";
877
+ function profileParams(opts) {
878
+ const params = {};
879
+ if (opts.versionId) params.versionId = opts.versionId;
880
+ if (opts.from) params.from = opts.from;
881
+ if (opts.to) params.to = opts.to;
882
+ if (opts.cacheState) params.cacheState = opts.cacheState;
883
+ return params;
884
+ }
885
+ function registerProfileTools(server, callApi) {
886
+ server.registerTool(
887
+ "lexq_profile_overview",
888
+ {
889
+ title: "Group Latency Profile",
890
+ description: "Per-rule latency profile of a policy group over a time window: group TOTAL distribution split by cache state (HIT = compiled ruleset cache hit, MISS = deep-load + compile), a per-rule CONDITION/ACTION percentile table, and slow-rule flags. " + RELATIVE_THRESHOLD + " Every percentile is accompanied by its sample count n; a percentile is withheld (null) unless n\xD7(1\u2212q) \u2265 3 (p50 needs n \u2265 6, p95 n \u2265 60, p99 n \u2265 300 \u2014 display gate, separate from the n \u2265 100 judgment gate). Baselines report INSUFFICIENT_COHORT when fewer than 3 rules qualify. Rule detail comes from a deterministic 1% sample of calls; TOTAL is recorded for every call. Defaults: last 24h, live version, cacheState HIT.",
891
+ inputSchema: {
892
+ groupId: z7.string().uuid().describe("Policy group ID"),
893
+ versionId: z7.string().uuid().optional().describe("Version to inspect (default: live version)"),
894
+ from: z7.string().optional().describe("Window start, ISO-8601 instant (e.g. 2026-07-01T00:00:00Z). Default: 24h ago"),
895
+ to: z7.string().optional().describe("Window end, ISO-8601 instant. Default: now"),
896
+ cacheState: z7.enum(["HIT", "MISS"]).optional().describe("Cache dimension for the rule table and judgment (default: HIT)")
897
+ }
898
+ },
899
+ async ({ groupId, versionId, from, to, cacheState }) => callApi("GET", `policy-groups/${groupId}/profile`, {
900
+ params: profileParams({ versionId, from, to, cacheState })
901
+ })
902
+ );
903
+ server.registerTool(
904
+ "lexq_profile_rule",
905
+ {
906
+ title: "Rule Latency Detail",
907
+ description: "Single-rule latency detail: merged phase \xD7 cacheState distributions plus a per-window time series (60s windows). Missing windows are genuine gaps \u2014 never interpolated. Series points carry each window's own values; percentiles in merged distributions are withheld (null) unless n\xD7(1\u2212q) \u2265 3 (p50 n \u2265 6, p95 n \u2265 60, p99 n \u2265 300). " + RELATIVE_THRESHOLD,
908
+ inputSchema: {
909
+ groupId: z7.string().uuid().describe("Policy group ID"),
910
+ ruleId: z7.string().uuid().describe("Rule ID (from lexq_profile_overview)"),
911
+ versionId: z7.string().uuid().optional().describe("Version to inspect (default: live version)"),
912
+ from: z7.string().optional().describe("Window start, ISO-8601 instant. Default: 24h ago"),
913
+ to: z7.string().optional().describe("Window end, ISO-8601 instant. Default: now")
914
+ }
915
+ },
916
+ async ({ groupId, ruleId, versionId, from, to }) => callApi("GET", `policy-groups/${groupId}/profile/rules/${ruleId}`, {
917
+ params: profileParams({ versionId, from, to })
918
+ })
919
+ );
920
+ }
921
+
922
+ // src/mcp/tools/replay.ts
923
+ import { z as z8 } from "zod";
876
924
  function registerReplayTools(server, callApi) {
877
925
  server.registerTool(
878
926
  "lexq_replay_decision",
@@ -880,8 +928,8 @@ function registerReplayTools(server, callApi) {
880
928
  title: "Replay a Decision",
881
929
  description: "Re-evaluate a past execution (traceId) against a candidate version and return the decision diff (decisionChanged, effect changes, fired rules) plus a determinism verdict. Synchronous and free of charge (TPS throttle only). External effects (webhooks, notifications) are always mocked \u2014 nothing fires.",
882
930
  inputSchema: {
883
- traceId: z7.string().describe("Trace ID of the past execution to replay"),
884
- candidateVersionId: z7.string().uuid().describe("Version to re-evaluate against")
931
+ traceId: z8.string().describe("Trace ID of the past execution to replay"),
932
+ candidateVersionId: z8.string().uuid().describe("Version to re-evaluate against")
885
933
  }
886
934
  },
887
935
  async ({ traceId, candidateVersionId }) => callApi("POST", "replay/decisions", { body: { traceId, candidateVersionId } })
@@ -892,10 +940,10 @@ function registerReplayTools(server, callApi) {
892
940
  title: "Start Window Replay (Blast Radius)",
893
941
  description: "Submit an async job that replays a date window of past executions against a candidate version and measures the blast radius (how many decisions change). Billed per replayed record (REPLAY metric); VIEWER role cannot submit. Poll with lexq_replay_status.",
894
942
  inputSchema: {
895
- candidateVersionId: z7.string().uuid().describe("Version to re-evaluate against"),
896
- from: z7.string().describe("Window start date (yyyy-MM-dd)"),
897
- to: z7.string().describe("Window end date (yyyy-MM-dd)"),
898
- maxRecords: z7.number().int().min(1).optional().describe("Sample cap (server default applies; hard cap 50k)")
943
+ candidateVersionId: z8.string().uuid().describe("Version to re-evaluate against"),
944
+ from: z8.string().describe("Window start date (yyyy-MM-dd)"),
945
+ to: z8.string().describe("Window end date (yyyy-MM-dd)"),
946
+ maxRecords: z8.number().int().min(1).optional().describe("Sample cap (server default applies; hard cap 50k)")
899
947
  }
900
948
  },
901
949
  async ({ candidateVersionId, from, to, maxRecords }) => callApi("POST", "replay/jobs", { body: { candidateVersionId, from, to, maxRecords } })
@@ -906,7 +954,7 @@ function registerReplayTools(server, callApi) {
906
954
  title: "Get Replay Job Status",
907
955
  description: "Poll a window replay job. RUNNING shows progress 0\u2013100; COMPLETED fills summary and changedSamples; FAILED carries errorMessage. capped=true means the window exceeded the sample cap and only part was replayed.",
908
956
  inputSchema: {
909
- jobId: z7.string().describe("Replay job ID from lexq_replay_start")
957
+ jobId: z8.string().describe("Replay job ID from lexq_replay_start")
910
958
  }
911
959
  },
912
960
  async ({ jobId }) => callApi("GET", `replay/jobs/${jobId}`)
@@ -917,8 +965,8 @@ function registerReplayTools(server, callApi) {
917
965
  title: "List Replay Jobs",
918
966
  description: "List window replay job history (reverse-chronological). Lightweight items \u2014 use lexq_replay_status for summary and changed samples.",
919
967
  inputSchema: {
920
- page: z7.number().int().min(0).default(0).describe("Page number"),
921
- size: z7.number().int().min(1).max(100).default(20).describe("Page size")
968
+ page: z8.number().int().min(0).default(0).describe("Page number"),
969
+ size: z8.number().int().min(1).max(100).default(20).describe("Page size")
922
970
  }
923
971
  },
924
972
  async ({ page, size }) => callApi("GET", "replay/jobs", { params: paginationParams(page, size) })
@@ -929,7 +977,7 @@ function registerReplayTools(server, callApi) {
929
977
  title: "Cancel Replay Job",
930
978
  description: "Cooperatively cancel a PENDING or RUNNING window replay job. Other states are rejected. VIEWER role cannot cancel.",
931
979
  inputSchema: {
932
- jobId: z7.string().describe("Replay job ID")
980
+ jobId: z8.string().describe("Replay job ID")
933
981
  }
934
982
  },
935
983
  async ({ jobId }) => callApi("POST", `replay/jobs/${jobId}/cancel`)
@@ -937,7 +985,7 @@ function registerReplayTools(server, callApi) {
937
985
  }
938
986
 
939
987
  // src/mcp/tools/history.ts
940
- import { z as z8 } from "zod";
988
+ import { z as z9 } from "zod";
941
989
  function registerHistoryTools(server, callApi) {
942
990
  server.registerTool(
943
991
  "lexq_history_list",
@@ -945,14 +993,14 @@ function registerHistoryTools(server, callApi) {
945
993
  title: "List Execution History",
946
994
  description: "List policy execution history. Shows trace ID, group, version, status, match result, and latency.",
947
995
  inputSchema: {
948
- page: z8.number().int().min(0).default(0).describe("Page number"),
949
- size: z8.number().int().min(1).max(100).default(20).describe("Page size"),
950
- traceId: z8.string().optional().describe("Filter by trace ID"),
951
- groupId: z8.string().uuid().optional().describe("Filter by policy group"),
952
- versionId: z8.string().uuid().optional().describe("Filter by version"),
953
- status: z8.enum(["SUCCESS", "NO_MATCH", "ERROR", "TIMEOUT"]).optional().describe("Filter by execution status"),
954
- startDate: z8.string().optional().describe("Start date (yyyy-MM-dd)"),
955
- endDate: z8.string().optional().describe("End date (yyyy-MM-dd)")
996
+ page: z9.number().int().min(0).default(0).describe("Page number"),
997
+ size: z9.number().int().min(1).max(100).default(20).describe("Page size"),
998
+ traceId: z9.string().optional().describe("Filter by trace ID"),
999
+ groupId: z9.string().uuid().optional().describe("Filter by policy group"),
1000
+ versionId: z9.string().uuid().optional().describe("Filter by version"),
1001
+ status: z9.enum(["SUCCESS", "NO_MATCH", "ERROR", "TIMEOUT"]).optional().describe("Filter by execution status"),
1002
+ startDate: z9.string().optional().describe("Start date (yyyy-MM-dd)"),
1003
+ endDate: z9.string().optional().describe("End date (yyyy-MM-dd)")
956
1004
  }
957
1005
  },
958
1006
  async ({ page, size, traceId, groupId, versionId, status, startDate, endDate }) => {
@@ -972,7 +1020,7 @@ function registerHistoryTools(server, callApi) {
972
1020
  title: "Get Execution Detail",
973
1021
  description: "Get full execution detail including inputFacts, mutatedFacts, generatedVariables, executionTraces, and decisionTraces.",
974
1022
  inputSchema: {
975
- traceId: z8.string().describe("Trace ID from execution history")
1023
+ traceId: z9.string().describe("Trace ID from execution history")
976
1024
  }
977
1025
  },
978
1026
  async ({ traceId }) => callApi("GET", `execution/history/${traceId}`)
@@ -983,9 +1031,9 @@ function registerHistoryTools(server, callApi) {
983
1031
  title: "Execution Statistics",
984
1032
  description: "Get execution KPIs: total executions, success/failure counts, success rate, and average latency.",
985
1033
  inputSchema: {
986
- groupId: z8.string().uuid().optional().describe("Filter by policy group"),
987
- startDate: z8.string().optional().describe("Start date (yyyy-MM-dd)"),
988
- endDate: z8.string().optional().describe("End date (yyyy-MM-dd)")
1034
+ groupId: z9.string().uuid().optional().describe("Filter by policy group"),
1035
+ startDate: z9.string().optional().describe("Start date (yyyy-MM-dd)"),
1036
+ endDate: z9.string().optional().describe("End date (yyyy-MM-dd)")
989
1037
  }
990
1038
  },
991
1039
  async ({ groupId, startDate, endDate }) => {
@@ -999,7 +1047,7 @@ function registerHistoryTools(server, callApi) {
999
1047
  }
1000
1048
 
1001
1049
  // src/mcp/tools/provenance.ts
1002
- import { z as z9 } from "zod";
1050
+ import { z as z10 } from "zod";
1003
1051
  function registerProvenanceTools(server, callApi) {
1004
1052
  server.registerTool(
1005
1053
  "lexq_provenance_get",
@@ -1007,7 +1055,7 @@ function registerProvenanceTools(server, callApi) {
1007
1055
  title: "Get Decision Provenance",
1008
1056
  description: "Get the lineage of a single decision: what was decided, deterministic why per rule, input facts (PII facts are masked as \u2022\u2022\u2022\u2022\u2022\u2022 with maskedKeys listing them \u2014 values are revealable only in the console, audited), the authored/published/deployed responsibility chain, and the rule snapshot fingerprint.",
1009
1057
  inputSchema: {
1010
- traceId: z9.string().describe("Trace ID of the execution")
1058
+ traceId: z10.string().describe("Trace ID of the execution")
1011
1059
  }
1012
1060
  },
1013
1061
  async ({ traceId }) => callApi("GET", `provenance/${traceId}`)
@@ -1018,13 +1066,13 @@ function registerProvenanceTools(server, callApi) {
1018
1066
  title: "List PII Reveal Audits",
1019
1067
  description: "List the PII reveal audit ledger \u2014 who revealed which fact of which trace, and when. Metadata only; revealed values are never stored or returned. Use for monthly access-log inspection and SIEM collection.",
1020
1068
  inputSchema: {
1021
- page: z9.number().int().min(0).default(0).describe("Page number"),
1022
- size: z9.number().int().min(1).max(100).default(20).describe("Page size"),
1023
- traceId: z9.string().optional().describe("Filter by trace ID (exact match)"),
1024
- revealedBy: z9.string().optional().describe("Filter by operator ID (exact match)"),
1025
- factKey: z9.string().optional().describe("Filter by fact key (partial match, case-insensitive)"),
1026
- startDate: z9.string().optional().describe("Start date (yyyy-MM-dd)"),
1027
- endDate: z9.string().optional().describe("End date (yyyy-MM-dd)")
1069
+ page: z10.number().int().min(0).default(0).describe("Page number"),
1070
+ size: z10.number().int().min(1).max(100).default(20).describe("Page size"),
1071
+ traceId: z10.string().optional().describe("Filter by trace ID (exact match)"),
1072
+ revealedBy: z10.string().optional().describe("Filter by operator ID (exact match)"),
1073
+ factKey: z10.string().optional().describe("Filter by fact key (partial match, case-insensitive)"),
1074
+ startDate: z10.string().optional().describe("Start date (yyyy-MM-dd)"),
1075
+ endDate: z10.string().optional().describe("End date (yyyy-MM-dd)")
1028
1076
  }
1029
1077
  },
1030
1078
  async ({ page, size, traceId, revealedBy, factKey, startDate, endDate }) => {
@@ -1040,7 +1088,7 @@ function registerProvenanceTools(server, callApi) {
1040
1088
  }
1041
1089
 
1042
1090
  // src/mcp/tools/integrations.ts
1043
- import { z as z10 } from "zod";
1091
+ import { z as z11 } from "zod";
1044
1092
  function registerIntegrationTools(server, callApi) {
1045
1093
  server.registerTool(
1046
1094
  "lexq_integrations_list",
@@ -1048,9 +1096,9 @@ function registerIntegrationTools(server, callApi) {
1048
1096
  title: "List Integrations",
1049
1097
  description: "List all external integrations (webhooks, CRM, notification, etc.).",
1050
1098
  inputSchema: {
1051
- page: z10.number().int().min(0).default(0).describe("Page number"),
1052
- size: z10.number().int().min(1).max(100).default(20).describe("Page size"),
1053
- type: z10.enum(["COUPON", "POINT", "NOTIFICATION", "CRM", "MESSENGER", "WEBHOOK"]).optional().describe("Filter by integration type")
1099
+ page: z11.number().int().min(0).default(0).describe("Page number"),
1100
+ size: z11.number().int().min(1).max(100).default(20).describe("Page size"),
1101
+ type: z11.enum(["COUPON", "POINT", "NOTIFICATION", "CRM", "MESSENGER", "WEBHOOK"]).optional().describe("Filter by integration type")
1054
1102
  }
1055
1103
  },
1056
1104
  async ({ page, size, type }) => {
@@ -1065,7 +1113,7 @@ function registerIntegrationTools(server, callApi) {
1065
1113
  title: "Get Integration",
1066
1114
  description: "Get integration detail by ID.",
1067
1115
  inputSchema: {
1068
- integrationId: z10.string().uuid().describe("Integration ID")
1116
+ integrationId: z11.string().uuid().describe("Integration ID")
1069
1117
  }
1070
1118
  },
1071
1119
  async ({ integrationId }) => callApi("GET", `integrations/${integrationId}`)
@@ -1076,13 +1124,13 @@ function registerIntegrationTools(server, callApi) {
1076
1124
  title: "Save Integration",
1077
1125
  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.",
1078
1126
  inputSchema: {
1079
- id: z10.string().uuid().optional().describe("Integration ID (omit to create, provide to update)"),
1080
- type: z10.enum(["COUPON", "POINT", "NOTIFICATION", "CRM", "MESSENGER", "WEBHOOK"]).describe("Integration type"),
1081
- name: z10.string().describe("Integration name"),
1082
- baseUrl: z10.string().describe("Base URL of the external service"),
1083
- credential: z10.string().optional().describe("API key or token for the service"),
1084
- additionalConfig: z10.string().optional().describe("JSON string of additional config key-value pairs"),
1085
- isActive: z10.boolean().default(true).describe("Whether the integration is active")
1127
+ id: z11.string().uuid().optional().describe("Integration ID (omit to create, provide to update)"),
1128
+ type: z11.enum(["COUPON", "POINT", "NOTIFICATION", "CRM", "MESSENGER", "WEBHOOK"]).describe("Integration type"),
1129
+ name: z11.string().describe("Integration name"),
1130
+ baseUrl: z11.string().describe("Base URL of the external service"),
1131
+ credential: z11.string().optional().describe("API key or token for the service"),
1132
+ additionalConfig: z11.string().optional().describe("JSON string of additional config key-value pairs"),
1133
+ isActive: z11.boolean().default(true).describe("Whether the integration is active")
1086
1134
  }
1087
1135
  },
1088
1136
  async ({ additionalConfig, ...rest }) => {
@@ -1097,7 +1145,7 @@ function registerIntegrationTools(server, callApi) {
1097
1145
  title: "Delete Integration",
1098
1146
  description: "Delete an integration by ID.",
1099
1147
  inputSchema: {
1100
- integrationId: z10.string().uuid().describe("Integration ID")
1148
+ integrationId: z11.string().uuid().describe("Integration ID")
1101
1149
  }
1102
1150
  },
1103
1151
  async ({ integrationId }) => callApi("DELETE", `integrations/${integrationId}`)
@@ -1114,7 +1162,7 @@ function registerIntegrationTools(server, callApi) {
1114
1162
  }
1115
1163
 
1116
1164
  // src/mcp/tools/logs.ts
1117
- import { z as z11 } from "zod";
1165
+ import { z as z12 } from "zod";
1118
1166
 
1119
1167
  // src/types/enums.ts
1120
1168
  var FailureStatus = ["PENDING", "RESOLVED", "IGNORED"];
@@ -1152,14 +1200,14 @@ function registerLogTools(server, callApi) {
1152
1200
  title: "List Failure Logs",
1153
1201
  description: "List system failure logs from background tasks (webhook calls, coupon issuance, etc.).",
1154
1202
  inputSchema: {
1155
- page: z11.number().int().min(0).default(0).describe("Page number"),
1156
- size: z11.number().int().min(1).max(100).default(20).describe("Page size"),
1157
- category: z11.enum(TaskCategory).optional().describe("Task category"),
1158
- taskType: z11.enum(TaskType).optional().describe("Task type"),
1159
- status: z11.enum(FailureStatus).optional().describe("Log status"),
1160
- keyword: z11.string().optional().describe("Search in refId, refSubId, errorMessage"),
1161
- startDate: z11.string().optional().describe("Start date (yyyy-MM-dd)"),
1162
- endDate: z11.string().optional().describe("End date (yyyy-MM-dd)")
1203
+ page: z12.number().int().min(0).default(0).describe("Page number"),
1204
+ size: z12.number().int().min(1).max(100).default(20).describe("Page size"),
1205
+ category: z12.enum(TaskCategory).optional().describe("Task category"),
1206
+ taskType: z12.enum(TaskType).optional().describe("Task type"),
1207
+ status: z12.enum(FailureStatus).optional().describe("Log status"),
1208
+ keyword: z12.string().optional().describe("Search in refId, refSubId, errorMessage"),
1209
+ startDate: z12.string().optional().describe("Start date (yyyy-MM-dd)"),
1210
+ endDate: z12.string().optional().describe("End date (yyyy-MM-dd)")
1163
1211
  }
1164
1212
  },
1165
1213
  async ({ page, size, category, taskType, status, keyword, startDate, endDate }) => {
@@ -1179,7 +1227,7 @@ function registerLogTools(server, callApi) {
1179
1227
  title: "Get Failure Log",
1180
1228
  description: "Get failure log detail by ID.",
1181
1229
  inputSchema: {
1182
- logId: z11.string().uuid().describe("Failure log ID")
1230
+ logId: z12.string().uuid().describe("Failure log ID")
1183
1231
  }
1184
1232
  },
1185
1233
  async ({ logId }) => callApi("GET", `failure-logs/${logId}`)
@@ -1190,8 +1238,8 @@ function registerLogTools(server, callApi) {
1190
1238
  title: "Process Failure Log",
1191
1239
  description: "Process a single failure log: RETRY (re-execute with original payload), RESOLVE (mark as manually fixed), or IGNORE (skip intentionally).",
1192
1240
  inputSchema: {
1193
- logId: z11.string().uuid().describe("Failure log ID"),
1194
- action: z11.enum(FailureAction).describe("Action to take")
1241
+ logId: z12.string().uuid().describe("Failure log ID"),
1242
+ action: z12.enum(FailureAction).describe("Action to take")
1195
1243
  }
1196
1244
  },
1197
1245
  async ({ logId, action }) => callApi("POST", `failure-logs/${logId}/actions`, {
@@ -1204,8 +1252,8 @@ function registerLogTools(server, callApi) {
1204
1252
  title: "Bulk Process Failure Logs",
1205
1253
  description: "Process multiple failure logs at once. Provide an array of log IDs and the action.",
1206
1254
  inputSchema: {
1207
- logIds: z11.array(z11.string().uuid()).describe("Array of failure log IDs"),
1208
- action: z11.enum(FailureAction).describe("Action to apply to all logs")
1255
+ logIds: z12.array(z12.string().uuid()).describe("Array of failure log IDs"),
1256
+ action: z12.enum(FailureAction).describe("Action to apply to all logs")
1209
1257
  }
1210
1258
  },
1211
1259
  async ({ logIds, action }) => callApi("POST", "failure-logs/bulk-actions", {
@@ -1215,7 +1263,7 @@ function registerLogTools(server, callApi) {
1215
1263
  }
1216
1264
 
1217
1265
  // src/mcp/tools/webhook-subscriptions.ts
1218
- import { z as z12 } from "zod";
1266
+ import { z as z13 } from "zod";
1219
1267
  function registerWebhookSubscriptionTools(server, callApi) {
1220
1268
  server.registerTool(
1221
1269
  "lexq_webhook_subscriptions_list",
@@ -1223,8 +1271,8 @@ function registerWebhookSubscriptionTools(server, callApi) {
1223
1271
  title: "List Webhook Subscriptions",
1224
1272
  description: "List platform event webhook subscriptions. These receive deployment lifecycle notifications (publish, deploy, rollback, undeploy).",
1225
1273
  inputSchema: {
1226
- page: z12.number().int().min(0).default(0).describe("Page number"),
1227
- size: z12.number().int().min(1).max(100).default(20).describe("Page size")
1274
+ page: z13.number().int().min(0).default(0).describe("Page number"),
1275
+ size: z13.number().int().min(1).max(100).default(20).describe("Page size")
1228
1276
  }
1229
1277
  },
1230
1278
  async ({ page, size }) => {
@@ -1238,7 +1286,7 @@ function registerWebhookSubscriptionTools(server, callApi) {
1238
1286
  title: "Get Webhook Subscription",
1239
1287
  description: "Get webhook subscription detail by ID.",
1240
1288
  inputSchema: {
1241
- id: z12.string().uuid().describe("Webhook subscription ID")
1289
+ id: z13.string().uuid().describe("Webhook subscription ID")
1242
1290
  }
1243
1291
  },
1244
1292
  async ({ id }) => callApi("GET", `webhook-subscriptions/${id}`)
@@ -1249,13 +1297,13 @@ function registerWebhookSubscriptionTools(server, callApi) {
1249
1297
  title: "Save Webhook Subscription",
1250
1298
  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": "..."}).',
1251
1299
  inputSchema: {
1252
- id: z12.string().uuid().optional().describe("Subscription ID (omit to create, provide to update)"),
1253
- name: z12.string().min(1).describe("Subscription name (unique per tenant)"),
1254
- webhookUrl: z12.string().url().describe("Webhook endpoint URL"),
1255
- subscribedEvents: z12.array(z12.enum(PlatformEventType)).min(1).describe("Events to subscribe to"),
1256
- payloadFormat: z12.enum(WebhookPayloadFormat).optional().default("GENERIC").describe("Payload format"),
1257
- secret: z12.string().optional().describe("HMAC-SHA256 signing secret"),
1258
- isActive: z12.boolean().optional().default(true).describe("Whether the subscription is active")
1300
+ id: z13.string().uuid().optional().describe("Subscription ID (omit to create, provide to update)"),
1301
+ name: z13.string().min(1).describe("Subscription name (unique per tenant)"),
1302
+ webhookUrl: z13.string().url().describe("Webhook endpoint URL"),
1303
+ subscribedEvents: z13.array(z13.enum(PlatformEventType)).min(1).describe("Events to subscribe to"),
1304
+ payloadFormat: z13.enum(WebhookPayloadFormat).optional().default("GENERIC").describe("Payload format"),
1305
+ secret: z13.string().optional().describe("HMAC-SHA256 signing secret"),
1306
+ isActive: z13.boolean().optional().default(true).describe("Whether the subscription is active")
1259
1307
  }
1260
1308
  },
1261
1309
  async ({ ...body }) => callApi("POST", "webhook-subscriptions", { body })
@@ -1266,7 +1314,7 @@ function registerWebhookSubscriptionTools(server, callApi) {
1266
1314
  title: "Delete Webhook Subscription",
1267
1315
  description: "Delete a webhook subscription by ID.",
1268
1316
  inputSchema: {
1269
- id: z12.string().uuid().describe("Webhook subscription ID")
1317
+ id: z13.string().uuid().describe("Webhook subscription ID")
1270
1318
  }
1271
1319
  },
1272
1320
  async ({ id }) => callApi("DELETE", `webhook-subscriptions/${id}`)
@@ -1277,7 +1325,7 @@ function registerWebhookSubscriptionTools(server, callApi) {
1277
1325
  title: "Test Webhook Subscription",
1278
1326
  description: "Send a test event to verify webhook connectivity. Returns the HTTP status code and success/failure message.",
1279
1327
  inputSchema: {
1280
- id: z12.string().uuid().describe("Webhook subscription ID")
1328
+ id: z13.string().uuid().describe("Webhook subscription ID")
1281
1329
  }
1282
1330
  },
1283
1331
  async ({ id }) => callApi("POST", `webhook-subscriptions/${id}/test`)
@@ -1285,7 +1333,7 @@ function registerWebhookSubscriptionTools(server, callApi) {
1285
1333
  }
1286
1334
 
1287
1335
  // src/mcp/tools/domain-templates.ts
1288
- import { z as z13 } from "zod";
1336
+ import { z as z14 } from "zod";
1289
1337
  function registerDomainTemplateTools(server, callApi) {
1290
1338
  server.registerTool(
1291
1339
  "lexq_domain_templates_list",
@@ -1302,7 +1350,7 @@ function registerDomainTemplateTools(server, callApi) {
1302
1350
  title: "Preview Domain Template",
1303
1351
  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.",
1304
1352
  inputSchema: {
1305
- template: z13.string().describe(
1353
+ template: z14.string().describe(
1306
1354
  "Domain template key (e.g. ECOMMERCE). Use lexq_domain_templates_list to see available keys \u2014 currently only ECOMMERCE is ACTIVE."
1307
1355
  )
1308
1356
  }
@@ -1315,8 +1363,8 @@ function registerDomainTemplateTools(server, callApi) {
1315
1363
  title: "Apply Domain Template",
1316
1364
  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.",
1317
1365
  inputSchema: {
1318
- template: z13.string().describe("Domain template key to apply (e.g. ECOMMERCE)."),
1319
- customName: z13.string().optional().describe(
1366
+ template: z14.string().describe("Domain template key to apply (e.g. ECOMMERCE)."),
1367
+ customName: z14.string().optional().describe(
1320
1368
  "Optional custom name for the policy group that gets created. If omitted, the template's default name is used."
1321
1369
  )
1322
1370
  }
@@ -1338,6 +1386,7 @@ function registerAllTools(server, callApi) {
1338
1386
  registerFactTools(server, callApi);
1339
1387
  registerDeployTools(server, callApi);
1340
1388
  registerAnalyticsTools(server, callApi);
1389
+ registerProfileTools(server, callApi);
1341
1390
  registerReplayTools(server, callApi);
1342
1391
  registerHistoryTools(server, callApi);
1343
1392
  registerProvenanceTools(server, callApi);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lexq/cli",
3
- "version": "0.1.36",
3
+ "version": "0.1.38",
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": {