@thehammer/danx-dashboard-mcp 0.1.168 → 0.1.171
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 +2 -2
- package/dist/http-client.js +8 -13
- package/dist/index.js +10 -21
- package/dist/listen.js +8 -1
- package/dist/types.js +16 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# @thehammer/danx-dashboard-mcp
|
|
2
2
|
|
|
3
|
-
Stdio MCP server
|
|
3
|
+
Stdio MCP server fronting danxbot's dashboard HTTP API. Since DX-3465 it exposes three generic tools (`danxbot_api`, `danxbot_api_list`, `danxbot_api_spec` — see "Tool surface" below) that reach any route the caller's credential may reach, plus a handful of dedicated tools for agent-specific operations (`plan_connect`, `danxbot_complete`, Slack/template-app callbacks, …) — there is no per-operation tool any more.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
`danxbot_api` is Zod-validated at the MCP boundary, fetches under the hood, and passes the server response back to the agent verbatim. Refusal envelopes (`{error, ...extra}` with `failed_gate`, `non_terminal_phases`, `offending_keys`, etc.) come through as `{ok: false, status, body}` so the agent can pick the right next action without guessing. 5xx and network failures throw.
|
|
6
6
|
|
|
7
7
|
## Env vars (required, fail-loud at boot)
|
|
8
8
|
|
package/dist/http-client.js
CHANGED
|
@@ -102,19 +102,14 @@ 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
|
|
106
|
-
//
|
|
107
|
-
//
|
|
108
|
-
//
|
|
109
|
-
// `
|
|
110
|
-
//
|
|
111
|
-
//
|
|
112
|
-
//
|
|
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.
|
|
105
|
+
// DX-3465 — a field TREE (`fields`, a plain object) is the only
|
|
106
|
+
// query param the server parses as JSON
|
|
107
|
+
// (`src/resources/field-tree.ts`); every LIST-valued param it has
|
|
108
|
+
// (`ids` on `GET /api/issues/batch`, `status` on the boards list,
|
|
109
|
+
// `endpoints` on `GET /api/openapi`) splits on commas instead, never
|
|
110
|
+
// JSON. Arrays are `typeof "object"` too, so the array check must
|
|
111
|
+
// come BEFORE the plain-object branch. A plain scalar stringifies
|
|
112
|
+
// as before.
|
|
118
113
|
params.set(k, Array.isArray(v)
|
|
119
114
|
? v.map((item) => String(item)).join(",")
|
|
120
115
|
: typeof v === "object"
|
package/dist/index.js
CHANGED
|
@@ -84,6 +84,7 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
|
|
|
84
84
|
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
|
+
import { queryValueSchema } from "./types.js";
|
|
87
88
|
import { registerLifecycleTools, applyLifecycleVisibility, readLifecycleUrlsFromEnv, } from "./lifecycle.js";
|
|
88
89
|
function readEnvOrDie(name) {
|
|
89
90
|
const v = process.env[name];
|
|
@@ -337,28 +338,16 @@ strictTool("danxbot_api", "Call any dashboard API route your credential may reac
|
|
|
337
338
|
.min(1)
|
|
338
339
|
.startsWith("/api/")
|
|
339
340
|
.describe('Full path starting with "/api/" — never a route template.'),
|
|
340
|
-
// DX-3465
|
|
341
|
-
//
|
|
342
|
-
// `
|
|
343
|
-
//
|
|
344
|
-
//
|
|
345
|
-
// so the schema here must accept what those two tell the caller to
|
|
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
|
|
341
|
+
// DX-3465 — a query value may be a scalar, a field TREE (a plain
|
|
342
|
+
// object, e.g. `{"description":true,"comments":{"limit":20}}` — see
|
|
343
|
+
// SERVER_INSTRUCTIONS below and the OpenAPI spec's `fields` schema), or
|
|
344
|
+
// an array of scalars (e.g. `ids` on the batch-get route).
|
|
345
|
+
// `DashboardHttpClient#buildUrl` JSON-encodes a plain object but
|
|
349
346
|
// comma-joins an array, matching the two shapes the server actually
|
|
350
|
-
// parses (a JSON field tree vs. a comma-separated list param)
|
|
351
|
-
//
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
z.string(),
|
|
355
|
-
z.number(),
|
|
356
|
-
z.boolean(),
|
|
357
|
-
z.null(),
|
|
358
|
-
z.record(z.unknown()),
|
|
359
|
-
z.array(z.unknown()),
|
|
360
|
-
]))
|
|
361
|
-
.optional(),
|
|
347
|
+
// parses (a JSON field tree vs. a comma-separated list param) — so array
|
|
348
|
+
// elements are restricted to scalars, the only thing a comma-join can
|
|
349
|
+
// represent losslessly.
|
|
350
|
+
query: queryValueSchema.optional(),
|
|
362
351
|
body: z.unknown().optional(),
|
|
363
352
|
...boardField,
|
|
364
353
|
}, async (args) => jsonResult(await danxbotApi(client, args)));
|
package/dist/listen.js
CHANGED
|
@@ -284,6 +284,11 @@ function cardList(cards) {
|
|
|
284
284
|
* this signal cannot support. See `evaluateIdleNudge`'s own doc comment
|
|
285
285
|
* (`src/issues/db/session-idle-nudge.ts`) for why a sub-agent-awareness
|
|
286
286
|
* special case was rejected instead of this wording fix.
|
|
287
|
+
*
|
|
288
|
+
* DX-3676 — every named card clears every dispatch gate, so if the session
|
|
289
|
+
* still cannot work one, the card's recorded state is wrong (DX-3400 sat in
|
|
290
|
+
* ToDo with its real blocker only in a comment). The line therefore ends by
|
|
291
|
+
* naming each state-correcting move, which is also what stops the nudge.
|
|
287
292
|
*/
|
|
288
293
|
export function formatNudgeLine(event) {
|
|
289
294
|
const invalid = invalidNudgeReason(event);
|
|
@@ -294,7 +299,9 @@ export function formatNudgeLine(event) {
|
|
|
294
299
|
parts.push(`startable: ${cardList(event.startable)}`);
|
|
295
300
|
if (event.held.length > 0)
|
|
296
301
|
parts.push(`held: ${cardList(event.held)}`);
|
|
297
|
-
return oneLine(`${LINE_PREFIX} this session has not made an MCP call in ${event.idleMinutes}m — ${parts.join("; ")}`
|
|
302
|
+
return oneLine(`${LINE_PREFIX} this session has not made an MCP call in ${event.idleMinutes}m — ${parts.join("; ")}. ` +
|
|
303
|
+
"Work these cards; any you cannot work, update to its true state: open a problem, add depends_on or " +
|
|
304
|
+
"conflict_on, block it with the real reason, or rollback_pickup.");
|
|
298
305
|
}
|
|
299
306
|
/**
|
|
300
307
|
* Incremental SSE parser. Comment lines (keep-alives, the connect marker) and
|
package/dist/types.js
CHANGED
|
@@ -1 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* The zod schema for `danxbot_api`'s `query` argument, matching the
|
|
4
|
+
* `QueryValue` type above — a scalar, a field-tree object, or an array
|
|
5
|
+
* whose elements are themselves scalars (never objects; a comma-join
|
|
6
|
+
* cannot represent one losslessly). Exported so it can be exercised
|
|
7
|
+
* directly in tests without going through the MCP tool-call machinery.
|
|
8
|
+
*/
|
|
9
|
+
export const queryValueSchema = z.record(z.union([
|
|
10
|
+
z.string(),
|
|
11
|
+
z.number(),
|
|
12
|
+
z.boolean(),
|
|
13
|
+
z.null(),
|
|
14
|
+
z.record(z.unknown()),
|
|
15
|
+
z.array(z.union([z.string(), z.number(), z.boolean()])),
|
|
16
|
+
]));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thehammer/danx-dashboard-mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.171",
|
|
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",
|