@codazen/harmonica-mcp 3.7.0 → 3.7.1
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 +72 -39
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -26216,25 +26216,35 @@ var NoteStatusSchema = external_exports.enum([
|
|
|
26216
26216
|
]);
|
|
26217
26217
|
var SystemStatusSchema = external_exports.enum(["active", "archived", "draft"]);
|
|
26218
26218
|
var ChangeImportanceSchema = external_exports.enum(["minor", "moderate", "major"]);
|
|
26219
|
-
var BeatApiSchema = external_exports.
|
|
26220
|
-
|
|
26221
|
-
|
|
26222
|
-
|
|
26223
|
-
|
|
26224
|
-
|
|
26225
|
-
|
|
26226
|
-
|
|
26227
|
-
|
|
26228
|
-
|
|
26229
|
-
|
|
26230
|
-
|
|
26231
|
-
|
|
26232
|
-
|
|
26233
|
-
|
|
26234
|
-
|
|
26235
|
-
|
|
26236
|
-
|
|
26237
|
-
|
|
26219
|
+
var BeatApiSchema = external_exports.preprocess(
|
|
26220
|
+
(raw) => {
|
|
26221
|
+
if (typeof raw !== "object" || raw === null) return raw;
|
|
26222
|
+
const b = raw;
|
|
26223
|
+
const id = b["systemId"] ?? b["projectId"];
|
|
26224
|
+
if (!id) return raw;
|
|
26225
|
+
return { ...b, systemId: id, projectId: id };
|
|
26226
|
+
},
|
|
26227
|
+
external_exports.object({
|
|
26228
|
+
beatId: external_exports.string(),
|
|
26229
|
+
systemId: external_exports.string(),
|
|
26230
|
+
projectId: external_exports.string(),
|
|
26231
|
+
/** Source project's title; attached by the flat /api/beats endpoint for
|
|
26232
|
+
* multi-project (teamspace/org) responses. */
|
|
26233
|
+
projectName: external_exports.string().nullish(),
|
|
26234
|
+
title: external_exports.string(),
|
|
26235
|
+
version: external_exports.number().nullish(),
|
|
26236
|
+
description: external_exports.string().nullish(),
|
|
26237
|
+
beatStatus: BeatStatusSchema.nullish(),
|
|
26238
|
+
tags: external_exports.array(external_exports.string()).nullish(),
|
|
26239
|
+
priority: external_exports.number().nullish(),
|
|
26240
|
+
estimatedEffort: external_exports.string().nullish(),
|
|
26241
|
+
humanAssignee: HumanAssigneeSchema.nullish(),
|
|
26242
|
+
agentAssignee: AgentAssigneeSchema.nullish(),
|
|
26243
|
+
revisionCount: external_exports.number().nullish(),
|
|
26244
|
+
createdAt: external_exports.string(),
|
|
26245
|
+
updatedAt: external_exports.string()
|
|
26246
|
+
}).passthrough()
|
|
26247
|
+
);
|
|
26238
26248
|
var RevisionScmSchema = external_exports.object({
|
|
26239
26249
|
provider: external_exports.literal("github"),
|
|
26240
26250
|
number: external_exports.string(),
|
|
@@ -26865,21 +26875,31 @@ var AccountSystemApiSchema = external_exports.object({
|
|
|
26865
26875
|
var AccountSystemsResponseSchema = external_exports.object({ systems: external_exports.array(AccountSystemApiSchema) }).passthrough();
|
|
26866
26876
|
var LAYER_STATUSES = ["active", "archived"];
|
|
26867
26877
|
var LayerStatusApiSchema = external_exports.enum(LAYER_STATUSES);
|
|
26868
|
-
var LayerApiSchema = external_exports.
|
|
26869
|
-
|
|
26870
|
-
|
|
26871
|
-
|
|
26872
|
-
|
|
26873
|
-
|
|
26874
|
-
|
|
26875
|
-
|
|
26876
|
-
|
|
26877
|
-
|
|
26878
|
-
|
|
26879
|
-
|
|
26880
|
-
|
|
26881
|
-
|
|
26882
|
-
|
|
26878
|
+
var LayerApiSchema = external_exports.preprocess(
|
|
26879
|
+
(raw) => {
|
|
26880
|
+
if (typeof raw !== "object" || raw === null) return raw;
|
|
26881
|
+
const l = raw;
|
|
26882
|
+
const id = l["systemId"] ?? l["projectId"];
|
|
26883
|
+
if (!id) return raw;
|
|
26884
|
+
return { ...l, systemId: id, projectId: id };
|
|
26885
|
+
},
|
|
26886
|
+
external_exports.object({
|
|
26887
|
+
layerId: external_exports.string(),
|
|
26888
|
+
systemId: external_exports.string(),
|
|
26889
|
+
projectId: external_exports.string(),
|
|
26890
|
+
layerKey: external_exports.string(),
|
|
26891
|
+
name: external_exports.string(),
|
|
26892
|
+
description: external_exports.string().nullish(),
|
|
26893
|
+
parentLayerId: external_exports.string().nullish(),
|
|
26894
|
+
repoPatterns: external_exports.array(external_exports.string()).nullish(),
|
|
26895
|
+
status: LayerStatusApiSchema,
|
|
26896
|
+
archivedAt: external_exports.string().nullish(),
|
|
26897
|
+
createdBy: external_exports.string().nullish(),
|
|
26898
|
+
version: external_exports.number().nullish(),
|
|
26899
|
+
createdAt: external_exports.string(),
|
|
26900
|
+
updatedAt: external_exports.string()
|
|
26901
|
+
}).passthrough()
|
|
26902
|
+
);
|
|
26883
26903
|
var LayersResponseSchema = external_exports.object({ layers: external_exports.array(LayerApiSchema) }).passthrough();
|
|
26884
26904
|
var LAYER_RUBRIC_SCOPES_LIST = ["account", "teamspace", "movement"];
|
|
26885
26905
|
var LayerRubricScopeApiSchema = external_exports.enum(LAYER_RUBRIC_SCOPES_LIST);
|
|
@@ -29322,17 +29342,25 @@ function registerRevisionLifecycleTools(server, ctx, client) {
|
|
|
29322
29342
|
if (!beat) {
|
|
29323
29343
|
return { content: [{ type: "text", text: `Beat not found: "${beatId}"` }], isError: true };
|
|
29324
29344
|
}
|
|
29345
|
+
const beatSystemId = beat.systemId ?? beat.projectId;
|
|
29346
|
+
if (!beatSystemId) {
|
|
29347
|
+
return { content: [{ type: "text", text: `Beat "${beatId}" has no system identifier \u2014 record may be corrupt.` }], isError: true };
|
|
29348
|
+
}
|
|
29325
29349
|
let parentBv;
|
|
29326
29350
|
if (beatVersionId !== void 0) {
|
|
29327
29351
|
parentBv = await client.getBeatVersion(beatVersionId);
|
|
29328
29352
|
if (!parentBv) {
|
|
29329
29353
|
return { content: [{ type: "text", text: `Beat Version not found: "${beatVersionId}"` }], isError: true };
|
|
29330
29354
|
}
|
|
29331
|
-
|
|
29355
|
+
const bvSystemId = parentBv.systemId ?? parentBv.projectId;
|
|
29356
|
+
if (!bvSystemId) {
|
|
29357
|
+
return { content: [{ type: "text", text: `Beat Version "${beatVersionId}" has no system identifier \u2014 record may be corrupt.` }], isError: true };
|
|
29358
|
+
}
|
|
29359
|
+
if (parentBv.beatId !== beat.beatId || bvSystemId !== beatSystemId) {
|
|
29332
29360
|
return { content: [{ type: "text", text: `Beat Version "${beatVersionId}" belongs to a different Beat.` }], isError: true };
|
|
29333
29361
|
}
|
|
29334
29362
|
}
|
|
29335
|
-
const { revision, warnings } = await client.createRevision(beat.
|
|
29363
|
+
const { revision, warnings } = await client.createRevision(beatSystemId, beat.beatId, {
|
|
29336
29364
|
title,
|
|
29337
29365
|
description,
|
|
29338
29366
|
changeSummary,
|
|
@@ -29420,7 +29448,12 @@ function registerRevisionLifecycleTools(server, ctx, client) {
|
|
|
29420
29448
|
if (!bv) {
|
|
29421
29449
|
return { content: [{ type: "text", text: `Beat Version not found: "${beatVersionId}"` }], isError: true };
|
|
29422
29450
|
}
|
|
29423
|
-
|
|
29451
|
+
const bvSystemId = bv.systemId ?? bv.projectId;
|
|
29452
|
+
const revSystemId = revision.systemId ?? revision.projectId;
|
|
29453
|
+
if (!bvSystemId || !revSystemId) {
|
|
29454
|
+
return { content: [{ type: "text", text: `Beat Version "${beatVersionId}" has no system identifier \u2014 record may be corrupt.` }], isError: true };
|
|
29455
|
+
}
|
|
29456
|
+
if (bv.beatId !== revision.beatId || bvSystemId !== revSystemId) {
|
|
29424
29457
|
return { content: [{ type: "text", text: `Beat Version "${beatVersionId}" belongs to a different Beat.` }], isError: true };
|
|
29425
29458
|
}
|
|
29426
29459
|
}
|
|
@@ -33182,7 +33215,7 @@ function createHttpClient(config2) {
|
|
|
33182
33215
|
const result = await request(
|
|
33183
33216
|
"POST",
|
|
33184
33217
|
`/api/sessions`,
|
|
33185
|
-
{ projectId, message, ...triggeredBy && { triggeredBy }, ...trimmedRevisionId && { revisionId: trimmedRevisionId } }
|
|
33218
|
+
{ systemId: projectId, message, ...triggeredBy && { triggeredBy }, ...trimmedRevisionId && { revisionId: trimmedRevisionId } }
|
|
33186
33219
|
);
|
|
33187
33220
|
if (!result?.taskId) throw new Error("Start session enqueue failed: no taskId returned");
|
|
33188
33221
|
return { taskId: result.taskId, taskType: "generic_session", status: result.status ?? "pending", systemId: projectId, createdAt: (/* @__PURE__ */ new Date()).toISOString() };
|
|
@@ -34161,7 +34194,7 @@ function loadConfig() {
|
|
|
34161
34194
|
};
|
|
34162
34195
|
}
|
|
34163
34196
|
async function main() {
|
|
34164
|
-
console.error(`[harmonica-mcp] v${"3.7.
|
|
34197
|
+
console.error(`[harmonica-mcp] v${"3.7.1"} starting\u2026`);
|
|
34165
34198
|
const config2 = loadConfig();
|
|
34166
34199
|
const client = createHttpClient({
|
|
34167
34200
|
apiBaseUrl: config2.apiBaseUrl,
|