@codazen/harmonica-mcp 0.30.0 → 0.31.0
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 +89 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -22877,20 +22877,98 @@ function registerCheckTools(server, ctx, client) {
|
|
|
22877
22877
|
);
|
|
22878
22878
|
server.tool(
|
|
22879
22879
|
"list_checks",
|
|
22880
|
-
"List persisted checks for a project, beat, or revision. Shows score trends over time. Filter by check type.",
|
|
22880
|
+
"List persisted checks for a project, beat, beat version, or revision. Shows score trends over time. Filter by check type.",
|
|
22881
22881
|
{
|
|
22882
22882
|
projectId: external_exports.string().describe("The project ID"),
|
|
22883
22883
|
beatId: external_exports.string().optional().describe("List checks for this specific beat"),
|
|
22884
|
+
beatVersionId: external_exports.string().optional().describe("List checks for this specific beat version"),
|
|
22884
22885
|
revisionId: external_exports.string().optional().describe("List checks for this specific revision"),
|
|
22885
22886
|
checkType: external_exports.enum(["beat_quality", "plan_quality", "build_quality", "pii_scan", "portfolio_coherence"]).optional().describe("Filter by check type")
|
|
22886
22887
|
},
|
|
22887
|
-
async ({ projectId, beatId, revisionId, checkType }) => {
|
|
22888
|
+
async ({ projectId, beatId, beatVersionId, revisionId, checkType }) => {
|
|
22888
22889
|
try {
|
|
22890
|
+
const filters = [
|
|
22891
|
+
revisionId ? "revisionId" : null,
|
|
22892
|
+
beatVersionId ? "beatVersionId" : null,
|
|
22893
|
+
beatId ? "beatId" : null
|
|
22894
|
+
].filter(Boolean);
|
|
22895
|
+
if (filters.length > 1) {
|
|
22896
|
+
return {
|
|
22897
|
+
content: [{
|
|
22898
|
+
type: "text",
|
|
22899
|
+
text: `Only one of revisionId, beatVersionId, beatId may be supplied (got: ${filters.join(", ")}). Pick the target scope and resend.`
|
|
22900
|
+
}],
|
|
22901
|
+
isError: true
|
|
22902
|
+
};
|
|
22903
|
+
}
|
|
22904
|
+
if (revisionId) {
|
|
22905
|
+
if (revisionId.startsWith("bv-")) {
|
|
22906
|
+
return {
|
|
22907
|
+
content: [{
|
|
22908
|
+
type: "text",
|
|
22909
|
+
text: "revisionId must start with 'rev-', got a Beat Version ID (bv-prefix). Use beatVersionId parameter instead."
|
|
22910
|
+
}],
|
|
22911
|
+
isError: true
|
|
22912
|
+
};
|
|
22913
|
+
}
|
|
22914
|
+
if (!revisionId.startsWith("rev-")) {
|
|
22915
|
+
return {
|
|
22916
|
+
content: [{
|
|
22917
|
+
type: "text",
|
|
22918
|
+
text: `revisionId must start with 'rev-', got '${revisionId}'. Pass the full Revision UUID (rev-xxxxxxxx-...).`
|
|
22919
|
+
}],
|
|
22920
|
+
isError: true
|
|
22921
|
+
};
|
|
22922
|
+
}
|
|
22923
|
+
}
|
|
22924
|
+
if (beatVersionId) {
|
|
22925
|
+
if (beatVersionId.startsWith("rev-")) {
|
|
22926
|
+
return {
|
|
22927
|
+
content: [{
|
|
22928
|
+
type: "text",
|
|
22929
|
+
text: "beatVersionId must start with 'bv-', got a Revision ID (rev-prefix). Use revisionId parameter instead."
|
|
22930
|
+
}],
|
|
22931
|
+
isError: true
|
|
22932
|
+
};
|
|
22933
|
+
}
|
|
22934
|
+
if (!beatVersionId.startsWith("bv-")) {
|
|
22935
|
+
return {
|
|
22936
|
+
content: [{
|
|
22937
|
+
type: "text",
|
|
22938
|
+
text: `beatVersionId must start with 'bv-', got '${beatVersionId}'. Pass the full Beat Version UUID (bv-xxxxxxxx-...).`
|
|
22939
|
+
}],
|
|
22940
|
+
isError: true
|
|
22941
|
+
};
|
|
22942
|
+
}
|
|
22943
|
+
}
|
|
22944
|
+
if (beatId) {
|
|
22945
|
+
if (beatId.startsWith("rev-")) {
|
|
22946
|
+
return {
|
|
22947
|
+
content: [{
|
|
22948
|
+
type: "text",
|
|
22949
|
+
text: "beatId must not be a Revision ID (rev-prefix). Use revisionId parameter instead."
|
|
22950
|
+
}],
|
|
22951
|
+
isError: true
|
|
22952
|
+
};
|
|
22953
|
+
}
|
|
22954
|
+
if (beatId.startsWith("bv-")) {
|
|
22955
|
+
return {
|
|
22956
|
+
content: [{
|
|
22957
|
+
type: "text",
|
|
22958
|
+
text: "beatId must not be a Beat Version ID (bv-prefix). Use beatVersionId parameter instead."
|
|
22959
|
+
}],
|
|
22960
|
+
isError: true
|
|
22961
|
+
};
|
|
22962
|
+
}
|
|
22963
|
+
}
|
|
22889
22964
|
let checks;
|
|
22890
22965
|
let scope;
|
|
22891
22966
|
if (revisionId) {
|
|
22892
22967
|
checks = await client.listRevisionChecks(revisionId, projectId, checkType);
|
|
22893
22968
|
scope = `revision ${revisionId}`;
|
|
22969
|
+
} else if (beatVersionId) {
|
|
22970
|
+
checks = await client.listBeatVersionChecks(beatVersionId, projectId, checkType);
|
|
22971
|
+
scope = `beat_version ${beatVersionId}`;
|
|
22894
22972
|
} else if (beatId) {
|
|
22895
22973
|
checks = await client.listBeatChecks(beatId, projectId, checkType);
|
|
22896
22974
|
scope = `beat ${beatId}`;
|
|
@@ -27450,6 +27528,14 @@ function createHttpClient(config2) {
|
|
|
27450
27528
|
);
|
|
27451
27529
|
return res.checks;
|
|
27452
27530
|
},
|
|
27531
|
+
listBeatVersionChecks: async (beatVersionId, projectId, checkType) => {
|
|
27532
|
+
const qs = checkType ? `?type=${encodeURIComponent(checkType)}` : "";
|
|
27533
|
+
const res = await request(
|
|
27534
|
+
"GET",
|
|
27535
|
+
`/api/projects/${encodeURIComponent(projectId)}/beat-versions/${encodeURIComponent(beatVersionId)}/checks${qs}`
|
|
27536
|
+
);
|
|
27537
|
+
return res.checks;
|
|
27538
|
+
},
|
|
27453
27539
|
listDropChecks: async (dropId, _projectId, checkType) => {
|
|
27454
27540
|
const qs = checkType ? `?type=${encodeURIComponent(checkType)}` : "";
|
|
27455
27541
|
const res = await request(
|
|
@@ -27697,7 +27783,7 @@ function loadConfig() {
|
|
|
27697
27783
|
};
|
|
27698
27784
|
}
|
|
27699
27785
|
async function main() {
|
|
27700
|
-
console.error(`[harmonica-mcp] v${"0.
|
|
27786
|
+
console.error(`[harmonica-mcp] v${"0.31.0"} starting\u2026`);
|
|
27701
27787
|
const config2 = loadConfig();
|
|
27702
27788
|
const client = createHttpClient({
|
|
27703
27789
|
apiBaseUrl: config2.apiBaseUrl,
|