@thehammer/danx-dashboard-mcp 0.1.166 → 0.1.168

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/README.md CHANGED
@@ -24,7 +24,8 @@ All exposed as `mcp__danx-dashboard__<name>` once wired through the workspace `m
24
24
  | `danxbot_api` | `{method, path, query?, body?}` — calls any dashboard route the caller's credential may reach (card/plan CRUD, comments, dependencies, problems/solutions, quality gates, retro, triage, transitions, …). Returns `{ok, status, body}`; `body` carries the route's own response, or its structured error verbatim when `ok:false`. |
25
25
  | `danxbot_api_list` | No args. Lists the routes this caller's credential may reach, one line each (`{method, path, summary, permission}`) — call this first when you don't know the route for what you need to do. |
26
26
  | `danxbot_api_spec` | `{endpoints}` (comma-joined `METHOD /path` list, required, min 1). Returns the exact OpenAPI contract for those routes — call this when you know the route but not its exact request/response shape. |
27
- | `resource_fields` | `GET /api/resources/:resource/fields` — what an opt-in field TREE may name for one resource: `{resource, description, always, hashes, fields, relations}`. Install-global, no `board`. `resource: "issue"` is the root; a relation's own `resource` in the response is what to call this again with, one level deeper. |
27
+
28
+ There is no dedicated `resource_fields` tool (removed DX-3465 — it was a thin wrapper `danxbot_api` already reaches with no agent-specific behavior earning it its own tool). What an opt-in field TREE may name for one resource (`{resource, description, always, hashes, fields, relations}`) is `danxbot_api({method:"GET", path:"/api/resources/<resource>/fields"})` — install-global, no `board`; `resource: "issue"` is the root, and a relation's own `resource` in the response is what to call this again with, one level deeper.
28
29
 
29
30
  A dedicated tool survives only for something about the agent itself, never a card/plan operation: `plan_connect` (binds the session to a plan; the event-bridge hook keys on it) and the per-dispatch worker callbacks (`danxbot_complete`, `danxbot_slack_reply`, `danxbot_slack_post_update`, `load_template_app`/`save_template_app`, `quality_gate_complete`, `link_thread_to_issue`, `attach_file`, the `slack_recovery_*` trio, `danxbot_set_evaluator_summary`) — see `src/lifecycle.ts`. The live list is always `tool-defs.json` in this package, regenerated by `npm run gen-tool-defs` — read it rather than trusting a list copied into prose.
30
31
 
@@ -102,16 +102,24 @@ export class DashboardHttpClient {
102
102
  for (const [k, v] of Object.entries(extraQuery)) {
103
103
  if (v === undefined || v === null)
104
104
  continue;
105
- // DX-3465 (code-quality gate finding, at 275f82c0d) — a field TREE
106
- // (`fields`, and any other tree-shaped route param) arrives here as a
107
- // real object/array, not a string; `String(v)` on either produces
108
- // the useless literal "[object Object]" (objects) or a comma-joined
109
- // list that drops all nesting (arrays). JSON-encode both so the
110
- // server's own `fields=` query-string parser (which expects exactly
111
- // this shape — see `src/dashboard/...` field-tree route handling)
112
- // receives what it can actually parse; a plain scalar still
113
- // stringifies the same way it always did.
114
- params.set(k, typeof v === "object" ? JSON.stringify(v) : String(v));
105
+ // DX-3465 round 2 (code-quality gate finding, at 27c9e4005) — a
106
+ // field TREE (`fields`, a plain object) is the only query param the
107
+ // server parses as JSON (`src/resources/field-tree.ts`); every
108
+ // LIST-valued param it has (`ids` on `GET /api/issues/batch`,
109
+ // `status` on the boards list, `endpoints` on `GET /api/openapi`)
110
+ // splits on commas instead. Round 1 JSON-encoded both objects and
111
+ // arrays alike, which silently broke every array-valued param: the
112
+ // server saw a JSON literal where it expected a comma list and
113
+ // returned a wrong-but-200 answer (e.g. `ids=["DX-1","DX-2"]`
114
+ // resolves zero cards) instead of the old loud zod refusal. Arrays
115
+ // are `typeof "object"` too, so they must be checked BEFORE the
116
+ // plain-object branch. A plain scalar still stringifies the same
117
+ // way it always did.
118
+ params.set(k, Array.isArray(v)
119
+ ? v.map((item) => String(item)).join(",")
120
+ : typeof v === "object"
121
+ ? JSON.stringify(v)
122
+ : String(v));
115
123
  }
116
124
  }
117
125
  return `${base}${basePath}${cleanPath}?${params.toString()}`;
package/dist/index.js CHANGED
@@ -338,13 +338,17 @@ strictTool("danxbot_api", "Call any dashboard API route your credential may reac
338
338
  .startsWith("/api/")
339
339
  .describe('Full path starting with "/api/" — never a route template.'),
340
340
  // DX-3465 (code-quality gate finding, at 275f82c0d) — a query value may
341
- // be a field TREE (a plain object or array, e.g.
341
+ // be a field TREE (a plain object, e.g.
342
342
  // `{"description":true,"comments":{"limit":20}}`), not just a scalar —
343
343
  // SERVER_INSTRUCTIONS below says "ALWAYS pass `fields` … a field tree"
344
344
  // and the OpenAPI spec agrees (`fields`'s schema is `{type:"object"}`),
345
345
  // so the schema here must accept what those two tell the caller to
346
- // send. `DashboardHttpClient#buildUrl` JSON-encodes an object/array
347
- // value into the query string; a scalar serializes as before.
346
+ // send. It may also be an array (e.g. `ids` on the batch-get route) —
347
+ // DX-3465 round 2 (code-quality gate finding, at 27c9e4005) —
348
+ // `DashboardHttpClient#buildUrl` JSON-encodes a plain-object value but
349
+ // comma-joins an array, matching the two shapes the server actually
350
+ // parses (a JSON field tree vs. a comma-separated list param); a scalar
351
+ // serializes as before.
348
352
  query: z
349
353
  .record(z.union([
350
354
  z.string(),
@@ -420,7 +424,7 @@ strictTool("attach_file", "Attach a LOCAL file to a card: `card_id` + `path` (an
420
424
  // no existing plan for an id to name yet.
421
425
  strictTool("plan_connect",
422
426
  // DX-2735: trimmed with the problem tools to stay inside the work-profile budget.
423
- "Connect THIS session to a plan. ONE CALL IS ENOUGH TO START: the reply carries `{session, movedFrom, browserInstruction, briefing, listenerHealth}` — `browserInstruction` is a server-built action to take NOW: it names the plan's URL and tells you to open it (in-app browser if you have one, else default), keep that tab open for the whole session without navigating it away, and use a different tab for your own browsing — the operator's tab for following and talking to you. Returned on every connect, including a re-connect, so it doubles as the post-context-loss reminder. `briefing` is every goal/rule/caveat (ref+body), every architecture section (id+title), the plan's own ref/name/status, a first page of open cards (id/type/status/title/openProblemCount/assignedAgent) with a `morePagesHint` when more exist, and the closed-card count — usually replacing the plan read + card batch-read a fresh session used to need. A session is on AT MOST ONE plan: connecting elsewhere MOVES it, and `movedFrom: {id, name} | null` says which plan it left (null = no plan, or already this one). Binds only your OWN session, resolved from the session id this server forwards; afterwards every plan WRITE tool acts on this plan and takes no plan id. `listenerHealth` reports the event bridge's state — `null` (no session), or `{attached, state: \"unattached\"|\"credential_mismatch\"|\"healthy\", nextStep}` naming a concrete fix per unhealthy state (same shape the plan list/get routes report). Once healthy, every comment, answer, problem added and block/unblock on this plan's cards reaches the session unpolled, relayed by the plugin's event bridge as a line like `[DX-8 \"Title\" repo:board] newms87 answered \"<statement>\": chose \"Pause E2E\"`. Pass `title` (call `get_session({session_id:\"self\"})` first and forward its `title` verbatim) so the dashboard shows the same name Claude does — this server cannot read it itself. The response's `reminders[]` (when present) carries the mantra — read and follow it.", {
427
+ "Connect THIS session to a plan. ONE CALL IS ENOUGH TO START: the reply carries `{session, movedFrom, browserInstruction, briefing, listenerHealth}` — `browserInstruction` is a server-built action to take NOW: it names the plan's URL and tells you to open it (in-app browser if you have one, else default), keep that tab open for the whole session without navigating it away, and use a different tab for your own browsing — the operator's tab for following and talking to you. Returned on every connect, including a re-connect, so it doubles as the post-context-loss reminder. `briefing` is every goal/rule/caveat (ref+body), every architecture section (id+title), the plan's own ref/name/status, a first page of open cards (id/type/status/title/openProblemCount/assignedAgent) with a `morePagesHint` when more exist, and the closed-card count — usually replacing the plan read + card batch-read a fresh session used to need. A session is on AT MOST ONE plan: connecting elsewhere MOVES it, and `movedFrom: {id, name} | null` says which plan it left (null = no plan, or already this one). Binds only your OWN session, resolved from the session id this server forwards; afterwards a `danxbot_api` call to a `/api/plans/mine/...` route (there is no dedicated plan-write tool) acts on this plan and takes no plan id. `listenerHealth` reports the event bridge's state — `null` (no session), or `{attached, state: \"unattached\"|\"credential_mismatch\"|\"healthy\", nextStep}` naming a concrete fix per unhealthy state (same shape the plan list/get routes report). Once healthy, every comment, answer, problem added and block/unblock on this plan's cards reaches the session unpolled, relayed by the plugin's event bridge as a line like `[DX-8 \"Title\" repo:board] newms87 answered \"<statement>\": chose \"Pause E2E\"`. Pass `title` (call `get_session({session_id:\"self\"})` first and forward its `title` verbatim) so the dashboard shows the same name Claude does — this server cannot read it itself. The response's `reminders[]` (when present) carries the mantra — read and follow it.", {
424
428
  plan_id: z.number().int().positive().describe("The plan id, from the plans list (`danxbot_api` `GET /api/plans`)."),
425
429
  title: z
426
430
  .string()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thehammer/danx-dashboard-mcp",
3
- "version": "0.1.166",
3
+ "version": "0.1.168",
4
4
  "description": "Stdio MCP server fronting danxbot's dashboard API for agents (operator sessions and dispatched workers alike): the generic danxbot_api/danxbot_api_list/danxbot_api_spec tools reach any route the caller's credential may call, plus dedicated agent-specific tools (plan_connect, danxbot_complete, and other per-dispatch lifecycle callbacks) (DX-3465, PLN-11 R-25).",
5
5
  "license": "MIT",
6
6
  "type": "module",