@thehammer/danx-dashboard-mcp 0.1.211 → 0.1.213

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.
@@ -12,8 +12,8 @@ import { assertVersionFloorSatisfied, MCP_MIN_VERSION_HEADER } from "./version-f
12
12
  * `rejectUnknownParams(params, TOP_LEVEL_..._PARAM_KEYS)` allowlist
13
13
  * (`src/issues/plans-routes.ts`, `src/dashboard/dispatches-routes.ts`,
14
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
15
+ * (DX-3725), so stamping it 400s. THIS list and `NON_BOARD_SCOPED_PATH_PATTERNS` below are the only
16
+ * classification; `isBoardScopedRoute` is the one function that reads them — no second, independently-drifting
17
17
  * copy anywhere else in this package.
18
18
  *
19
19
  * Deliberately prefix-matched, not exact-matched: every sub-route of a
@@ -28,10 +28,37 @@ const NON_BOARD_SCOPED_PATH_PREFIXES = [
28
28
  "/api/boards",
29
29
  "/api/routes",
30
30
  "/api/openapi",
31
+ // DX-4261: install- or team-global families, whose list reads declare no `board` (the engine 400s an unknown key).
32
+ "/api/team",
33
+ "/api/users",
34
+ "/api/account",
35
+ "/api/platform",
36
+ "/api/failure-categories",
37
+ "/api/failure-signatures",
38
+ "/api/notifications",
39
+ "/api/self-repair",
40
+ "/api/audit-events",
41
+ "/api/docs",
42
+ "/api/repos",
43
+ "/api/sync-root",
44
+ "/api/workers",
45
+ "/api/tasks",
46
+ "/api/reminders",
47
+ ];
48
+ /**
49
+ * DX-4261: non-board-scoped routes a prefix cannot express, because their family root (`/api/issues`, `/api/catalog`) is board-scoped.
50
+ * `/api/agents` stays stamped: `?board=` there selects the roster read (DX-4220).
51
+ */
52
+ const NON_BOARD_SCOPED_PATH_PATTERNS = [
53
+ /^\/api\/issues\/[^/]+\/(dispatches|problems)$/,
54
+ /^\/api\/catalog\/[^/]+$/,
55
+ // The LIST read only: `/api/plan-sessions/me/plan` reads the stamped board to pin the operator dispatch (DX-2954).
56
+ /^\/api\/plan-sessions$/,
31
57
  ];
32
58
  /** DX-3750 — does `routePath` (`<basePath><path>`, no query string) take a `?board=` at all? See `NON_BOARD_SCOPED_PATH_PREFIXES`'s own doc. */
33
59
  export function isBoardScopedRoute(routePath) {
34
- return !NON_BOARD_SCOPED_PATH_PREFIXES.some((prefix) => routePath === prefix || routePath.startsWith(`${prefix}/`));
60
+ return !(NON_BOARD_SCOPED_PATH_PREFIXES.some((prefix) => routePath === prefix || routePath.startsWith(`${prefix}/`)) ||
61
+ NON_BOARD_SCOPED_PATH_PATTERNS.some((pattern) => pattern.test(routePath)));
35
62
  }
36
63
  export class DashboardHttpClient {
37
64
  config;
package/dist/listen.js CHANGED
@@ -122,6 +122,10 @@ export function invalidEventReason(value) {
122
122
  if (typeof value.origin !== "string" || !ACTIVITY_ORIGINS.has(value.origin)) {
123
123
  return "origin is not one of operator, agent, machine";
124
124
  }
125
+ // DX-4246 — the key snapshot is part of every event the dashboard sends, `null` when no key wrote it.
126
+ if (value.viaKey !== null && !(isRecord(value.viaKey) && typeof value.viaKey.id === "number" && typeof value.viaKey.name === "string")) {
127
+ return "viaKey is not null or {id, name}";
128
+ }
125
129
  const d = value.detail;
126
130
  if (!isRecord(d))
127
131
  return "detail is not an object";
@@ -187,7 +191,9 @@ export function invalidEventReason(value) {
187
191
  * reader would have to cross-reference.
188
192
  */
189
193
  function actorLabel(event) {
190
- return `${event.actor} (${event.origin})`;
194
+ // DX-4246 — a write made through an API key names the user AND the key ("dan via claude-laptop (agent)").
195
+ const via = event.viaKey === null ? "" : ` via ${event.viaKey.name}`;
196
+ return `${event.actor}${via} (${event.origin})`;
191
197
  }
192
198
  /** Only ever called on an event `invalidEventReason` accepted, so its casts are checked. */
193
199
  function describe(event) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thehammer/danx-dashboard-mcp",
3
- "version": "0.1.211",
3
+ "version": "0.1.213",
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",