@codazen/harmonica-mcp 4.2.0 → 4.3.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.
Files changed (2) hide show
  1. package/dist/index.js +24 -11
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -26938,6 +26938,8 @@ var StartSessionRequestBodySchema = external_exports.object({
26938
26938
  systemId: external_exports.string().min(1),
26939
26939
  message: external_exports.string().min(1),
26940
26940
  revisionId: external_exports.string().min(1).optional(),
26941
+ /** Caller's own Session id — nests the new Session under it (B-231). */
26942
+ parentSessionId: external_exports.string().min(1).optional(),
26941
26943
  enableWebSearch: external_exports.boolean().optional()
26942
26944
  });
26943
26945
  var StartSessionResponseSchema = external_exports.object({
@@ -32316,16 +32318,20 @@ ${JSON.stringify(task.result, null, 2)}
32316
32318
  {
32317
32319
  systemId: external_exports.string().min(1).describe("The system ID \u2014 the trusted scope the session is rooted at"),
32318
32320
  message: external_exports.string().min(1).describe("Free-form first message describing what the session should do"),
32319
- revisionId: external_exports.string().min(1).optional().describe("Optional Revision ID (rev-<uuid>). When provided, the Worker routes to the typed implementation session path (prepareRevisionImplementationSession), enabling file hint generation and richer session context. Omit for investigation, planning, or freeform sessions.")
32321
+ revisionId: external_exports.string().min(1).optional().describe("Optional Revision ID (rev-<uuid>). When provided, the Worker routes to the typed implementation session path (prepareRevisionImplementationSession), enabling file hint generation and richer session context. Omit for investigation, planning, or freeform sessions."),
32322
+ parentSessionId: external_exports.string().min(1).optional().describe("Your current Session ID (sess-<uuid>). Pass it when you are kicking off this session as part of your own work \u2014 the new session then nests under yours in the session tree and can report back to you. Omit for a standalone session.")
32320
32323
  },
32321
- async ({ systemId, message, revisionId }) => {
32324
+ async ({ systemId, message, revisionId, parentSessionId }) => {
32322
32325
  try {
32323
32326
  await assertSystemInOrg(client, systemId, ctx.orgId);
32324
32327
  const task = await client.startSession(
32325
32328
  systemId,
32326
32329
  message,
32327
32330
  { name: ctx.user.name, email: ctx.user.email },
32328
- revisionId?.trim() ? { revisionId: revisionId.trim() } : void 0
32331
+ revisionId?.trim() || parentSessionId?.trim() ? {
32332
+ ...revisionId?.trim() && { revisionId: revisionId.trim() },
32333
+ ...parentSessionId?.trim() && { parentSessionId: parentSessionId.trim() }
32334
+ } : void 0
32329
32335
  );
32330
32336
  return {
32331
32337
  content: [{
@@ -32908,7 +32914,7 @@ function createHttpClient(config2) {
32908
32914
  );
32909
32915
  const system = result?.system ? {
32910
32916
  ...result.system,
32911
- systemId: result.system.id ?? result.system.systemId ?? result.system.projectId,
32917
+ systemId: result.system.id ?? result.system.systemId,
32912
32918
  title: result.system.name ?? result.system.title,
32913
32919
  orgId: result.system.organizationId ?? result.system.orgId
32914
32920
  } : void 0;
@@ -32921,14 +32927,14 @@ function createHttpClient(config2) {
32921
32927
  // Systems (canonical)
32922
32928
  listOrgSystems: async (orgId) => {
32923
32929
  const raw = await request("GET", `/api/organizations/${encodeURIComponent(orgId)}/systems/summaries`);
32924
- return (raw ?? []).map((p) => ({ ...p, systemId: p.id, projectId: p.id, title: p.name, orgId: p.organizationId }));
32930
+ return (raw ?? []).map((p) => ({ ...p, systemId: p.id, title: p.name, orgId: p.organizationId }));
32925
32931
  },
32926
32932
  getSystem: async (systemId) => {
32927
32933
  const raw = await request("GET", `/api/systems/${encodeURIComponent(systemId)}`);
32928
32934
  if (!raw) return void 0;
32929
32935
  return {
32930
32936
  ...raw,
32931
- systemId: raw.id ?? raw.systemId ?? raw.projectId,
32937
+ systemId: raw.id ?? raw.systemId,
32932
32938
  title: raw.name ?? raw.title,
32933
32939
  orgId: raw.organizationId ?? raw.orgId
32934
32940
  };
@@ -32944,17 +32950,17 @@ function createHttpClient(config2) {
32944
32950
  // is created unlinked — invisible in the Account's Systems list.
32945
32951
  ...input.accountId !== void 0 && { accountId: input.accountId }
32946
32952
  });
32947
- return { ...raw, systemId: raw?.id ?? raw?.systemId ?? raw?.projectId, title: raw?.name ?? raw?.title, orgId: raw?.organizationId ?? raw?.orgId };
32953
+ return { ...raw, systemId: raw?.id ?? raw?.systemId, title: raw?.name ?? raw?.title, orgId: raw?.organizationId ?? raw?.orgId };
32948
32954
  },
32949
32955
  updateSystem: async (systemId, updates) => {
32950
32956
  const raw = await request("PATCH", `/api/systems/${encodeURIComponent(systemId)}`, updates);
32951
32957
  if (!raw) return void 0;
32952
- return { ...raw, systemId: raw.id ?? raw.systemId ?? raw.projectId, title: raw.name ?? raw.title, orgId: raw.organizationId ?? raw.orgId };
32958
+ return { ...raw, systemId: raw.id ?? raw.systemId, title: raw.name ?? raw.title, orgId: raw.organizationId ?? raw.orgId };
32953
32959
  },
32954
32960
  archiveSystem: async (systemId) => {
32955
32961
  const raw = await request("PATCH", `/api/systems/${encodeURIComponent(systemId)}/archive`);
32956
32962
  if (!raw) return void 0;
32957
- return { ...raw, systemId: raw.id ?? raw.systemId ?? raw.projectId, title: raw.name ?? raw.title, orgId: raw.organizationId ?? raw.orgId };
32963
+ return { ...raw, systemId: raw.id ?? raw.systemId, title: raw.name ?? raw.title, orgId: raw.organizationId ?? raw.orgId };
32958
32964
  },
32959
32965
  getSystemFact: async (systemId) => {
32960
32966
  const result = await request("GET", `/api/systems/${encodeURIComponent(systemId)}/facts`);
@@ -33917,10 +33923,17 @@ function createHttpClient(config2) {
33917
33923
  // Agent sessions
33918
33924
  startSession: async (systemId, message, triggeredBy, options) => {
33919
33925
  const trimmedRevisionId = options?.revisionId?.trim();
33926
+ const trimmedParentSessionId = options?.parentSessionId?.trim();
33920
33927
  const result = await request(
33921
33928
  "POST",
33922
33929
  `/api/sessions`,
33923
- { systemId, message, ...triggeredBy && { triggeredBy }, ...trimmedRevisionId && { revisionId: trimmedRevisionId } }
33930
+ {
33931
+ systemId,
33932
+ message,
33933
+ ...triggeredBy && { triggeredBy },
33934
+ ...trimmedRevisionId && { revisionId: trimmedRevisionId },
33935
+ ...trimmedParentSessionId && { parentSessionId: trimmedParentSessionId }
33936
+ }
33924
33937
  );
33925
33938
  if (!result?.taskId) throw new Error("Start session enqueue failed: no taskId returned");
33926
33939
  return { taskId: result.taskId, taskType: "generic_session", status: result.status ?? "pending", systemId, createdAt: (/* @__PURE__ */ new Date()).toISOString() };
@@ -35030,7 +35043,7 @@ function loadConfig() {
35030
35043
  };
35031
35044
  }
35032
35045
  async function main() {
35033
- console.error(`[harmonica-mcp] v${"4.2.0"} starting\u2026`);
35046
+ console.error(`[harmonica-mcp] v${"4.3.1"} starting\u2026`);
35034
35047
  const config2 = loadConfig();
35035
35048
  const client = createHttpClient({
35036
35049
  apiBaseUrl: config2.apiBaseUrl,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codazen/harmonica-mcp",
3
- "version": "4.2.0",
3
+ "version": "4.3.1",
4
4
  "description": "MCP server for Harmonica — connect any MCP-compatible AI assistant to Harmonica",
5
5
  "license": "MIT",
6
6
  "bin": {