@thehammer/danx-dashboard-mcp 0.1.11 → 0.1.12

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 CHANGED
@@ -134,7 +134,7 @@ server.tool("issue_list", "List issues for the dispatch's board by default via G
134
134
  ...boardField,
135
135
  }, async (args) => jsonResult(await issueList(client, args)));
136
136
  // ---------------- issue_get ----------------
137
- server.tool("issue_get", "Fetch a single hydrated issue via GET /api/issues/:id. Board-scoped; defaults to the dispatch's board. Issue ids are globally unique, so this resolves from any dispatch regardless of `board`. Returns the full card (every joined child collection: ac, comments, dependencies, requires_human steps, retro action items + commits, triage history) plus the ancestor chain walked via parent_id. 404 envelope on unknown id.", {
137
+ server.tool("issue_get", "Fetch a single hydrated issue via GET /api/issues/:id. Board-scoped; defaults to the dispatch's board. Issue ids are globally unique, so this resolves from any dispatch regardless of `board`. Returns the full card (every joined child collection: ac, comments, dependencies, requires_human steps, retro action items + commits, triage history, quality_gates — DX-1177: one row per registered quality gate {gate, required, status pending|pass|fail, completed_at, message}; a required PRE gate not yet `pass` pre-empts the work dispatch with the gate reviewer, and `issue_transition complete` refuses while a required POST gate row != pass) plus the ancestor chain walked via parent_id. 404 envelope on unknown id.", {
138
138
  id: z.string().min(1),
139
139
  ...boardField,
140
140
  }, async (args) => jsonResult(await issueGet(client, args)));
@@ -173,7 +173,7 @@ server.tool("issue_edit", "Patch prose fields only via PATCH /api/issues/:id/edi
173
173
  ...boardField,
174
174
  }, async (args) => jsonResult(await issueEdit(client, args)));
175
175
  // ---------------- issue_transition ----------------
176
- server.tool("issue_transition", "Stamp a lifecycle transition via POST /api/issues/:id/transition. **THIS IS THE ONLY WAY TO MOVE A CARD'S LIFECYCLE STATE** — DX-835 separated card lifecycle (this tool) from dispatch finalization (`mcp__danxbot__danxbot_complete`). The worker no longer infers card moves from `danxbot_complete.status`; agents that want the card to move MUST call this tool BEFORE calling `danxbot_complete`. Actions: ready (Review→ToDo), pickup (ToDo→In Progress — server checks every dispatch gate: ready_at, blocked_at, requires_human_reason, depends_on partners terminal, conflict_on partners idle; refuses 409 with failed_gate naming the cause; pass manual:true for OPERATOR-SESSION self-pickup — stamps dispatch_kind 'manual', bypasses every card-flow gate except terminal/deleted/already-dispatched, and the worker NEVER auto-transitions the card: no orphan-heal rollback, no Epic auto-rollup — use this whenever the work happens in YOUR current session rather than a worker dispatch, DX-946), rollback_pickup, **complete** (stamps completed_at — moves card to Done; this is YOUR explicit decision, not a side effect of danxbot_complete; REFUSES 409 on Epic if any phase child non-terminal — see non_terminal_phases[]), cancel (stamps cancelled_at — terminal), **block** (requires non-empty reason — stamps blocked_at + blocked_reason + clears dispatch; USE THIS when the CARD itself cannot proceed without human intervention; distinct from env-fault dispatch failures which use `danxbot_complete({status:'failed'})`), unblock, archive (parks to Backlog, clears ready_at), reopen (terminal→active, clears completed_at/cancelled_at/archived_at). Terminal cards refuse every action except reopen. Ladder timestamps preserved — forward stamps never clear earlier ones (CLAUDE.md Core Principle 2).", {
176
+ server.tool("issue_transition", "Stamp a lifecycle transition via POST /api/issues/:id/transition. **THIS IS THE ONLY WAY TO MOVE A CARD'S LIFECYCLE STATE** — DX-835 separated card lifecycle (this tool) from dispatch finalization (`mcp__danxbot__danxbot_complete`). The worker no longer infers card moves from `danxbot_complete.status`; agents that want the card to move MUST call this tool BEFORE calling `danxbot_complete`. Actions: ready (Review→ToDo), pickup (ToDo→In Progress — server checks every dispatch gate: ready_at, blocked_at, requires_human_reason, depends_on partners terminal, conflict_on partners idle; refuses 409 with failed_gate naming the cause; pass manual:true for OPERATOR-SESSION self-pickup — stamps dispatch_kind 'manual', bypasses every card-flow gate except terminal/deleted/already-dispatched, and the worker NEVER auto-transitions the card: no orphan-heal rollback, no Epic auto-rollup — use this whenever the work happens in YOUR current session rather than a worker dispatch, DX-946), rollback_pickup, **complete** (stamps completed_at — moves card to Done; this is YOUR explicit decision, not a side effect of danxbot_complete; REFUSES 409 on Epic if any phase child non-terminal — see non_terminal_phases[]; ALSO refuses 409 with failed_gate 'quality_gate_post' + failed_post_gates[] while any required POST quality gate row != pass — DX-1177), cancel (stamps cancelled_at — terminal), **block** (requires non-empty reason — stamps blocked_at + blocked_reason + clears dispatch; USE THIS when the CARD itself cannot proceed without human intervention; distinct from env-fault dispatch failures which use `danxbot_complete({status:'failed'})`), unblock, archive (parks to Backlog, clears ready_at), reopen (terminal→active, clears completed_at/cancelled_at/archived_at). Terminal cards refuse every action except reopen. Ladder timestamps preserved — forward stamps never clear earlier ones (CLAUDE.md Core Principle 2).", {
177
177
  id: z.string().min(1),
178
178
  action: z.enum(TRANSITION_ACTIONS),
179
179
  reason: z.string().optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thehammer/danx-dashboard-mcp",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "Stdio MCP server wrapping danxbot's dashboard /api/issues/* normalized DB-backed HTTP routes for dispatched agents (DX-704 Phase 2).",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,51 +0,0 @@
1
- import { describe, it, expect } from "vitest";
2
- import { DashboardHttpClient } from "./http-client.js";
3
- import { issueList, issueTransition } from "./handlers.js";
4
- /**
5
- * `issue_list` query-param forwarding. A fake `fetch` captures the built
6
- * URL so each filter is asserted at the wire, through the real client's
7
- * URL builder (`?repo=` always stamped, extra query merged after).
8
- */
9
- function clientCapturing() {
10
- const urls = [];
11
- const fetchImpl = (async (url) => {
12
- urls.push(url);
13
- return new Response(JSON.stringify({ issues: [] }), { status: 200 });
14
- });
15
- const client = new DashboardHttpClient({ baseUrl: "http://localhost:5555", repo: "danxbot", token: "t" }, fetchImpl);
16
- return { client, urls };
17
- }
18
- describe("issueList — query forwarding", () => {
19
- it("forwards q as the server-side search needle", async () => {
20
- const { client, urls } = clientCapturing();
21
- await issueList(client, { q: "retire" });
22
- expect(urls[0]).toContain("q=retire");
23
- });
24
- it("omits q when not provided", async () => {
25
- const { client, urls } = clientCapturing();
26
- await issueList(client, { include_closed: true });
27
- expect(urls[0]).not.toContain("q=");
28
- expect(urls[0]).toContain("include_closed=true");
29
- });
30
- });
31
- describe("issueTransition — body forwarding", () => {
32
- function clientCapturingBody() {
33
- const bodies = [];
34
- const fetchImpl = (async (_url, init) => {
35
- bodies.push(JSON.parse(String(init?.body ?? "{}")));
36
- return new Response(JSON.stringify({ issue: {} }), { status: 200 });
37
- });
38
- const client = new DashboardHttpClient({ baseUrl: "http://localhost:5555", repo: "danxbot", token: "t" }, fetchImpl);
39
- return { client, bodies };
40
- }
41
- it("forwards manual: true on pickup (DX-946 operator self-pickup)", async () => {
42
- const { client, bodies } = clientCapturingBody();
43
- await issueTransition(client, { id: "DX-1", action: "pickup", manual: true });
44
- expect(bodies[0]).toEqual({ action: "pickup", manual: true });
45
- });
46
- it("omits manual when not provided", async () => {
47
- const { client, bodies } = clientCapturingBody();
48
- await issueTransition(client, { id: "DX-1", action: "pickup" });
49
- expect(bodies[0]).toEqual({ action: "pickup" });
50
- });
51
- });