@thehammer/danx-dashboard-mcp 0.1.19 → 0.1.20
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/dist/http-client.js +7 -0
- package/dist/index.js +15 -0
- package/package.json +1 -1
package/dist/http-client.js
CHANGED
|
@@ -11,6 +11,13 @@ export class DashboardHttpClient {
|
|
|
11
11
|
Authorization: `Bearer ${this.config.token}`,
|
|
12
12
|
Accept: "application/json",
|
|
13
13
|
};
|
|
14
|
+
// DX-1398 Hop 3 (outbound) — stamp the cross-process trace at the SAME
|
|
15
|
+
// single choke point that stamps Authorization, so every call (GET + every
|
|
16
|
+
// write) chains under the originating launch. Omitted when the dispatch
|
|
17
|
+
// carries no trace context (the dashboard then mints a fresh root).
|
|
18
|
+
if (this.config.traceparent) {
|
|
19
|
+
headers["traceparent"] = this.config.traceparent;
|
|
20
|
+
}
|
|
14
21
|
let bodyString;
|
|
15
22
|
if (args.body !== undefined) {
|
|
16
23
|
headers["Content-Type"] = "application/json";
|
package/dist/index.js
CHANGED
|
@@ -60,6 +60,17 @@ function readEnvOrDie(name) {
|
|
|
60
60
|
}
|
|
61
61
|
return v;
|
|
62
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* Read an OPTIONAL env var, treating empty string as absent. DX-1398 — the
|
|
65
|
+
* worker injects `DANXBOT_TRACEPARENT` for a traced dispatch and substitutes it
|
|
66
|
+
* to `""` for an untraced one (the optional-placeholder default), so empty
|
|
67
|
+
* MUST read as "no trace" rather than a literal value. Never exits — an
|
|
68
|
+
* untraced dispatch is valid.
|
|
69
|
+
*/
|
|
70
|
+
function readEnvOptional(name) {
|
|
71
|
+
const v = process.env[name];
|
|
72
|
+
return typeof v === "string" && v !== "" ? v : undefined;
|
|
73
|
+
}
|
|
63
74
|
// Compose the dispatch's qualified board id (`<repo>:<slug>`) from the
|
|
64
75
|
// two env halves the worker injects. DANXBOT_BOARD_NAME already carries
|
|
65
76
|
// the board SLUG at the spawn site (src/dispatch/core.ts sets it from
|
|
@@ -69,6 +80,10 @@ const config = {
|
|
|
69
80
|
baseUrl: readEnvOrDie("DANXBOT_DASHBOARD_URL"),
|
|
70
81
|
token: readEnvOrDie("DANXBOT_DISPATCH_TOKEN"),
|
|
71
82
|
board: `${readEnvOrDie("DANX_REPO_NAME")}:${readEnvOrDie("DANXBOT_BOARD_NAME")}`,
|
|
83
|
+
// DX-1398 — OPTIONAL cross-process trace context. Present → stamped on every
|
|
84
|
+
// outbound call so the agent's card writes chain under the launch; absent
|
|
85
|
+
// (untraced dispatch) → omitted, and the dashboard mints a fresh root.
|
|
86
|
+
traceparent: readEnvOptional("DANXBOT_TRACEPARENT"),
|
|
72
87
|
};
|
|
73
88
|
const client = new DashboardHttpClient(config);
|
|
74
89
|
const server = new McpServer({
|
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.20",
|
|
4
4
|
"description": "Stdio MCP server wrapping danxbot's dashboard /api/issues/* normalized DB-backed HTTP routes for dispatched agents (DX-704 Phase 2).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|