@thehammer/danx-dashboard-mcp 0.1.165 → 0.1.166

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thehammer/danx-dashboard-mcp",
3
- "version": "0.1.165",
3
+ "version": "0.1.166",
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",
@@ -21,7 +21,7 @@
21
21
  "node": ">=20"
22
22
  },
23
23
  "scripts": {
24
- "build": "tsc -p tsconfig.json && node -e \"require('fs').chmodSync('dist/index.js', 0o755)\"",
24
+ "build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.json && node -e \"require('fs').chmodSync('dist/index.js', 0o755)\"",
25
25
  "verify:boot": "bash scripts/verify-boot.sh",
26
26
  "start": "node dist/index.js",
27
27
  "dev": "tsx src/index.ts",
@@ -1,45 +0,0 @@
1
- /**
2
- * DX-3426 — the shared recursive FIELD-TREE shape.
3
- *
4
- * The dashboard's single-card, batch card and plan reads (`danxbot_api`
5
- * against `GET /api/issues/:id`, `GET /api/issues`, `GET /api/plans/:planId`
6
- * — DX-3428) take a nested JSON tree instead of a
7
- * flat field-GROUP list: each key names a field or relation of the resource
8
- * at that level, and each value is either `true` (the field, or a relation's
9
- * child with its default fields), a non-negative integer (a cursor-paged
10
- * relation's own `limit` argument), an opaque cursor STRING (a paged
11
- * relation's `before` — DX-3428: not every relation's cursor is a plain
12
- * integer, e.g. a plan event's visibility-scanned row id), a non-empty
13
- * STRING or ARRAY OF STRINGS (a relation's own declared, non-paging argument
14
- * — e.g. `records`' `kind`, `events`' `kinds`/`origin`/`writer`), or another
15
- * field tree (a relation's child with a NAMED field selection). Example:
16
- *
17
- * {"description": true, "ac": true, "problems": {"solutions": {"steps": true}, "decisions": true}, "comments": {"limit": 10}, "records": {"kind": "goal"}}
18
- *
19
- * One schema, one module — every tool that accepts a field tree imports THIS
20
- * export rather than redeclaring the shape, so the recursion is defined once
21
- * and every caller's JSON Schema serializes the same way. `z.lazy` is
22
- * required because the schema refers to itself; `zod-to-json-schema` (the
23
- * MCP SDK's own zod v3 → JSON Schema converter, see
24
- * `@modelcontextprotocol/sdk`'s `zod-json-schema-compat.ts`) resolves that
25
- * self-reference to a local `$ref` rather than unrolling it infinitely —
26
- * verified directly against the listed tool schema in
27
- * `__tests__/tool-defs.test.ts`, not assumed from reading the library's
28
- * source. The problem-solutions route's pre-existing `steps` field (DX-3310)
29
- * is the same `z.lazy` self-reference pattern already shipping on this server.
30
- */
31
- import { z } from "zod";
32
- /**
33
- * The shared schema. A record whose values are `true`, a non-negative
34
- * integer, a non-empty string, a non-empty array of non-empty strings, or
35
- * the same schema recursively — generic on purpose (no issue/plan-specific
36
- * field names baked in here) so every tool that reads a resource tree
37
- * reuses it unchanged.
38
- */
39
- export const fieldTreeSchema = z.lazy(() => z.record(z.union([
40
- z.literal(true),
41
- z.number().int().nonnegative(),
42
- z.string().min(1),
43
- z.array(z.string().min(1)).min(1),
44
- fieldTreeSchema,
45
- ])));
package/dist/priority.js DELETED
@@ -1,70 +0,0 @@
1
- /**
2
- * Tier-word → numeric priority resolution for `danxbot_api`'s
3
- * `PATCH /api/issues/:id/edit` route (DX-1532).
4
- *
5
- * Priority is a STRUCTURED numeric column `issues.priority` (float in `[0,6)`).
6
- * Both the Trello "priority" label and the dashboard priority badge read it via
7
- * `priorityTier(issue.priority)` — description PROSE ("Priority: Low") is read
8
- * by neither. So an agent that "sets priority" by editing description text
9
- * produces a silent false-positive: nothing downstream changes. The fix is to
10
- * let the agent write the numeric column through the issue-edit route.
11
- *
12
- * Agents (and operators) speak in tier WORDS ("low" / "high"), so the tool
13
- * accepts a tier word and resolves it to the tier's MIDPOINT here — the inverse
14
- * of `src/issue-tracker/priority-tier.ts#priorityTier`. A raw numeric is passed
15
- * through unchanged for the server route to range-validate (it 400s on
16
- * out-of-`[0,6)`), so the MCP boundary never has to duplicate that bound.
17
- *
18
- * This package is a standalone published artifact and cannot import the
19
- * backend's `priority-tier` module, so the midpoint table is duplicated here.
20
- * Each value IS the `[min,max)` bucket midpoint by construction and equals the
21
- * backend's `PRIORITY_TIERS.defaultValue`; `src/issue-tracker/priority-tier.test.ts`
22
- * asserts `priorityTier(defaultValue) === key` on the canonical side, pinning
23
- * the round-trip these midpoints rely on.
24
- */
25
- /**
26
- * The six priority tier words, low → high. A const tuple so it doubles as the
27
- * `z.enum` source in `index.ts`.
28
- */
29
- export const PRIORITY_TIER_WORDS = [
30
- "lowest",
31
- "low",
32
- "medium",
33
- "high",
34
- "very_high",
35
- "critical",
36
- ];
37
- /**
38
- * Tier word → bucket midpoint (inverse of `priorityTier`). Lands the numeric
39
- * column squarely inside the requested tier so a later `priorityTier` read
40
- * returns the same word.
41
- */
42
- export const PRIORITY_TIER_MIDPOINTS = {
43
- lowest: 0.5,
44
- low: 1.5,
45
- medium: 2.5,
46
- high: 3.5,
47
- very_high: 4.5,
48
- critical: 5.5,
49
- };
50
- /**
51
- * Resolve a priority input — a tier WORD or a raw numeric — to the numeric
52
- * value the `PATCH /api/issues/:id/edit` route stores in `issues.priority`.
53
- *
54
- * - tier word → its bucket midpoint (`PRIORITY_TIER_MIDPOINTS`).
55
- * - number → passed through unchanged; the server route range-validates it to
56
- * `[0,6)` and 400s otherwise (the MCP boundary deliberately does not
57
- * re-validate the bound — single source of truth on the route).
58
- * - unknown string → throws here at the MCP boundary (no round-trip). The Zod
59
- * enum on the tool schema already rejects this for tool callers; the explicit
60
- * throw keeps the helper safe for any direct caller.
61
- */
62
- export function resolvePriority(input) {
63
- if (typeof input === "number")
64
- return input;
65
- const midpoint = PRIORITY_TIER_MIDPOINTS[input];
66
- if (midpoint === undefined) {
67
- throw new Error(`issue-edit: unknown priority tier word "${input}" (expected one of ${PRIORITY_TIER_WORDS.join(", ")} or a number in [0,6))`);
68
- }
69
- return midpoint;
70
- }