@lexq/cli 0.1.33 → 0.1.35
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 +469 -100
- package/dist/mcp/register.d.ts +1 -26
- package/dist/mcp/register.js +206 -69
- package/package.json +1 -1
package/dist/mcp/register.d.ts
CHANGED
|
@@ -1,30 +1,5 @@
|
|
|
1
1
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
2
|
|
|
3
|
-
declare const ValueType: readonly ["STRING", "NUMBER", "BOOLEAN", "LIST_STRING", "LIST_NUMBER"];
|
|
4
|
-
type ValueType = (typeof ValueType)[number];
|
|
5
|
-
declare const Confidence: readonly ["EXACT", "AMBIGUOUS"];
|
|
6
|
-
type Confidence = (typeof Confidence)[number];
|
|
7
|
-
declare const SourceKind: readonly ["CONDITION", "ACTION"];
|
|
8
|
-
type SourceKind = (typeof SourceKind)[number];
|
|
9
|
-
|
|
10
|
-
interface ResponseMeta {
|
|
11
|
-
unregisteredFacts?: UnregisteredFact[];
|
|
12
|
-
}
|
|
13
|
-
interface UnregisteredFact {
|
|
14
|
-
key: string;
|
|
15
|
-
inferredType: ValueType | null;
|
|
16
|
-
confidence: Confidence;
|
|
17
|
-
conflict: boolean;
|
|
18
|
-
candidateTypes: ValueType[] | null;
|
|
19
|
-
suggestedName: string;
|
|
20
|
-
sources: UnregisteredFactSource[];
|
|
21
|
-
}
|
|
22
|
-
interface UnregisteredFactSource {
|
|
23
|
-
kind: SourceKind;
|
|
24
|
-
field: string;
|
|
25
|
-
operator?: string;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
3
|
interface McpToolResult {
|
|
29
4
|
[key: string]: unknown;
|
|
30
5
|
content: Array<{
|
|
@@ -58,7 +33,7 @@ declare function paginationParams(page?: number, size?: number): Record<string,
|
|
|
58
33
|
* so the agent-facing text is identical on every surface. The backend only populates
|
|
59
34
|
* meta.unregisteredFacts on rule create/update, so this only ever fires there.
|
|
60
35
|
*/
|
|
61
|
-
declare function formatUnregisteredFactWarning(meta:
|
|
36
|
+
declare function formatUnregisteredFactWarning(meta: unknown): string | null;
|
|
62
37
|
|
|
63
38
|
/**
|
|
64
39
|
* Registers all MCP tools on the given server.
|
package/dist/mcp/register.js
CHANGED
|
@@ -714,21 +714,32 @@ function registerAnalyticsTools(server, callApi) {
|
|
|
714
714
|
{
|
|
715
715
|
title: "Start Simulation",
|
|
716
716
|
description: dedent2`
|
|
717
|
-
Start an Impact Simulation against historical or
|
|
717
|
+
Start an Impact Simulation against historical, uploaded, or inline data.
|
|
718
|
+
|
|
719
|
+
dataset.type and dataset.source are BOTH required, and must be paired:
|
|
720
|
+
HISTORICAL → source EXECUTION_LOGS, with dataset.from / dataset.to (yyyy-MM-dd)
|
|
721
|
+
UPLOADED → source S3_BUCKET, with dataset.path (the path returned by lexq_dataset_upload)
|
|
722
|
+
MANUAL → source REQUEST_BODY, with dataset.manualData (array of fact records)
|
|
718
723
|
|
|
719
|
-
dataset.type: "HISTORICAL" or "UPLOADED"
|
|
720
|
-
dataset.source (when HISTORICAL): "EXECUTION_LOGS"
|
|
721
|
-
dataset.from / dataset.to: date range (yyyy-MM-dd, when HISTORICAL)
|
|
722
724
|
options.maxRecords: number (max 100000, default 10000)
|
|
723
|
-
options.baselinePolicyVersionId: uuid (optional, for comparison)
|
|
725
|
+
options.baselinePolicyVersionId: uuid (optional, for baseline comparison)
|
|
724
726
|
options.includeRuleStats: boolean
|
|
727
|
+
options.metricConfig: optional — omit for plain execution count. To aggregate a fact, pass
|
|
728
|
+
{ "targetVariable": "<fact>", "aggregationType": "COUNT" | "SUM" | "AVG" }
|
|
725
729
|
|
|
726
|
-
Example
|
|
730
|
+
Example (uploaded dataset):
|
|
727
731
|
{
|
|
728
732
|
"policyVersionId": "<uuid>",
|
|
729
|
-
"dataset": { "type": "
|
|
733
|
+
"dataset": { "type": "UPLOADED", "source": "S3_BUCKET", "path": "<path from lexq_dataset_upload>" },
|
|
730
734
|
"options": { "baselinePolicyVersionId": "<uuid>", "includeRuleStats": true, "maxRecords": 10000 }
|
|
731
735
|
}
|
|
736
|
+
|
|
737
|
+
Example (historical):
|
|
738
|
+
{
|
|
739
|
+
"policyVersionId": "<uuid>",
|
|
740
|
+
"dataset": { "type": "HISTORICAL", "source": "EXECUTION_LOGS", "from": "2026-01-01", "to": "2026-01-31" },
|
|
741
|
+
"options": { "baselinePolicyVersionId": "<uuid>", "includeRuleStats": true }
|
|
742
|
+
}
|
|
732
743
|
`,
|
|
733
744
|
inputSchema: {
|
|
734
745
|
body: z6.string().describe("JSON string of SimulationRequest")
|
|
@@ -802,8 +813,10 @@ function registerAnalyticsTools(server, callApi) {
|
|
|
802
813
|
title: "Upload Dataset",
|
|
803
814
|
description: dedent2`
|
|
804
815
|
Upload inline CSV or JSON content as a simulation dataset.
|
|
805
|
-
The content is uploaded to S3 and a path is returned.
|
|
806
|
-
|
|
816
|
+
The content is uploaded to S3 and a path is returned in the "path" field.
|
|
817
|
+
|
|
818
|
+
To use the returned path in lexq_simulation_start, set:
|
|
819
|
+
dataset: { "type": "UPLOADED", "source": "S3_BUCKET", "path": "<returned path>" }
|
|
807
820
|
|
|
808
821
|
CSV example:
|
|
809
822
|
user_id,payment_amount
|
|
@@ -817,9 +830,25 @@ function registerAnalyticsTools(server, callApi) {
|
|
|
817
830
|
filename: z6.string().default("dataset.csv").describe("Filename with extension (.csv or .json)")
|
|
818
831
|
}
|
|
819
832
|
},
|
|
820
|
-
async ({ content, filename }) =>
|
|
821
|
-
|
|
822
|
-
|
|
833
|
+
async ({ content, filename }) => {
|
|
834
|
+
const result = await callApi("POST", "analytics/datasets/upload", {
|
|
835
|
+
upload: { content, filename, fieldName: "file" }
|
|
836
|
+
});
|
|
837
|
+
if (!result.isError) {
|
|
838
|
+
try {
|
|
839
|
+
const uploaded = JSON.parse(result.content[0]?.text ?? "{}");
|
|
840
|
+
if (uploaded.path) {
|
|
841
|
+
const dataset = { type: "UPLOADED", source: "S3_BUCKET", path: uploaded.path };
|
|
842
|
+
result.content.push({
|
|
843
|
+
type: "text",
|
|
844
|
+
text: "Ready-to-use dataset block for lexq_simulation_start:\n" + JSON.stringify({ dataset }, null, 2)
|
|
845
|
+
});
|
|
846
|
+
}
|
|
847
|
+
} catch {
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
return result;
|
|
851
|
+
}
|
|
823
852
|
);
|
|
824
853
|
server.registerTool(
|
|
825
854
|
"lexq_dataset_template",
|
|
@@ -838,8 +867,73 @@ function registerAnalyticsTools(server, callApi) {
|
|
|
838
867
|
);
|
|
839
868
|
}
|
|
840
869
|
|
|
841
|
-
// src/mcp/tools/
|
|
870
|
+
// src/mcp/tools/replay.ts
|
|
842
871
|
import { z as z7 } from "zod";
|
|
872
|
+
function registerReplayTools(server, callApi) {
|
|
873
|
+
server.registerTool(
|
|
874
|
+
"lexq_replay_decision",
|
|
875
|
+
{
|
|
876
|
+
title: "Replay a Decision",
|
|
877
|
+
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.",
|
|
878
|
+
inputSchema: {
|
|
879
|
+
traceId: z7.string().describe("Trace ID of the past execution to replay"),
|
|
880
|
+
candidateVersionId: z7.string().uuid().describe("Version to re-evaluate against")
|
|
881
|
+
}
|
|
882
|
+
},
|
|
883
|
+
async ({ traceId, candidateVersionId }) => callApi("POST", "replay/decisions", { body: { traceId, candidateVersionId } })
|
|
884
|
+
);
|
|
885
|
+
server.registerTool(
|
|
886
|
+
"lexq_replay_start",
|
|
887
|
+
{
|
|
888
|
+
title: "Start Window Replay (Blast Radius)",
|
|
889
|
+
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.",
|
|
890
|
+
inputSchema: {
|
|
891
|
+
candidateVersionId: z7.string().uuid().describe("Version to re-evaluate against"),
|
|
892
|
+
from: z7.string().describe("Window start date (yyyy-MM-dd)"),
|
|
893
|
+
to: z7.string().describe("Window end date (yyyy-MM-dd)"),
|
|
894
|
+
maxRecords: z7.number().int().min(1).optional().describe("Sample cap (server default applies; hard cap 50k)")
|
|
895
|
+
}
|
|
896
|
+
},
|
|
897
|
+
async ({ candidateVersionId, from, to, maxRecords }) => callApi("POST", "replay/jobs", { body: { candidateVersionId, from, to, maxRecords } })
|
|
898
|
+
);
|
|
899
|
+
server.registerTool(
|
|
900
|
+
"lexq_replay_status",
|
|
901
|
+
{
|
|
902
|
+
title: "Get Replay Job Status",
|
|
903
|
+
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.",
|
|
904
|
+
inputSchema: {
|
|
905
|
+
jobId: z7.string().describe("Replay job ID from lexq_replay_start")
|
|
906
|
+
}
|
|
907
|
+
},
|
|
908
|
+
async ({ jobId }) => callApi("GET", `replay/jobs/${jobId}`)
|
|
909
|
+
);
|
|
910
|
+
server.registerTool(
|
|
911
|
+
"lexq_replay_list",
|
|
912
|
+
{
|
|
913
|
+
title: "List Replay Jobs",
|
|
914
|
+
description: "List window replay job history (reverse-chronological). Lightweight items \u2014 use lexq_replay_status for summary and changed samples.",
|
|
915
|
+
inputSchema: {
|
|
916
|
+
page: z7.number().int().min(0).default(0).describe("Page number"),
|
|
917
|
+
size: z7.number().int().min(1).max(100).default(20).describe("Page size")
|
|
918
|
+
}
|
|
919
|
+
},
|
|
920
|
+
async ({ page, size }) => callApi("GET", "replay/jobs", { params: paginationParams(page, size) })
|
|
921
|
+
);
|
|
922
|
+
server.registerTool(
|
|
923
|
+
"lexq_replay_cancel",
|
|
924
|
+
{
|
|
925
|
+
title: "Cancel Replay Job",
|
|
926
|
+
description: "Cooperatively cancel a PENDING or RUNNING window replay job. Other states are rejected. VIEWER role cannot cancel.",
|
|
927
|
+
inputSchema: {
|
|
928
|
+
jobId: z7.string().describe("Replay job ID")
|
|
929
|
+
}
|
|
930
|
+
},
|
|
931
|
+
async ({ jobId }) => callApi("POST", `replay/jobs/${jobId}/cancel`)
|
|
932
|
+
);
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
// src/mcp/tools/history.ts
|
|
936
|
+
import { z as z8 } from "zod";
|
|
843
937
|
function registerHistoryTools(server, callApi) {
|
|
844
938
|
server.registerTool(
|
|
845
939
|
"lexq_history_list",
|
|
@@ -847,14 +941,14 @@ function registerHistoryTools(server, callApi) {
|
|
|
847
941
|
title: "List Execution History",
|
|
848
942
|
description: "List policy execution history. Shows trace ID, group, version, status, match result, and latency.",
|
|
849
943
|
inputSchema: {
|
|
850
|
-
page:
|
|
851
|
-
size:
|
|
852
|
-
traceId:
|
|
853
|
-
groupId:
|
|
854
|
-
versionId:
|
|
855
|
-
status:
|
|
856
|
-
startDate:
|
|
857
|
-
endDate:
|
|
944
|
+
page: z8.number().int().min(0).default(0).describe("Page number"),
|
|
945
|
+
size: z8.number().int().min(1).max(100).default(20).describe("Page size"),
|
|
946
|
+
traceId: z8.string().optional().describe("Filter by trace ID"),
|
|
947
|
+
groupId: z8.string().uuid().optional().describe("Filter by policy group"),
|
|
948
|
+
versionId: z8.string().uuid().optional().describe("Filter by version"),
|
|
949
|
+
status: z8.enum(["SUCCESS", "NO_MATCH", "ERROR", "TIMEOUT"]).optional().describe("Filter by execution status"),
|
|
950
|
+
startDate: z8.string().optional().describe("Start date (yyyy-MM-dd)"),
|
|
951
|
+
endDate: z8.string().optional().describe("End date (yyyy-MM-dd)")
|
|
858
952
|
}
|
|
859
953
|
},
|
|
860
954
|
async ({ page, size, traceId, groupId, versionId, status, startDate, endDate }) => {
|
|
@@ -874,7 +968,7 @@ function registerHistoryTools(server, callApi) {
|
|
|
874
968
|
title: "Get Execution Detail",
|
|
875
969
|
description: "Get full execution detail including inputFacts, mutatedFacts, generatedVariables, executionTraces, and decisionTraces.",
|
|
876
970
|
inputSchema: {
|
|
877
|
-
traceId:
|
|
971
|
+
traceId: z8.string().describe("Trace ID from execution history")
|
|
878
972
|
}
|
|
879
973
|
},
|
|
880
974
|
async ({ traceId }) => callApi("GET", `execution/history/${traceId}`)
|
|
@@ -885,9 +979,9 @@ function registerHistoryTools(server, callApi) {
|
|
|
885
979
|
title: "Execution Statistics",
|
|
886
980
|
description: "Get execution KPIs: total executions, success/failure counts, success rate, and average latency.",
|
|
887
981
|
inputSchema: {
|
|
888
|
-
groupId:
|
|
889
|
-
startDate:
|
|
890
|
-
endDate:
|
|
982
|
+
groupId: z8.string().uuid().optional().describe("Filter by policy group"),
|
|
983
|
+
startDate: z8.string().optional().describe("Start date (yyyy-MM-dd)"),
|
|
984
|
+
endDate: z8.string().optional().describe("End date (yyyy-MM-dd)")
|
|
891
985
|
}
|
|
892
986
|
},
|
|
893
987
|
async ({ groupId, startDate, endDate }) => {
|
|
@@ -900,8 +994,49 @@ function registerHistoryTools(server, callApi) {
|
|
|
900
994
|
);
|
|
901
995
|
}
|
|
902
996
|
|
|
997
|
+
// src/mcp/tools/provenance.ts
|
|
998
|
+
import { z as z9 } from "zod";
|
|
999
|
+
function registerProvenanceTools(server, callApi) {
|
|
1000
|
+
server.registerTool(
|
|
1001
|
+
"lexq_provenance_get",
|
|
1002
|
+
{
|
|
1003
|
+
title: "Get Decision Provenance",
|
|
1004
|
+
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.",
|
|
1005
|
+
inputSchema: {
|
|
1006
|
+
traceId: z9.string().describe("Trace ID of the execution")
|
|
1007
|
+
}
|
|
1008
|
+
},
|
|
1009
|
+
async ({ traceId }) => callApi("GET", `provenance/${traceId}`)
|
|
1010
|
+
);
|
|
1011
|
+
server.registerTool(
|
|
1012
|
+
"lexq_pii_reveals_list",
|
|
1013
|
+
{
|
|
1014
|
+
title: "List PII Reveal Audits",
|
|
1015
|
+
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.",
|
|
1016
|
+
inputSchema: {
|
|
1017
|
+
page: z9.number().int().min(0).default(0).describe("Page number"),
|
|
1018
|
+
size: z9.number().int().min(1).max(100).default(20).describe("Page size"),
|
|
1019
|
+
traceId: z9.string().optional().describe("Filter by trace ID (exact match)"),
|
|
1020
|
+
revealedBy: z9.string().optional().describe("Filter by operator ID (exact match)"),
|
|
1021
|
+
factKey: z9.string().optional().describe("Filter by fact key (partial match, case-insensitive)"),
|
|
1022
|
+
startDate: z9.string().optional().describe("Start date (yyyy-MM-dd)"),
|
|
1023
|
+
endDate: z9.string().optional().describe("End date (yyyy-MM-dd)")
|
|
1024
|
+
}
|
|
1025
|
+
},
|
|
1026
|
+
async ({ page, size, traceId, revealedBy, factKey, startDate, endDate }) => {
|
|
1027
|
+
const params = paginationParams(page, size);
|
|
1028
|
+
if (traceId) params.traceId = traceId;
|
|
1029
|
+
if (revealedBy) params.revealedBy = revealedBy;
|
|
1030
|
+
if (factKey) params.factKey = factKey;
|
|
1031
|
+
if (startDate) params.startDate = startDate;
|
|
1032
|
+
if (endDate) params.endDate = endDate;
|
|
1033
|
+
return callApi("GET", "provenance/reveal-audits", { params });
|
|
1034
|
+
}
|
|
1035
|
+
);
|
|
1036
|
+
}
|
|
1037
|
+
|
|
903
1038
|
// src/mcp/tools/integrations.ts
|
|
904
|
-
import { z as
|
|
1039
|
+
import { z as z10 } from "zod";
|
|
905
1040
|
function registerIntegrationTools(server, callApi) {
|
|
906
1041
|
server.registerTool(
|
|
907
1042
|
"lexq_integrations_list",
|
|
@@ -909,9 +1044,9 @@ function registerIntegrationTools(server, callApi) {
|
|
|
909
1044
|
title: "List Integrations",
|
|
910
1045
|
description: "List all external integrations (webhooks, CRM, notification, etc.).",
|
|
911
1046
|
inputSchema: {
|
|
912
|
-
page:
|
|
913
|
-
size:
|
|
914
|
-
type:
|
|
1047
|
+
page: z10.number().int().min(0).default(0).describe("Page number"),
|
|
1048
|
+
size: z10.number().int().min(1).max(100).default(20).describe("Page size"),
|
|
1049
|
+
type: z10.enum(["COUPON", "POINT", "NOTIFICATION", "CRM", "MESSENGER", "WEBHOOK"]).optional().describe("Filter by integration type")
|
|
915
1050
|
}
|
|
916
1051
|
},
|
|
917
1052
|
async ({ page, size, type }) => {
|
|
@@ -926,7 +1061,7 @@ function registerIntegrationTools(server, callApi) {
|
|
|
926
1061
|
title: "Get Integration",
|
|
927
1062
|
description: "Get integration detail by ID.",
|
|
928
1063
|
inputSchema: {
|
|
929
|
-
integrationId:
|
|
1064
|
+
integrationId: z10.string().uuid().describe("Integration ID")
|
|
930
1065
|
}
|
|
931
1066
|
},
|
|
932
1067
|
async ({ integrationId }) => callApi("GET", `integrations/${integrationId}`)
|
|
@@ -937,13 +1072,13 @@ function registerIntegrationTools(server, callApi) {
|
|
|
937
1072
|
title: "Save Integration",
|
|
938
1073
|
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.",
|
|
939
1074
|
inputSchema: {
|
|
940
|
-
id:
|
|
941
|
-
type:
|
|
942
|
-
name:
|
|
943
|
-
baseUrl:
|
|
944
|
-
credential:
|
|
945
|
-
additionalConfig:
|
|
946
|
-
isActive:
|
|
1075
|
+
id: z10.string().uuid().optional().describe("Integration ID (omit to create, provide to update)"),
|
|
1076
|
+
type: z10.enum(["COUPON", "POINT", "NOTIFICATION", "CRM", "MESSENGER", "WEBHOOK"]).describe("Integration type"),
|
|
1077
|
+
name: z10.string().describe("Integration name"),
|
|
1078
|
+
baseUrl: z10.string().describe("Base URL of the external service"),
|
|
1079
|
+
credential: z10.string().optional().describe("API key or token for the service"),
|
|
1080
|
+
additionalConfig: z10.string().optional().describe("JSON string of additional config key-value pairs"),
|
|
1081
|
+
isActive: z10.boolean().default(true).describe("Whether the integration is active")
|
|
947
1082
|
}
|
|
948
1083
|
},
|
|
949
1084
|
async ({ additionalConfig, ...rest }) => {
|
|
@@ -958,7 +1093,7 @@ function registerIntegrationTools(server, callApi) {
|
|
|
958
1093
|
title: "Delete Integration",
|
|
959
1094
|
description: "Delete an integration by ID.",
|
|
960
1095
|
inputSchema: {
|
|
961
|
-
integrationId:
|
|
1096
|
+
integrationId: z10.string().uuid().describe("Integration ID")
|
|
962
1097
|
}
|
|
963
1098
|
},
|
|
964
1099
|
async ({ integrationId }) => callApi("DELETE", `integrations/${integrationId}`)
|
|
@@ -975,7 +1110,7 @@ function registerIntegrationTools(server, callApi) {
|
|
|
975
1110
|
}
|
|
976
1111
|
|
|
977
1112
|
// src/mcp/tools/logs.ts
|
|
978
|
-
import { z as
|
|
1113
|
+
import { z as z11 } from "zod";
|
|
979
1114
|
|
|
980
1115
|
// src/types/enums.ts
|
|
981
1116
|
var FailureStatus = ["PENDING", "RESOLVED", "IGNORED"];
|
|
@@ -1013,14 +1148,14 @@ function registerLogTools(server, callApi) {
|
|
|
1013
1148
|
title: "List Failure Logs",
|
|
1014
1149
|
description: "List system failure logs from background tasks (webhook calls, coupon issuance, etc.).",
|
|
1015
1150
|
inputSchema: {
|
|
1016
|
-
page:
|
|
1017
|
-
size:
|
|
1018
|
-
category:
|
|
1019
|
-
taskType:
|
|
1020
|
-
status:
|
|
1021
|
-
keyword:
|
|
1022
|
-
startDate:
|
|
1023
|
-
endDate:
|
|
1151
|
+
page: z11.number().int().min(0).default(0).describe("Page number"),
|
|
1152
|
+
size: z11.number().int().min(1).max(100).default(20).describe("Page size"),
|
|
1153
|
+
category: z11.enum(TaskCategory).optional().describe("Task category"),
|
|
1154
|
+
taskType: z11.enum(TaskType).optional().describe("Task type"),
|
|
1155
|
+
status: z11.enum(FailureStatus).optional().describe("Log status"),
|
|
1156
|
+
keyword: z11.string().optional().describe("Search in refId, refSubId, errorMessage"),
|
|
1157
|
+
startDate: z11.string().optional().describe("Start date (yyyy-MM-dd)"),
|
|
1158
|
+
endDate: z11.string().optional().describe("End date (yyyy-MM-dd)")
|
|
1024
1159
|
}
|
|
1025
1160
|
},
|
|
1026
1161
|
async ({ page, size, category, taskType, status, keyword, startDate, endDate }) => {
|
|
@@ -1040,7 +1175,7 @@ function registerLogTools(server, callApi) {
|
|
|
1040
1175
|
title: "Get Failure Log",
|
|
1041
1176
|
description: "Get failure log detail by ID.",
|
|
1042
1177
|
inputSchema: {
|
|
1043
|
-
logId:
|
|
1178
|
+
logId: z11.string().uuid().describe("Failure log ID")
|
|
1044
1179
|
}
|
|
1045
1180
|
},
|
|
1046
1181
|
async ({ logId }) => callApi("GET", `failure-logs/${logId}`)
|
|
@@ -1051,8 +1186,8 @@ function registerLogTools(server, callApi) {
|
|
|
1051
1186
|
title: "Process Failure Log",
|
|
1052
1187
|
description: "Process a single failure log: RETRY (re-execute with original payload), RESOLVE (mark as manually fixed), or IGNORE (skip intentionally).",
|
|
1053
1188
|
inputSchema: {
|
|
1054
|
-
logId:
|
|
1055
|
-
action:
|
|
1189
|
+
logId: z11.string().uuid().describe("Failure log ID"),
|
|
1190
|
+
action: z11.enum(FailureAction).describe("Action to take")
|
|
1056
1191
|
}
|
|
1057
1192
|
},
|
|
1058
1193
|
async ({ logId, action }) => callApi("POST", `failure-logs/${logId}/actions`, {
|
|
@@ -1065,8 +1200,8 @@ function registerLogTools(server, callApi) {
|
|
|
1065
1200
|
title: "Bulk Process Failure Logs",
|
|
1066
1201
|
description: "Process multiple failure logs at once. Provide an array of log IDs and the action.",
|
|
1067
1202
|
inputSchema: {
|
|
1068
|
-
logIds:
|
|
1069
|
-
action:
|
|
1203
|
+
logIds: z11.array(z11.string().uuid()).describe("Array of failure log IDs"),
|
|
1204
|
+
action: z11.enum(FailureAction).describe("Action to apply to all logs")
|
|
1070
1205
|
}
|
|
1071
1206
|
},
|
|
1072
1207
|
async ({ logIds, action }) => callApi("POST", "failure-logs/bulk-actions", {
|
|
@@ -1076,7 +1211,7 @@ function registerLogTools(server, callApi) {
|
|
|
1076
1211
|
}
|
|
1077
1212
|
|
|
1078
1213
|
// src/mcp/tools/webhook-subscriptions.ts
|
|
1079
|
-
import { z as
|
|
1214
|
+
import { z as z12 } from "zod";
|
|
1080
1215
|
function registerWebhookSubscriptionTools(server, callApi) {
|
|
1081
1216
|
server.registerTool(
|
|
1082
1217
|
"lexq_webhook_subscriptions_list",
|
|
@@ -1084,8 +1219,8 @@ function registerWebhookSubscriptionTools(server, callApi) {
|
|
|
1084
1219
|
title: "List Webhook Subscriptions",
|
|
1085
1220
|
description: "List platform event webhook subscriptions. These receive deployment lifecycle notifications (publish, deploy, rollback, undeploy).",
|
|
1086
1221
|
inputSchema: {
|
|
1087
|
-
page:
|
|
1088
|
-
size:
|
|
1222
|
+
page: z12.number().int().min(0).default(0).describe("Page number"),
|
|
1223
|
+
size: z12.number().int().min(1).max(100).default(20).describe("Page size")
|
|
1089
1224
|
}
|
|
1090
1225
|
},
|
|
1091
1226
|
async ({ page, size }) => {
|
|
@@ -1099,7 +1234,7 @@ function registerWebhookSubscriptionTools(server, callApi) {
|
|
|
1099
1234
|
title: "Get Webhook Subscription",
|
|
1100
1235
|
description: "Get webhook subscription detail by ID.",
|
|
1101
1236
|
inputSchema: {
|
|
1102
|
-
id:
|
|
1237
|
+
id: z12.string().uuid().describe("Webhook subscription ID")
|
|
1103
1238
|
}
|
|
1104
1239
|
},
|
|
1105
1240
|
async ({ id }) => callApi("GET", `webhook-subscriptions/${id}`)
|
|
@@ -1110,13 +1245,13 @@ function registerWebhookSubscriptionTools(server, callApi) {
|
|
|
1110
1245
|
title: "Save Webhook Subscription",
|
|
1111
1246
|
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": "..."}).',
|
|
1112
1247
|
inputSchema: {
|
|
1113
|
-
id:
|
|
1114
|
-
name:
|
|
1115
|
-
webhookUrl:
|
|
1116
|
-
subscribedEvents:
|
|
1117
|
-
payloadFormat:
|
|
1118
|
-
secret:
|
|
1119
|
-
isActive:
|
|
1248
|
+
id: z12.string().uuid().optional().describe("Subscription ID (omit to create, provide to update)"),
|
|
1249
|
+
name: z12.string().min(1).describe("Subscription name (unique per tenant)"),
|
|
1250
|
+
webhookUrl: z12.string().url().describe("Webhook endpoint URL"),
|
|
1251
|
+
subscribedEvents: z12.array(z12.enum(PlatformEventType)).min(1).describe("Events to subscribe to"),
|
|
1252
|
+
payloadFormat: z12.enum(WebhookPayloadFormat).optional().default("GENERIC").describe("Payload format"),
|
|
1253
|
+
secret: z12.string().optional().describe("HMAC-SHA256 signing secret"),
|
|
1254
|
+
isActive: z12.boolean().optional().default(true).describe("Whether the subscription is active")
|
|
1120
1255
|
}
|
|
1121
1256
|
},
|
|
1122
1257
|
async ({ ...body }) => callApi("POST", "webhook-subscriptions", { body })
|
|
@@ -1127,7 +1262,7 @@ function registerWebhookSubscriptionTools(server, callApi) {
|
|
|
1127
1262
|
title: "Delete Webhook Subscription",
|
|
1128
1263
|
description: "Delete a webhook subscription by ID.",
|
|
1129
1264
|
inputSchema: {
|
|
1130
|
-
id:
|
|
1265
|
+
id: z12.string().uuid().describe("Webhook subscription ID")
|
|
1131
1266
|
}
|
|
1132
1267
|
},
|
|
1133
1268
|
async ({ id }) => callApi("DELETE", `webhook-subscriptions/${id}`)
|
|
@@ -1138,7 +1273,7 @@ function registerWebhookSubscriptionTools(server, callApi) {
|
|
|
1138
1273
|
title: "Test Webhook Subscription",
|
|
1139
1274
|
description: "Send a test event to verify webhook connectivity. Returns the HTTP status code and success/failure message.",
|
|
1140
1275
|
inputSchema: {
|
|
1141
|
-
id:
|
|
1276
|
+
id: z12.string().uuid().describe("Webhook subscription ID")
|
|
1142
1277
|
}
|
|
1143
1278
|
},
|
|
1144
1279
|
async ({ id }) => callApi("POST", `webhook-subscriptions/${id}/test`)
|
|
@@ -1146,7 +1281,7 @@ function registerWebhookSubscriptionTools(server, callApi) {
|
|
|
1146
1281
|
}
|
|
1147
1282
|
|
|
1148
1283
|
// src/mcp/tools/domain-templates.ts
|
|
1149
|
-
import { z as
|
|
1284
|
+
import { z as z13 } from "zod";
|
|
1150
1285
|
function registerDomainTemplateTools(server, callApi) {
|
|
1151
1286
|
server.registerTool(
|
|
1152
1287
|
"lexq_domain_templates_list",
|
|
@@ -1163,7 +1298,7 @@ function registerDomainTemplateTools(server, callApi) {
|
|
|
1163
1298
|
title: "Preview Domain Template",
|
|
1164
1299
|
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.",
|
|
1165
1300
|
inputSchema: {
|
|
1166
|
-
template:
|
|
1301
|
+
template: z13.string().describe(
|
|
1167
1302
|
"Domain template key (e.g. ECOMMERCE). Use lexq_domain_templates_list to see available keys \u2014 currently only ECOMMERCE is ACTIVE."
|
|
1168
1303
|
)
|
|
1169
1304
|
}
|
|
@@ -1176,8 +1311,8 @@ function registerDomainTemplateTools(server, callApi) {
|
|
|
1176
1311
|
title: "Apply Domain Template",
|
|
1177
1312
|
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.",
|
|
1178
1313
|
inputSchema: {
|
|
1179
|
-
template:
|
|
1180
|
-
customName:
|
|
1314
|
+
template: z13.string().describe("Domain template key to apply (e.g. ECOMMERCE)."),
|
|
1315
|
+
customName: z13.string().optional().describe(
|
|
1181
1316
|
"Optional custom name for the policy group that gets created. If omitted, the template's default name is used."
|
|
1182
1317
|
)
|
|
1183
1318
|
}
|
|
@@ -1199,7 +1334,9 @@ function registerAllTools(server, callApi) {
|
|
|
1199
1334
|
registerFactTools(server, callApi);
|
|
1200
1335
|
registerDeployTools(server, callApi);
|
|
1201
1336
|
registerAnalyticsTools(server, callApi);
|
|
1337
|
+
registerReplayTools(server, callApi);
|
|
1202
1338
|
registerHistoryTools(server, callApi);
|
|
1339
|
+
registerProvenanceTools(server, callApi);
|
|
1203
1340
|
registerIntegrationTools(server, callApi);
|
|
1204
1341
|
registerLogTools(server, callApi);
|
|
1205
1342
|
registerDomainTemplateTools(server, callApi);
|