@thehammer/danx-dashboard-mcp 0.1.175 → 0.1.177

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.
@@ -1,4 +1,38 @@
1
1
  import { assertVersionFloorSatisfied, MCP_MIN_VERSION_HEADER } from "./version-floor.js";
2
+ /**
3
+ * DX-3750 — route-path prefixes (`<basePath><path>`, BEFORE any query
4
+ * string) that are NEVER board-scoped: the dashboard route serving them
5
+ * takes no `?board=` at all — either because the resource is GLOBAL
6
+ * (plans — see `plan_list`'s own doc: "Plans are GLOBAL, not board-scoped")
7
+ * or because it scopes some other way a `board` param would be meaningless
8
+ * for (dispatches scope by `repo`; a board resolves from a PATH segment on
9
+ * every route but its own list, which itself scopes by `repo`; `/api/routes`
10
+ * and `/api/openapi` are cross-board discovery). Server-side, each of these
11
+ * families' LIST route validates its query params with its own
12
+ * `rejectUnknownParams(params, TOP_LEVEL_..._PARAM_KEYS)` allowlist
13
+ * (`src/issues/plans-routes.ts`, `src/dashboard/dispatches-routes.ts`,
14
+ * `src/issues/boards-routes.ts`) — none of those allowlists names `board`
15
+ * (DX-3725), so stamping it 400s. THIS is the one list; `isBoardScopedRoute`
16
+ * is the one function that reads it — no second, independently-drifting
17
+ * copy anywhere else in this package.
18
+ *
19
+ * Deliberately prefix-matched, not exact-matched: every sub-route of a
20
+ * non-board-scoped family (`/api/plans/:id/cards`, `/api/boards/:id/export`,
21
+ * `/api/dispatches/:id/logs`, …) is equally never board-scoped — a plan, a
22
+ * dispatch and a board-export all resolve their target from a PATH segment
23
+ * or a `repo`/global scope, never from `?board=`.
24
+ */
25
+ const NON_BOARD_SCOPED_PATH_PREFIXES = [
26
+ "/api/plans",
27
+ "/api/dispatches",
28
+ "/api/boards",
29
+ "/api/routes",
30
+ "/api/openapi",
31
+ ];
32
+ /** DX-3750 — does `routePath` (`<basePath><path>`, no query string) take a `?board=` at all? See `NON_BOARD_SCOPED_PATH_PREFIXES`'s own doc. */
33
+ export function isBoardScopedRoute(routePath) {
34
+ return !NON_BOARD_SCOPED_PATH_PREFIXES.some((prefix) => routePath === prefix || routePath.startsWith(`${prefix}/`));
35
+ }
2
36
  export class DashboardHttpClient {
3
37
  config;
4
38
  fetchImpl;
@@ -97,7 +131,12 @@ export class DashboardHttpClient {
97
131
  cleanPath = rawPath.startsWith("/") ? rawPath : `/${rawPath}`;
98
132
  }
99
133
  const params = new URLSearchParams(existingQs ?? "");
100
- params.set("board", boardOverride ?? this.config.board);
134
+ // DX-3750 — only a board-scoped route takes `?board=` at all; see
135
+ // `isBoardScopedRoute`'s own doc for why an unconditional stamp 400s
136
+ // plans/dispatches/boards-list through `danxbot_api`.
137
+ if (isBoardScopedRoute(`${basePath}${cleanPath}`)) {
138
+ params.set("board", boardOverride ?? this.config.board);
139
+ }
101
140
  if (extraQuery) {
102
141
  for (const [k, v] of Object.entries(extraQuery)) {
103
142
  if (v === undefined || v === null)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thehammer/danx-dashboard-mcp",
3
- "version": "0.1.175",
3
+ "version": "0.1.177",
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",