@thehammer/danx-dashboard-mcp 0.1.325 → 0.1.327
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/danxbot-api-examples.js +1 -1
- package/dist/design-screenshot.js +11 -1
- package/dist/listen.js +8 -0
- package/package.json +1 -1
|
@@ -35,7 +35,7 @@ export const DANXBOT_API_EXAMPLES = {
|
|
|
35
35
|
cardRead: {
|
|
36
36
|
method: "GET",
|
|
37
37
|
path: "/api/issues/<id>",
|
|
38
|
-
query: { fields: { description: true, comments: true, checklists: true, parent_title: true } },
|
|
38
|
+
query: { fields: { description: true, agent_notes: true, comments: true, checklists: true, parent_title: true } },
|
|
39
39
|
},
|
|
40
40
|
cardCreate: {
|
|
41
41
|
method: "POST",
|
|
@@ -21,6 +21,15 @@ const READY_WAIT_MS = 5000;
|
|
|
21
21
|
export const READY_MESSAGE = "danx-design:ready";
|
|
22
22
|
const READY_LISTENER = `window.__danxDesignReady = false; window.addEventListener("message", function (e) { ` +
|
|
23
23
|
`if (e.data && e.data.type === ${JSON.stringify(READY_MESSAGE)}) window.__danxDesignReady = true; });`;
|
|
24
|
+
/**
|
|
25
|
+
* DX-5350: the screenshot renders the page outside `SandboxedFrame`, so `window.danxMiniApp` (which the frame injects, `@danxbot/ui` 27.0.0)
|
|
26
|
+
* is restated here as a stub: `holdReady`, a once-only `ready` and ready-on-`load` unless held, posting the same ready message the listener
|
|
27
|
+
* above hears. `reportError` and `onAppearance` are no-ops so a harness never throws.
|
|
28
|
+
*/
|
|
29
|
+
const MINI_APP_STUB = `(function () { var held = false, posted = false; ` +
|
|
30
|
+
`function ready() { if (posted) return; posted = true; window.postMessage({ type: ${JSON.stringify(READY_MESSAGE)} }, "*"); } ` +
|
|
31
|
+
`window.danxMiniApp = { holdReady: function () { held = true; }, ready: ready, reportError: function () {}, onAppearance: function () { return function () {}; } }; ` +
|
|
32
|
+
`window.addEventListener("load", function () { if (!held) ready(); }); })();`;
|
|
24
33
|
function none(reason) {
|
|
25
34
|
return { png_base64: null, screenshot: `none: ${reason}` };
|
|
26
35
|
}
|
|
@@ -100,8 +109,9 @@ export async function captureWith(where, offline, drive) {
|
|
|
100
109
|
export function captureScreenshot(html, where) {
|
|
101
110
|
return captureWith(where, true, async (page) => {
|
|
102
111
|
await page.addInitScript(READY_LISTENER);
|
|
112
|
+
await page.addInitScript(MINI_APP_STUB);
|
|
103
113
|
await page.setContent(html, { waitUntil: "load" });
|
|
104
|
-
// The page has loaded; a design that never posts ready (it threw
|
|
114
|
+
// The page has loaded; a design that never posts ready (it threw) is still captured as it stands.
|
|
105
115
|
await page.waitForFunction("window.__danxDesignReady === true", undefined, { timeout: READY_WAIT_MS }).catch(() => undefined);
|
|
106
116
|
});
|
|
107
117
|
}
|
package/dist/listen.js
CHANGED
|
@@ -182,6 +182,11 @@ export function invalidEventReason(value) {
|
|
|
182
182
|
}
|
|
183
183
|
case "blocked":
|
|
184
184
|
return isCappedText(d.reason) ? null : "detail.reason is not capped text";
|
|
185
|
+
// DX-5323: an agent wrote a note in its working log on the card (never a comment).
|
|
186
|
+
case "agent_note_added":
|
|
187
|
+
if (typeof d.note_id !== "number")
|
|
188
|
+
return "detail.note_id is not a number";
|
|
189
|
+
return isCappedText(d.excerpt) ? null : "detail.excerpt is not capped text";
|
|
185
190
|
// DX-4622: a reviewer asked for changes on the card's pull request (GitHub review webhook).
|
|
186
191
|
case "pull_request_changes_requested":
|
|
187
192
|
if (typeof d.reviewer !== "string")
|
|
@@ -282,6 +287,9 @@ function describe(event) {
|
|
|
282
287
|
}
|
|
283
288
|
case "blocked":
|
|
284
289
|
return `${who} blocked the card: ${quoted(d.reason)}`;
|
|
290
|
+
// DX-5323: a working-log entry for the next agent; the full note is the card's `agent_notes`.
|
|
291
|
+
case "agent_note_added":
|
|
292
|
+
return `${who} wrote an agent note: ${quoted(d.excerpt)}`;
|
|
285
293
|
case "unblocked":
|
|
286
294
|
return `${who} unblocked the card`;
|
|
287
295
|
// DX-4622: the agent must act on the review, so the line names who, where, and what to do next.
|
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.327",
|
|
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",
|