@thehammer/danx-dashboard-mcp 0.1.192 → 0.1.193

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.
@@ -0,0 +1,59 @@
1
+ /**
2
+ * DX-3923 — correct first calls for the routes every card session uses,
3
+ * rendered into the `danxbot_api` tool description (index.ts). The DX-3678
4
+ * grading run found the same avoidable 4xx in session after session (a card
5
+ * read's `fields` sent as a comma string, `fields.parent`, top-level list
6
+ * filters, a card edit sent to `PATCH /api/issues/:id`, a comment keyed
7
+ * `body`, retro `tests[].kind: "unit"`, the AC-tick route hunted through a
8
+ * 36 KB `danxbot_api_list`) because nothing an agent
9
+ * reads before its first call showed the right shape. The tool description
10
+ * is the one surface every profile and every operator session carries.
11
+ *
12
+ * Kept as data, not prose, so danxbot's own tests can check each example
13
+ * against the live server contract (route table, resource fields, body
14
+ * schemas) and fail when one drifts — this package cannot import the
15
+ * server's constants itself (it is published on its own).
16
+ */
17
+ export const DANXBOT_API_EXAMPLES = {
18
+ cardRead: {
19
+ method: "GET",
20
+ path: "/api/issues/<id>",
21
+ query: { fields: { description: true, ac: true, comments: true, checklists: true, parent_title: true } },
22
+ },
23
+ cardList: {
24
+ method: "GET",
25
+ path: "/api/issues",
26
+ query: { filter: { status_derived: "ToDo", q: "<text>" } },
27
+ },
28
+ cardEdit: {
29
+ method: "PATCH",
30
+ path: "/api/issues/<id>/edit",
31
+ body: { description: "<markdown>", content_hash: "<content_hash from your read>" },
32
+ },
33
+ comment: {
34
+ method: "POST",
35
+ path: "/api/issues/<id>/comments",
36
+ body: { text: "<markdown>" },
37
+ },
38
+ acTick: {
39
+ method: "PATCH",
40
+ path: "/api/issues/<id>/checklists/<checklists[].id>/items/<items[].id>",
41
+ body: { status: "passing" },
42
+ },
43
+ };
44
+ /** The retro route's accepted `tests[].kind` values. */
45
+ export const RETRO_TEST_KIND_EXAMPLES = ["group", "e2e"];
46
+ function render(example) {
47
+ const { method, path, query, body } = example;
48
+ return JSON.stringify({ method, path, ...(query ? { query } : {}), ...(body ? { body } : {}) });
49
+ }
50
+ /** The description sentence `danxbot_api` carries. */
51
+ export function danxbotApiExamplesText() {
52
+ const e = DANXBOT_API_EXAMPLES;
53
+ return (`Correct first calls: card read ${render(e.cardRead)} (\`fields\` is an object, never a comma string); ` +
54
+ `card list ${render(e.cardList)} (filters only inside \`filter\`); ` +
55
+ `card edit ${render(e.cardEdit)}; ` +
56
+ `comment ${render(e.comment)}; ` +
57
+ `AC tick ${render(e.acTick)}; ` +
58
+ `retro \`tests[].kind\` is ${RETRO_TEST_KIND_EXAMPLES.map((k) => `"${k}"`).join(" or ")}.`);
59
+ }
package/dist/index.js CHANGED
@@ -85,6 +85,7 @@ import { z } from "zod";
85
85
  import { DashboardHttpClient } from "./http-client.js";
86
86
  import { planConnect, danxbotApi, danxbotApiList, danxbotApiSpec, attachFile, DANXBOT_API_METHODS, } from "./handlers.js";
87
87
  import { bodyValueSchema, queryValueSchema } from "./types.js";
88
+ import { danxbotApiExamplesText } from "./danxbot-api-examples.js";
88
89
  import { registerLifecycleTools, applyLifecycleVisibility, readLifecycleUrlsFromEnv, } from "./lifecycle.js";
89
90
  function readEnvOrDie(name) {
90
91
  const v = process.env[name];
@@ -227,6 +228,7 @@ same four verbs:
227
228
  - create POST <collection> — the resource's own required fields; a 400 names any missing/invalid one.
228
229
  - update PATCH/PUT <collection>/:id — send only the fields you are changing; most resources require the
229
230
  concurrency token below when the edit touches contested text fields.
231
+ A card is the exception: PATCH /api/issues/<id>/edit.
230
232
  - delete DELETE <collection>/:id — usually a soft-delete; the resource's own docs say so.
231
233
  Don't know the route for what you need to do? Call \`danxbot_api_list()\` — it lists exactly the routes your
232
234
  credential may call, one line each. Then call \`danxbot_api_spec({endpoints: ["METHOD /path/template"]})\` for the
@@ -331,7 +333,10 @@ strictTool("danxbot_api", "Call any dashboard API route your credential may reac
331
333
  "route attaches one. `board` overrides this dispatch's configured board for a board-scoped route only " +
332
334
  "(ignored by a route that isn't board-scoped). See this server's own instructions (shown once, at connect) " +
333
335
  "for the shared resource shape, the stale-hash rule, and how to read a refusal — don't know the route? call " +
334
- "`danxbot_api_list` first; unsure of its exact shape? call `danxbot_api_spec` first.", {
336
+ "`danxbot_api_list` first; unsure of its exact shape? call `danxbot_api_spec` first. " +
337
+ // DX-3923 — the shapes agents guessed wrong most often, shown before the
338
+ // first call instead of learned from a 4xx.
339
+ danxbotApiExamplesText(), {
335
340
  method: z.enum(DANXBOT_API_METHODS),
336
341
  path: z
337
342
  .string()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thehammer/danx-dashboard-mcp",
3
- "version": "0.1.192",
3
+ "version": "0.1.193",
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",