@codazen/harmonica-mcp 3.0.1 → 3.1.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.
Files changed (2) hide show
  1. package/dist/index.js +51 -6
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -26862,7 +26862,7 @@ var EligibleBeatVersionForDropSchema = external_exports.object({
26862
26862
  createdAt: external_exports.string(),
26863
26863
  updatedAt: external_exports.string(),
26864
26864
  humanAssignee: external_exports.object({ email: external_exports.string(), name: external_exports.string() }).optional(),
26865
- currentDropAssignment: external_exports.object({ dropId: external_exports.string(), dropCode: external_exports.string(), state: external_exports.string() }).optional()
26865
+ currentDropAssignment: external_exports.object({ dropId: external_exports.string(), dropCode: external_exports.string().optional(), state: external_exports.string() }).optional()
26866
26866
  }).passthrough();
26867
26867
  var ScoredDropCandidateSchema = external_exports.object({
26868
26868
  bv: EligibleBeatVersionForDropSchema,
@@ -26879,6 +26879,34 @@ var ScoredDropCandidateSchema = external_exports.object({
26879
26879
  atRisk: external_exports.boolean(),
26880
26880
  requiredSlope: external_exports.number().nullable().optional()
26881
26881
  }).passthrough();
26882
+ var DUTY_ALTITUDES = ["portfolio", "system", "account"];
26883
+ var DUTY_HOLDER_TYPES = ["human", "agent"];
26884
+ var DUTY_MODES = ["accountable", "responsible"];
26885
+ var DutyAltitudeApiSchema = external_exports.enum(DUTY_ALTITUDES);
26886
+ var DutyHolderTypeApiSchema = external_exports.enum(DUTY_HOLDER_TYPES);
26887
+ var DutyModeApiSchema = external_exports.enum(DUTY_MODES);
26888
+ var DerivedStaffingStateApiSchema = external_exports.enum(["agent-held", "supported", "observed"]);
26889
+ var DutyAssignmentApiSchema = external_exports.object({
26890
+ dutyAssignmentId: external_exports.string(),
26891
+ accountId: external_exports.string(),
26892
+ orgId: external_exports.string(),
26893
+ role: external_exports.string(),
26894
+ altitude: DutyAltitudeApiSchema,
26895
+ scopeId: external_exports.string(),
26896
+ holderType: DutyHolderTypeApiSchema,
26897
+ holderId: external_exports.string(),
26898
+ supportingAssistantId: external_exports.string().optional(),
26899
+ mode: DutyModeApiSchema,
26900
+ parentDutyAssignmentId: external_exports.string().optional(),
26901
+ effectiveFrom: external_exports.string(),
26902
+ effectiveTo: external_exports.string().optional(),
26903
+ createdBy: external_exports.string().optional(),
26904
+ version: external_exports.number().optional(),
26905
+ createdAt: external_exports.string(),
26906
+ updatedAt: external_exports.string()
26907
+ }).passthrough();
26908
+ var DutyAssignmentsResponseSchema = external_exports.object({ dutyAssignments: external_exports.array(DutyAssignmentApiSchema).optional() }).passthrough();
26909
+ var DutyAssignmentResponseSchema = external_exports.object({ dutyAssignment: DutyAssignmentApiSchema }).passthrough();
26882
26910
  var DropProposalApiSchema = external_exports.object({
26883
26911
  accountId: external_exports.string(),
26884
26912
  revisionIds: external_exports.array(external_exports.string()),
@@ -30213,6 +30241,13 @@ function registerProjectLifecycleTools(server, ctx, client) {
30213
30241
 
30214
30242
  // ../../libs/harmonica-services/src/mcp/tools/system-tools.ts
30215
30243
  var import_crypto5 = require("crypto");
30244
+
30245
+ // ../../libs/harmonica-services/src/utils/normalize-create-account-id.ts
30246
+ function normalizeCreateAccountId(accountId) {
30247
+ return accountId?.trim() || void 0;
30248
+ }
30249
+
30250
+ // ../../libs/harmonica-services/src/mcp/tools/system-tools.ts
30216
30251
  function accountLine(request, resolved) {
30217
30252
  const requested = request["accountId"];
30218
30253
  if (requested === null || requested === "") return "**Account:** (unlinked)";
@@ -30366,11 +30401,12 @@ function registerProjectTools(server, ctx, client) {
30366
30401
  description: external_exports.string().optional().describe("System description"),
30367
30402
  strategy: external_exports.string().optional().describe('System strategy markdown \u2014 Org Strategy + System Strategy ("System Coda")'),
30368
30403
  teamspaceId: external_exports.string().optional().describe("Teamspace ID to associate this system with"),
30404
+ accountId: external_exports.string().optional().describe("Account that owns this System \u2014 the client or internal org unit. Set it at creation so the System appears in the Account's Systems list; omit only for a System that belongs to no Account."),
30369
30405
  repoOwner: external_exports.string().optional().describe("GitHub repository owner (org or user)"),
30370
30406
  repoName: external_exports.string().optional().describe("GitHub repository name"),
30371
30407
  repoDefaultBranch: external_exports.string().optional().describe('Default branch for code check (defaults to "main")')
30372
30408
  };
30373
- const createSystemHandler = async ({ title, description, strategy, teamspaceId, repoOwner, repoName, repoDefaultBranch }) => {
30409
+ const createSystemHandler = async ({ title, description, strategy, teamspaceId, accountId, repoOwner, repoName, repoDefaultBranch }) => {
30374
30410
  if (teamspaceId) {
30375
30411
  const teamspace = await client.getTeamspace(teamspaceId);
30376
30412
  if (!teamspace) {
@@ -30380,6 +30416,7 @@ function registerProjectTools(server, ctx, client) {
30380
30416
  return { content: [{ type: "text", text: "Teamspace does not belong to this organization" }], isError: true };
30381
30417
  }
30382
30418
  }
30419
+ const account = normalizeCreateAccountId(accountId);
30383
30420
  try {
30384
30421
  const project = await client.createSystem({
30385
30422
  projectId: (0, import_crypto5.randomUUID)(),
@@ -30390,6 +30427,7 @@ function registerProjectTools(server, ctx, client) {
30390
30427
  strategy,
30391
30428
  status: "active",
30392
30429
  teamspaceId,
30430
+ ...account !== void 0 && { accountId: account },
30393
30431
  repoOwner,
30394
30432
  repoName,
30395
30433
  repoDefaultBranch
@@ -30400,6 +30438,7 @@ function registerProjectTools(server, ctx, client) {
30400
30438
  `**ID:** ${project.projectId}`,
30401
30439
  `**Title:** ${project.title}`,
30402
30440
  `**Status:** ${project.status}`,
30441
+ project.accountId ? `**Account:** ${project.accountId}` : "",
30403
30442
  project.description ? `**Description:** ${project.description}` : "",
30404
30443
  project.repoOwner ? `**Repo:** ${project.repoOwner}/${project.repoName}` : "",
30405
30444
  project.repoDefaultBranch ? `**Default Branch:** ${project.repoDefaultBranch}` : ""
@@ -30410,7 +30449,7 @@ function registerProjectTools(server, ctx, client) {
30410
30449
  return { content: [{ type: "text", text: `Failed to create system: ${message}` }], isError: true };
30411
30450
  }
30412
30451
  };
30413
- server.tool("create_system", "Create a new system in the configured organization", createSystemSchema, createSystemHandler);
30452
+ server.tool("create_system", "Create a new system in the configured organization. Pass accountId whenever the system belongs to a client \u2014 a system created without it is not listed under any Account.", createSystemSchema, createSystemHandler);
30414
30453
  }
30415
30454
 
30416
30455
  // ../../libs/harmonica-services/src/mcp/tools/teamspace-tools.ts
@@ -31863,7 +31902,10 @@ function createHttpClient(config2) {
31863
31902
  teamspaceId: input.teamspaceId,
31864
31903
  name: input.title,
31865
31904
  description: input.description,
31866
- strategy: input.strategy
31905
+ strategy: input.strategy,
31906
+ // Without this the owning Account is dropped on the wire and the System
31907
+ // is created unlinked — invisible in the Account's Systems list.
31908
+ ...input.accountId !== void 0 && { accountId: input.accountId }
31867
31909
  });
31868
31910
  return { ...raw, projectId: raw?.id ?? raw?.projectId, title: raw?.name ?? raw?.title, orgId: raw?.organizationId ?? raw?.orgId };
31869
31911
  },
@@ -31898,7 +31940,10 @@ function createHttpClient(config2) {
31898
31940
  teamspaceId: input.teamspaceId,
31899
31941
  name: input.title,
31900
31942
  description: input.description,
31901
- strategy: input.strategy
31943
+ strategy: input.strategy,
31944
+ // Without this the owning Account is dropped on the wire and the System
31945
+ // is created unlinked — invisible in the Account's Systems list.
31946
+ ...input.accountId !== void 0 && { accountId: input.accountId }
31902
31947
  });
31903
31948
  return { ...raw, orgId: raw?.organizationId ?? raw?.orgId };
31904
31949
  },
@@ -33828,7 +33873,7 @@ function loadConfig() {
33828
33873
  };
33829
33874
  }
33830
33875
  async function main() {
33831
- console.error(`[harmonica-mcp] v${"3.0.1"} starting\u2026`);
33876
+ console.error(`[harmonica-mcp] v${"3.1.0"} starting\u2026`);
33832
33877
  const config2 = loadConfig();
33833
33878
  const client = createHttpClient({
33834
33879
  apiBaseUrl: config2.apiBaseUrl,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codazen/harmonica-mcp",
3
- "version": "3.0.1",
3
+ "version": "3.1.0",
4
4
  "description": "MCP server for Harmonica — connect any MCP-compatible AI assistant to Harmonica",
5
5
  "license": "MIT",
6
6
  "bin": {