@gethmy/mcp 2.25.0 → 2.26.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/cli.js CHANGED
@@ -1520,6 +1520,9 @@ function declaredGateMetricsFromAgents(agents) {
1520
1520
  }
1521
1521
  return { names, known };
1522
1522
  }
1523
+ // ../harmony-shared/dist/fanoutSource.js
1524
+ var FANOUT_KEY_MARKER = "harmony:fanout-item";
1525
+ var FANOUT_KEY_RE = new RegExp(`^\\[${FANOUT_KEY_MARKER}\\]:\\s*#(\\S+)\\s*$`, "m");
1523
1526
  // ../harmony-shared/dist/gateConfigError.js
1524
1527
  var GATE_CONFIG_ERROR_KEY = "configError";
1525
1528
  var GATE_CONFIG_ERROR_MARK = Object.freeze({ [GATE_CONFIG_ERROR_KEY]: true });
@@ -1947,8 +1950,12 @@ class HarmonyApiClient {
1947
1950
  async updateCard(cardId, updates) {
1948
1951
  return this.request("PATCH", `/cards/${cardId}`, updates);
1949
1952
  }
1950
- async claimCard(cardId, agentId) {
1951
- const res = await this.request("PATCH", `/cards/${cardId}`, { assignedAgentId: agentId, ifAssignedAgentNull: true });
1953
+ async claimCard(cardId, agentId, opts) {
1954
+ const res = await this.request("PATCH", `/cards/${cardId}`, {
1955
+ assignedAgentId: agentId,
1956
+ ifAssignedAgentNull: true,
1957
+ ...opts?.requireUnassigned ? { ifAssigneeNull: true } : {}
1958
+ });
1952
1959
  return { claimed: res.claimed !== false };
1953
1960
  }
1954
1961
  async moveCard(cardId, columnId, position) {
package/dist/index.js CHANGED
@@ -1515,6 +1515,9 @@ function declaredGateMetricsFromAgents(agents) {
1515
1515
  }
1516
1516
  return { names, known };
1517
1517
  }
1518
+ // ../harmony-shared/dist/fanoutSource.js
1519
+ var FANOUT_KEY_MARKER = "harmony:fanout-item";
1520
+ var FANOUT_KEY_RE = new RegExp(`^\\[${FANOUT_KEY_MARKER}\\]:\\s*#(\\S+)\\s*$`, "m");
1518
1521
  // ../harmony-shared/dist/gateConfigError.js
1519
1522
  var GATE_CONFIG_ERROR_KEY = "configError";
1520
1523
  var GATE_CONFIG_ERROR_MARK = Object.freeze({ [GATE_CONFIG_ERROR_KEY]: true });
@@ -1942,8 +1945,12 @@ class HarmonyApiClient {
1942
1945
  async updateCard(cardId, updates) {
1943
1946
  return this.request("PATCH", `/cards/${cardId}`, updates);
1944
1947
  }
1945
- async claimCard(cardId, agentId) {
1946
- const res = await this.request("PATCH", `/cards/${cardId}`, { assignedAgentId: agentId, ifAssignedAgentNull: true });
1948
+ async claimCard(cardId, agentId, opts) {
1949
+ const res = await this.request("PATCH", `/cards/${cardId}`, {
1950
+ assignedAgentId: agentId,
1951
+ ifAssignedAgentNull: true,
1952
+ ...opts?.requireUnassigned ? { ifAssigneeNull: true } : {}
1953
+ });
1947
1954
  return { claimed: res.claimed !== false };
1948
1955
  }
1949
1956
  async moveCard(cardId, columnId, position) {
@@ -951,6 +951,9 @@ var TIMINGS = {
951
951
  QUERY_STALE_TIME: 1000 * 60 * 5,
952
952
  QUERY_GC_TIME: 1000 * 60 * 60 * 24
953
953
  };
954
+ // ../harmony-shared/dist/fanoutSource.js
955
+ var FANOUT_KEY_MARKER = "harmony:fanout-item";
956
+ var FANOUT_KEY_RE = new RegExp(`^\\[${FANOUT_KEY_MARKER}\\]:\\s*#(\\S+)\\s*$`, "m");
954
957
  // ../harmony-shared/dist/gateConfigError.js
955
958
  var GATE_CONFIG_ERROR_KEY = "configError";
956
959
  var GATE_CONFIG_ERROR_MARK = Object.freeze({ [GATE_CONFIG_ERROR_KEY]: true });
@@ -1312,8 +1315,12 @@ class HarmonyApiClient {
1312
1315
  async updateCard(cardId, updates) {
1313
1316
  return this.request("PATCH", `/cards/${cardId}`, updates);
1314
1317
  }
1315
- async claimCard(cardId, agentId) {
1316
- const res = await this.request("PATCH", `/cards/${cardId}`, { assignedAgentId: agentId, ifAssignedAgentNull: true });
1318
+ async claimCard(cardId, agentId, opts) {
1319
+ const res = await this.request("PATCH", `/cards/${cardId}`, {
1320
+ assignedAgentId: agentId,
1321
+ ifAssignedAgentNull: true,
1322
+ ...opts?.requireUnassigned ? { ifAssigneeNull: true } : {}
1323
+ });
1317
1324
  return { claimed: res.claimed !== false };
1318
1325
  }
1319
1326
  async moveCard(cardId, columnId, position) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gethmy/mcp",
3
- "version": "2.25.0",
3
+ "version": "2.26.0",
4
4
  "description": "MCP server for Harmony, the shared surface for human–agent teams — agents claim cards, report progress, and move work on your board.",
5
5
  "publishConfig": {
6
6
  "access": "public"
package/src/api-client.ts CHANGED
@@ -724,15 +724,27 @@ export class HarmonyApiClient {
724
724
  * Compare-and-set claim of a card for a virtual agent: sets assigned_agent_id
725
725
  * only if it is currently NULL (server-side guard). Returns `{ claimed: false }`
726
726
  * when another daemon already owns it. Used by the agent-agnostic review pickup.
727
+ *
728
+ * `requireUnassigned` additionally guards `assignee_id IS NULL`, so the claim
729
+ * also loses to a PERSON who took the card. Self-selection (sweep, card #978)
730
+ * needs it: this write clears `assignee_id` as a side effect, so the agent-only
731
+ * guard does not merely let the daemon co-own a person's card — it lets the
732
+ * daemon erase their assignment. Default false keeps the review-strand claim
733
+ * (which reaches only cards no one holds) byte-unchanged.
727
734
  */
728
735
  async claimCard(
729
736
  cardId: string,
730
737
  agentId: string,
738
+ opts?: { requireUnassigned?: boolean },
731
739
  ): Promise<{ claimed: boolean }> {
732
740
  const res = await this.request<{ card?: unknown; claimed?: boolean }>(
733
741
  "PATCH",
734
742
  `/cards/${cardId}`,
735
- { assignedAgentId: agentId, ifAssignedAgentNull: true },
743
+ {
744
+ assignedAgentId: agentId,
745
+ ifAssignedAgentNull: true,
746
+ ...(opts?.requireUnassigned ? { ifAssigneeNull: true } : {}),
747
+ },
736
748
  );
737
749
  // Success body is `{ card }` (no `claimed` key) → won. Lost-race body is
738
750
  // `{ claimed: false }`.