@thehammer/danx-dashboard-mcp 0.1.177 → 0.1.179

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/index.js CHANGED
File without changes
package/dist/lifecycle.js CHANGED
@@ -77,6 +77,7 @@ export function readLifecycleUrlsFromEnv() {
77
77
  slackRecoveryMessage: opt("DANXBOT_SLACK_RECOVERY_MESSAGE_URL"),
78
78
  slackRecoveryCreateOrLink: opt("DANXBOT_SLACK_RECOVERY_CREATE_OR_LINK_URL"),
79
79
  qualityGate: opt("DANXBOT_QUALITY_GATE_URL"),
80
+ requestCodeReview: opt("DANXBOT_REQUEST_CODE_REVIEW_URL"),
80
81
  evaluatorSummary: opt("DANXBOT_EVALUATOR_SUMMARY_URL"),
81
82
  saveTemplateApp: opt("DANXBOT_TEMPLATE_APP_SAVE_URL"),
82
83
  loadTemplateApp: opt("DANXBOT_TEMPLATE_APP_LOAD_URL"),
@@ -323,18 +324,24 @@ export function registerLifecycleTools(strictTool) {
323
324
  return { content: [{ type: "text", text: JSON.stringify(result) }] };
324
325
  });
325
326
  // ---------------- quality_gate_complete (absorbs quality_gate_skip, DX-3394 problem 1682) ----------------
326
- const qualityGateComplete = strictTool("quality_gate_complete", "Sign off a registered quality gate. Two flavors by the gate's PHASE: (PLAN, e.g. plan-architecture) — " +
327
- "runs as its own dispatch; this call is that dispatch's TERMINAL call: status='pass' releases the " +
328
- "dispatch (the picker launches the next gate or the work agent); status='fail' BLOCKS the card (your " +
329
- "message becomes the reason) and stops the dispatch (do NOT follow up with danxbot_complete); " +
330
- "status='retry' — the fixer loop: you edited the card into a sounder plan and want a fresh pass. " +
331
- "(CODE, e.g. code-quality) — runs INLINE in your WORK session: stamps the gate + stores findings and " +
332
- "does NOTHING else. You CONTINUE: fix any blocking findings, re-run to a pass, then finalize and " +
333
- "complete the card normally. status='skipped' — the gate is OBVIOUSLY UNNECESSARY for this diff " +
334
- "(a single-line / docs-only change, or nothing in this gate's lane): use `message` as the mandatory " +
335
- `justification (≥${QUALITY_GATE_SKIP_REASON_MIN_CHARS} chars, the permanent accountability record a ` +
336
- "reviewer will read) — never skip to dodge a real review. A skipped required gate does not block " +
337
- "transitioning the card to complete (through danxbot_api) and does not re-dispatch a PRE gate.", {
327
+ const qualityGateComplete = strictTool("quality_gate_complete", "Sign off a registered quality gate. NEVER visible to (or callable by) the WORK dispatch that authored " +
328
+ "the diff — DX-3741: every gate, PLAN or CODE, runs as its OWN independent gate-reviewer dispatch, so " +
329
+ "seeing this tool at all means you ARE that reviewer, not the author. Two flavors by the gate's PHASE: " +
330
+ "(PLAN, e.g. plan-architecture) — reviews the CARD's plan before any code exists; this call is your " +
331
+ "dispatch's TERMINAL call: status='pass' releases the dispatch (the picker launches the next gate or " +
332
+ "the work agent); status='fail' BLOCKS the card (your message becomes the reason) and stops the " +
333
+ "dispatch (do NOT follow up with danxbot_complete); status='retry' — the fixer loop: you edited the " +
334
+ "card into a sounder plan and want a fresh pass. (CODE, e.g. code-quality) — reviews `git diff " +
335
+ "origin/main...HEAD` on the author's `card/<id>` branch, already pushed to origin; this call is ALSO " +
336
+ "your dispatch's TERMINAL call: report every finding via `findings[]`; status='fail' releases the " +
337
+ "dispatch (does NOT block the card) — the author's WORK session, re-dispatched, reads your findings, " +
338
+ "fixes them, and calls request_code_review again, which re-dispatches every requested code gate fresh; " +
339
+ "status='pass' releases the dispatch toward the next requested code gate or back to WORK to finalize; " +
340
+ "status='retry' is PLAN-phase only, refused here. status='skipped' — the gate is OBVIOUSLY " +
341
+ "UNNECESSARY for this diff (a single-line / docs-only change, or nothing in this gate's lane): use " +
342
+ `\`message\` as the mandatory justification (≥${QUALITY_GATE_SKIP_REASON_MIN_CHARS} chars, the ` +
343
+ "permanent accountability record a human will read) — never skip to dodge a real review. You never " +
344
+ "edit files and never transition the card yourself, on either phase.", {
338
345
  gate: z.string().describe("Registered gate name, e.g. 'plan-architecture' or 'code-quality'."),
339
346
  status: z.enum(["pass", "fail", "retry", "skipped"]),
340
347
  message: z
@@ -367,6 +374,21 @@ export function registerLifecycleTools(strictTool) {
367
374
  const result = await postWorkerRoute(url, body, "quality_gate_complete", agentBearer());
368
375
  return { content: [{ type: "text", text: JSON.stringify(result) }] };
369
376
  });
377
+ // ---------------- request_code_review (DX-3741) ----------------
378
+ const requestCodeReview = strictTool("request_code_review", "TERMINAL for this dispatch — call it when your diff is done and its own tests are green, instead of " +
379
+ "danxbot_complete. Pushes your branch (card/<id> to origin/card/<id>), then dispatches every code " +
380
+ "gate this card carries as its OWN independent gate-reviewer dispatch (you never sign or review your " +
381
+ "own diff — DX-3741). Ends this dispatch 'completed' and releases the card to ToDo; when the card is " +
382
+ "re-dispatched to you, read its quality_gates (through danxbot_api): every code gate pass/skipped → " +
383
+ "run agent-finalize.sh and complete normally; any fail → fix its findings, then call " +
384
+ "request_code_review again (never sign or remove a code gate yourself — removal is refused, 409). " +
385
+ "Takes no arguments. A card with no code gates has nothing to request — finalize directly instead.", {}, async () => {
386
+ const url = readLifecycleUrlsFromEnv().requestCodeReview;
387
+ if (!url)
388
+ throw new Error("request_code_review called outside a work dispatch");
389
+ const result = await postWorkerRoute(url, {}, "request_code_review", agentBearer());
390
+ return { content: [{ type: "text", text: JSON.stringify(result) }] };
391
+ });
370
392
  // ---------------- danxbot_set_evaluator_summary ----------------
371
393
  const evaluatorSummary = strictTool("danxbot_set_evaluator_summary", "Write the root-cause summary for a 3-strike broken agent. ONLY the system-evaluator dispatch sees this " +
372
394
  "tool. Call exactly once at the END of the dispatch, immediately before danxbot_complete. A dispatch " +
@@ -424,6 +446,7 @@ export function registerLifecycleTools(strictTool) {
424
446
  slackRecoveryMessage,
425
447
  slackRecoveryCreateOrLink,
426
448
  qualityGateComplete,
449
+ requestCodeReview,
427
450
  evaluatorSummary,
428
451
  saveTemplateApp,
429
452
  loadTemplateApp,
@@ -453,6 +476,7 @@ export function applyLifecycleVisibility(tools, urls) {
453
476
  setVisible(tools.slackRecoveryMessage, !!urls.slackRecoveryMessage);
454
477
  setVisible(tools.slackRecoveryCreateOrLink, !!urls.slackRecoveryCreateOrLink);
455
478
  setVisible(tools.qualityGateComplete, !!urls.qualityGate);
479
+ setVisible(tools.requestCodeReview, !!urls.requestCodeReview);
456
480
  setVisible(tools.evaluatorSummary, !!urls.evaluatorSummary);
457
481
  setVisible(tools.saveTemplateApp, !!urls.saveTemplateApp);
458
482
  setVisible(tools.loadTemplateApp, !!urls.loadTemplateApp);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thehammer/danx-dashboard-mcp",
3
- "version": "0.1.177",
3
+ "version": "0.1.179",
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",