@thehammer/danx-dashboard-mcp 0.1.278 → 0.1.279
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/listen.js +29 -0
- package/package.json +1 -1
package/dist/listen.js
CHANGED
|
@@ -79,6 +79,11 @@ function isRecord(value) {
|
|
|
79
79
|
function isCappedText(value) {
|
|
80
80
|
return isRecord(value) && typeof value.text === "string" && typeof value.truncated === "boolean";
|
|
81
81
|
}
|
|
82
|
+
/** DX-4078 - hand-copied from `DESIGN_DECISION_OUTCOMES` (`src/issues/view-types.ts`): this published package cannot import danxbot source. */
|
|
83
|
+
const DESIGN_OUTCOMES = ["approved", "rejected", "changes_requested"];
|
|
84
|
+
function isDesignOutcome(value) {
|
|
85
|
+
return typeof value === "string" && DESIGN_OUTCOMES.includes(value);
|
|
86
|
+
}
|
|
82
87
|
/**
|
|
83
88
|
* DX-3880 — the part `solution_answered` and `problem_answer_changed` share: the
|
|
84
89
|
* decision's `outcome` and the either/or body it implies. A rejection (the
|
|
@@ -188,6 +193,20 @@ export function invalidEventReason(value) {
|
|
|
188
193
|
if (typeof d.review_url !== "string")
|
|
189
194
|
return "detail.review_url is not a string";
|
|
190
195
|
return isCappedText(d.excerpt) ? null : "detail.excerpt is not capped text";
|
|
196
|
+
// DX-4078: the operator's verdict on a design revision. An outcome this listener does not know is refused, never rendered as the bare
|
|
197
|
+
// kind line, which would name no outcome and no note and leave the agent to re-read the card. `rejected` and `changes_requested` always
|
|
198
|
+
// carry their note (the table CHECK); `approved` may carry none.
|
|
199
|
+
case "design_decided": {
|
|
200
|
+
if (typeof d.decision_id !== "number")
|
|
201
|
+
return "detail.decision_id is not a number";
|
|
202
|
+
if (typeof d.revision_no !== "number")
|
|
203
|
+
return "detail.revision_no is not a number";
|
|
204
|
+
if (!isDesignOutcome(d.outcome))
|
|
205
|
+
return 'detail.outcome is not "approved", "rejected" or "changes_requested"';
|
|
206
|
+
if (d.note === null)
|
|
207
|
+
return d.outcome === "approved" ? null : `detail.note (the ${d.outcome} reason) is null`;
|
|
208
|
+
return isCappedText(d.note) ? null : "detail.note is not null or capped text";
|
|
209
|
+
}
|
|
191
210
|
default:
|
|
192
211
|
return null;
|
|
193
212
|
}
|
|
@@ -266,6 +285,16 @@ function describe(event) {
|
|
|
266
285
|
// DX-4622: the agent must act on the review, so the line names who, where, and what to do next.
|
|
267
286
|
case "pull_request_changes_requested":
|
|
268
287
|
return `${who}: ${d.reviewer} requested changes on the pull request (${d.review_url})${d.excerpt.text === "" ? "" : `: ${quoted(d.excerpt)}`}. Address the review, push, and reply on the pull request`;
|
|
288
|
+
// DX-4078: names the outcome, the revision and the note, and what the agent does next, so it never has to re-read the card to learn the verdict.
|
|
289
|
+
case "design_decided": {
|
|
290
|
+
const note = d.note;
|
|
291
|
+
const revision = `revision ${d.revision_no} of the design`;
|
|
292
|
+
if (d.outcome === "approved")
|
|
293
|
+
return `${who} APPROVED ${revision}${note === null ? "" : ` — note: ${quoted(note)}`}. The design is closed; build from it`;
|
|
294
|
+
if (d.outcome === "rejected")
|
|
295
|
+
return `${who} REJECTED ${revision} — reason: ${quoted(note)}. The design is closed; do not continue it`;
|
|
296
|
+
return `${who} requested changes on ${revision} — ${quoted(note)}. Publish a new revision that addresses it`;
|
|
297
|
+
}
|
|
269
298
|
default:
|
|
270
299
|
// A kind newer than this listener still produces a line: an event the
|
|
271
300
|
// agent is never told about is exactly the failure this reader prevents.
|
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.279",
|
|
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, request_permission, attach_file, and danxbot_slack_reply) (DX-3465, PLN-11 R-25).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|