@thehammer/danx-dashboard-mcp 0.1.140 → 0.1.142
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/handlers.js +29 -0
- package/dist/index.js +112 -103
- package/package.json +1 -1
package/dist/handlers.js
CHANGED
|
@@ -806,6 +806,35 @@ export async function issueQualityGateVerdict(client, args) {
|
|
|
806
806
|
board: args.board,
|
|
807
807
|
});
|
|
808
808
|
}
|
|
809
|
+
// ---------------- quality_gate_instruction ----------------
|
|
810
|
+
const QUALITY_GATE_INSTRUCTION_BASE_PATH = "/api/quality-gates";
|
|
811
|
+
/**
|
|
812
|
+
* DX-3341 (PLN-11 R-20) — fetch a named gate's CURRENT instruction via
|
|
813
|
+
* GET /api/quality-gates/:gate/instruction. NOT card-scoped (unlike
|
|
814
|
+
* `issue_quality_gate`/`issue_quality_gate_verdict` above) — this reads the
|
|
815
|
+
* gate's DB-catalog SKILL PROSE for the calling session's board/repo, byte-
|
|
816
|
+
* identical to what a dispatched gate reviewer's clean-room materializes at
|
|
817
|
+
* `.claude/skills/<segment>/SKILL.md`. No second source: the dashboard route
|
|
818
|
+
* behind this call reuses the exact same catalog-read + materialize-transform
|
|
819
|
+
* chain a real gate dispatch's clean-room assembly uses.
|
|
820
|
+
*
|
|
821
|
+
* Use this to run a quality gate from an operator session (R-19/R-20): fetch
|
|
822
|
+
* the gate's instruction with this tool, dispatch a `danxbot:worker-*` tier
|
|
823
|
+
* chosen by effort with that instruction, review, then record the verdict
|
|
824
|
+
* via `issue_quality_gate_verdict` — never a hand-written review brief.
|
|
825
|
+
*
|
|
826
|
+
* `gate` is a registry name (same enum `issue_quality_gate` accepts). Unknown
|
|
827
|
+
* gate -> 400; a registered gate with no resolvable catalog skill artifact
|
|
828
|
+
* for this repo (a boot-seed/catalog-drift defect) -> 500.
|
|
829
|
+
*/
|
|
830
|
+
export async function qualityGateInstruction(client, args) {
|
|
831
|
+
return client.request({
|
|
832
|
+
method: "GET",
|
|
833
|
+
path: `/${encodeURIComponent(args.gate)}/instruction`,
|
|
834
|
+
basePath: QUALITY_GATE_INSTRUCTION_BASE_PATH,
|
|
835
|
+
board: args.board,
|
|
836
|
+
});
|
|
837
|
+
}
|
|
809
838
|
export async function issueRetro(client, args) {
|
|
810
839
|
const { id, board, ...body } = args;
|
|
811
840
|
return client.request({
|
package/dist/index.js
CHANGED
|
@@ -28,6 +28,8 @@
|
|
|
28
28
|
* PATCH /api/issues/:id/quality-gates/:gate
|
|
29
29
|
* - issue_retro PUT /api/issues/:id/retro
|
|
30
30
|
* - issue_attach POST /api/issues/:id/attachments (reads a local file)
|
|
31
|
+
* - quality_gate_instruction
|
|
32
|
+
* GET /api/quality-gates/:gate/instruction (DX-3341, not card-scoped)
|
|
31
33
|
* - repo_knowledge_get GET /api/repo-knowledge
|
|
32
34
|
* - repo_knowledge_set PUT /api/repo-knowledge (DX-1128, Story 2)
|
|
33
35
|
* - brief_list GET /api/brief
|
|
@@ -104,7 +106,7 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
|
104
106
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
105
107
|
import { z } from "zod";
|
|
106
108
|
import { DashboardHttpClient } from "./http-client.js";
|
|
107
|
-
import { issueAttach, issueChecklist, issueComment, issueCreate, issueDependency, issueEdit, issueGet, issueList, issueProblem, issueQualityGate, issueQualityGateVerdict, issueRetireBranch, issueRetro, issueSolution, issueTransition, issueTriage, briefGetPage, briefList, briefSetPage, failureCategoryCreate, failureCategoryList, failureCategoryUpdate, dispatchTranscriptSearch, planAddArchitectureSection, planAddCard, planAddNote, planAddRecord, planConnect, planCreate, planDeleteArchitectureSection, planDeleteNote, planDeleteRecord, planGet, PLAN_FIELD_GROUPS, PLAN_EVENT_KINDS, PLAN_EVENT_ORIGINS, PLAN_STATUSES, ISSUE_BATCH_GET_MAX, LIST_PAGE_MAX_LIMIT, PLAN_GET_CARDS_DEFAULT_LIMIT, PLAN_GET_EVENTS_DEFAULT_LIMIT, PLAN_GET_EVENTS_MAX_LIMIT, planGetArchitectureSection, planGetRecord, planList, planRemoveCard, planRename, planReorderArchitectureSection, planUpdateArchitectureSection, planUpdateNote, planUpdateRecord, repoKnowledgeGet, repoKnowledgeSet, } from "./handlers.js";
|
|
109
|
+
import { issueAttach, issueChecklist, issueComment, issueCreate, issueDependency, issueEdit, issueGet, issueList, issueProblem, issueQualityGate, issueQualityGateVerdict, issueRetireBranch, issueRetro, issueSolution, issueTransition, issueTriage, briefGetPage, briefList, briefSetPage, failureCategoryCreate, failureCategoryList, failureCategoryUpdate, dispatchTranscriptSearch, planAddArchitectureSection, planAddCard, planAddNote, planAddRecord, planConnect, planCreate, planDeleteArchitectureSection, planDeleteNote, planDeleteRecord, planGet, PLAN_FIELD_GROUPS, PLAN_EVENT_KINDS, PLAN_EVENT_ORIGINS, PLAN_STATUSES, ISSUE_BATCH_GET_MAX, LIST_PAGE_MAX_LIMIT, PLAN_GET_CARDS_DEFAULT_LIMIT, PLAN_GET_EVENTS_DEFAULT_LIMIT, PLAN_GET_EVENTS_MAX_LIMIT, planGetArchitectureSection, planGetRecord, planList, planRemoveCard, planRename, planReorderArchitectureSection, planUpdateArchitectureSection, planUpdateNote, planUpdateRecord, repoKnowledgeGet, repoKnowledgeSet, qualityGateInstruction, } from "./handlers.js";
|
|
108
110
|
import { PRIORITY_TIER_WORDS } from "./priority.js";
|
|
109
111
|
function readEnvOrDie(name) {
|
|
110
112
|
const v = process.env[name];
|
|
@@ -352,12 +354,17 @@ const DESCRIPTION_DESCRIBE = 'The full body ("Context"): evidence, examples, tec
|
|
|
352
354
|
// R-16: fold a skill's rule into the tool description it governs rather than
|
|
353
355
|
// require a separate load). Shared by every prose-writing field below so an
|
|
354
356
|
// agent sees the same rules wherever it writes card markdown.
|
|
357
|
+
// DX-2623 — this constant (and every `.describe()` reference to it) must stay
|
|
358
|
+
// reachable: an earlier dedup pass (05af82086) deleted it outright and left
|
|
359
|
+
// the "never escape markdown" / "GFM not ASCII tables" rules unreachable from
|
|
360
|
+
// any tool in this surface until it was restored. The text below (from
|
|
361
|
+
// DX-3335) already carries both clauses — do not dedup them away again.
|
|
355
362
|
const MARKDOWN_STYLE_DESCRIBE = "Renders as markdown here. Use `##`/`###` headers, fenced code blocks with a language tag, inline code for paths/symbols/flags, `-`/`1.` lists, and GFM tables (`|---|`) for 2D data — never ASCII tables. Never escape markdown characters (`\\*`, `\\_`) to \"play it safe\"; they render wrong. Don't repeat the same content as both prose and a list. Structure the content itself per `base:convey` (concept-first headline, diff, caveats, verify) — this rule only governs the markdown syntax.";
|
|
356
363
|
// ---------------- issue_list ----------------
|
|
357
364
|
strictTool("issue_list",
|
|
358
365
|
// DX-2735: trimmed to pay for the problem tools inside the work-profile
|
|
359
366
|
// injected-surface budget — same facts, no repeated prose.
|
|
360
|
-
"List cards
|
|
367
|
+
"List cards. Board-scoped; see `board`. `filter`: type, parent_id, dispatchable_derived, status_derived[], self_dispatchable_derived, assigned_agent, include_closed, include_deleted, q (free text over id+title+description). THE DEFAULT ROW IS MINIMAL — scalars only (id, type, title, status, parent_id, priority, created_at, updated_at, assigned_agent, content_hash), no joins; opt into heavy data with `fields` groups: description (+ summary), problems (open_problem_count — a card needs a human exactly when this is > 0), ac, comments, retro, dependencies, triage, assignment, quality_gates, children, effort. `sort`: [{column, order}] over id|priority|repo_name|title|type|status_derived|triage_ice_total|created_at|updated_at (default order: see `sort`'s own field description). `limit`/`offset` page (uncapped by default). `include_closed` defaults to FALSE: a bare call silently excludes every Done/Cancelled card (leaf AND container alike). The response always carries `total` (the full count matching every filter except limit/offset — compare against `issues.length` to tell an exhausted list from a truncated one) and, whenever `include_closed` was not explicitly `true`, `closed_excluded` (how many additional terminal cards the default withheld — re-call with `include_closed: true` to see them). issue_get reads one card in full.", {
|
|
361
368
|
filter: z
|
|
362
369
|
.object({
|
|
363
370
|
q: z.string().optional(),
|
|
@@ -391,7 +398,7 @@ strictTool("issue_list",
|
|
|
391
398
|
strictTool("issue_get",
|
|
392
399
|
// DX-2735: trimmed to pay for the problem tools inside the work-profile
|
|
393
400
|
// injected-surface budget — same facts, no repeated prose.
|
|
394
|
-
"Fetch one card (
|
|
401
|
+
"Fetch one card (`id`) or many (`ids`, at most " + ISSUE_BATCH_GET_MAX + " — split larger sets); pass exactly one. Ids are globally unique, so both resolve from any board; the batch form is global and throws with `board`. THE DEFAULT ROW IS MINIMAL — scalars only (id, type, title, status, parent_id, priority, created_at, updated_at, assigned_agent, content_hash: the concurrency token issue_edit needs for title/description/checklists). `fields` opts into groups, per card in a batch too: description (body + summary), problems (live problems in order, each {id, statement, content_hash, open} with its solutions[] and decisions[] — a card needs a human exactly when open_problem_count > 0), ac (acceptance criteria + checklists), comments (paged via `comments_limit`/`comments_offset` — see their own field descriptions, single-id form only), retro, dependencies (waiting_on/conflict_on/blocked), triage (history + ICE), assignment (dispatch, assigned_agent, lifecycle timestamps), quality_gates (one row per gate {gate, required, status pending|pass|fail, completed_at, message}; a required PRE gate not `pass` pre-empts the work dispatch, and complete refuses while a required POST gate is not `pass`), children (ids + rollups), mirrors (external sync state), code_review_items, plans (every plan this card is on, `{id, ref, name}[]` via `plan_cards` — `ref` is the plan's `PLN-<id>`). Within a `comments` page, comments are ordered CHRONOLOGICALLY (oldest first) — only the requested WINDOW is anchored at the newest end, not the array itself; naming `comments_limit`/`comments_offset` alongside `ids` (the batch form) is refused. Single form: unknown id → 404. Batch form: `{issues: [...], not_found: [...ids]}` — an unknown or deleted id never fails the call.", {
|
|
395
402
|
id: z.string().min(1).optional(),
|
|
396
403
|
ids: z.array(z.string().min(1)).min(1).max(ISSUE_BATCH_GET_MAX).optional(),
|
|
397
404
|
fields: z
|
|
@@ -417,8 +424,8 @@ strictTool("issue_get",
|
|
|
417
424
|
...boardField,
|
|
418
425
|
}, async (args) => jsonResult(await issueGet(client, args)));
|
|
419
426
|
// ---------------- issue_create ----------------
|
|
420
|
-
strictTool("issue_create", '`plan` is REQUIRED on every create
|
|
421
|
-
'Create a card
|
|
427
|
+
strictTool("issue_create", '`plan` is REQUIRED on every create — no default, no inference; see its own field description for the two values and the refusal. This replaces the plan_add_card follow-up at creation time; plan_add_card remains for putting an EXISTING card on a plan. ' +
|
|
428
|
+
'Create a card. Board-scoped; see `board`. type=Epic REQUIRES non-empty phase_children[] (epic and phases inserted in one transaction; children get the epic as parent); other types refuse phase_children[] (400). Status starts at Review. `list_id` places the card straight into a column — a board_lists id or the list\'s display NAME (case-insensitive, emoji-tolerant): a `ready`-type queue lands it in ToDo, a `completed` list in Done, with no follow-up transition. Not valid on Epic; unknown name/id → 400. `quality_gates` adds gates beyond the board\'s type defaults (see its own field description); add one later with `issue_quality_gate`. ALWAYS pass `triage_enabled` explicitly on the root card and every phase child (see its own field description).', {
|
|
422
429
|
type: z.enum(ISSUE_TYPES),
|
|
423
430
|
title: z.string().min(1).describe(TITLE_DESCRIBE),
|
|
424
431
|
summary: z.string().min(1).optional().describe(SUMMARY_DESCRIBE),
|
|
@@ -430,7 +437,7 @@ strictTool("issue_create", '`plan` is REQUIRED on every create (DX-3006): pass "
|
|
|
430
437
|
plan: z
|
|
431
438
|
.literal("mine")
|
|
432
439
|
.nullable()
|
|
433
|
-
.describe('"mine" = attach to the plan THIS session is connected to; null = deliberately no plan. REQUIRED — decide per card. A plan id is not accepted: a card is only ever created onto your own connected plan
|
|
440
|
+
.describe('"mine" = attach to the plan THIS session is connected to; null = deliberately no plan. REQUIRED — decide per card, never omit. "mine" while unconnected is refused 409 session_not_connected (creates NO card). A plan id is not accepted: a card is only ever created onto your own connected plan.'),
|
|
434
441
|
parent_id: z.string().nullable().optional(),
|
|
435
442
|
ac: z.array(z.object({ title: z.string().min(1) }).strict()).optional(),
|
|
436
443
|
effort_level: z.enum(EFFORT_VALUES).nullable().optional(),
|
|
@@ -472,7 +479,7 @@ strictTool("issue_create", '`plan` is REQUIRED on every create (DX-3006): pass "
|
|
|
472
479
|
triage_enabled: z
|
|
473
480
|
.boolean()
|
|
474
481
|
.optional()
|
|
475
|
-
.describe("ALWAYS pass explicitly. true = enters automatic triage/dispatch without further human review; absent → false.
|
|
482
|
+
.describe("ALWAYS pass explicitly. true = enters automatic triage/dispatch without further human review; absent → false. Ignored by issue_triage and by an operator-initiated triage write."),
|
|
476
483
|
// DX-3238 — was absent from this schema entirely (not merely optional),
|
|
477
484
|
// so a caller's value was silently stripped before the request was built
|
|
478
485
|
// even though the route already honoured it (ALLOWED_CREATE_KEYS,
|
|
@@ -497,7 +504,7 @@ strictTool("issue_create", '`plan` is REQUIRED on every create (DX-3006): pass "
|
|
|
497
504
|
...boardField,
|
|
498
505
|
}, async (args) => jsonResult(await issueCreate(client, args, config.board)));
|
|
499
506
|
// ---------------- issue_edit ----------------
|
|
500
|
-
strictTool("issue_edit", 'Patch a card
|
|
507
|
+
strictTool("issue_edit", 'Patch a card. ALLOWED keys: title, summary, description, ac, checklists, effort_level, parent_id, priority, list_id, triage_enabled, type, content_hash. Any other key (lifecycle, triage, dependencies, retro, blocked) is refused 400 with offending_keys[] naming the right tool: issue_transition / issue_triage / issue_comment / issue_dependency / issue_problem / issue_retro. `type` (see its own field description) is how a planning item becomes work. `priority` (see its own field description) is the ONLY way to set priority; a "Priority:" line in the description does nothing. CHECKLISTS: each item has one status `incomplete|failing|passing|cancelled|deferred`; `deferred` (work done, a real-world/post-deploy check outstanding) REQUIRES `detail`, and a `📡`-prefixed item can never be `passing`. `ac` edits the default "Acceptance Criteria" checklist (items matched by check_item_id, else exact title); `checklists` REPLACES every named checklist with full status control (`{name, items:[{label, detail?, status}]}`). Send `ac` OR `checklists`, not both (400). `list_id` pins the card to a list by id or display NAME; its type must match the card\'s current derived status (400 otherwise — e.g. ready the card first before pinning it to a `ready`-type list); null clears the pin. `content_hash` (see its own field description) is the card\'s optimistic-concurrency token.', {
|
|
501
508
|
id: z.string().min(1),
|
|
502
509
|
title: z.string().min(1).optional().describe(TITLE_DESCRIBE),
|
|
503
510
|
summary: z
|
|
@@ -522,7 +529,7 @@ strictTool("issue_edit", 'Patch a card via PATCH /api/issues/:id/edit. ALLOWED k
|
|
|
522
529
|
detail: z
|
|
523
530
|
.string()
|
|
524
531
|
.optional()
|
|
525
|
-
.describe("
|
|
532
|
+
.describe("paired with `status`; required (non-empty) when `status` is `deferred`."),
|
|
526
533
|
check_item_id: z
|
|
527
534
|
.union([z.string(), z.number()])
|
|
528
535
|
.optional()
|
|
@@ -550,18 +557,18 @@ strictTool("issue_edit", 'Patch a card via PATCH /api/issues/:id/edit. ALLOWED k
|
|
|
550
557
|
triage_enabled: z
|
|
551
558
|
.boolean()
|
|
552
559
|
.optional()
|
|
553
|
-
.describe("Per-card opt-in to the automatic triage dispatcher (default false = never auto-selected).
|
|
560
|
+
.describe("Per-card opt-in to the automatic triage dispatcher (default false = never auto-selected). Ignored by issue_triage and by an operator-initiated triage write."),
|
|
554
561
|
content_hash: z
|
|
555
562
|
.string()
|
|
556
563
|
.min(1)
|
|
557
564
|
.optional()
|
|
558
|
-
.describe("The card's content_hash last read via issue_get/issue_list. REQUIRED whenever this edit touches title/description/checklists (NOT ac)
|
|
565
|
+
.describe("The card's content_hash last read via issue_get/issue_list's content_hash scalar (present even minimal). REQUIRED whenever this edit touches title/description/checklists (NOT ac, which keeps its own check_item_id/title diffing): missing → 400, stale → 409 stale_issue_content carrying currentHash + currentTitle + currentDescription — re-issue_get and retry with the fresh hash, never blindly."),
|
|
559
566
|
...boardField,
|
|
560
567
|
}, async (args) => jsonResult(await issueEdit(client, args)));
|
|
561
568
|
// ---------------- issue_transition ----------------
|
|
562
569
|
strictTool("issue_transition",
|
|
563
570
|
// DX-2735: trimmed with the problem tools to stay inside the work-profile budget.
|
|
564
|
-
"Move a card's lifecycle
|
|
571
|
+
"Move a card's lifecycle — the ONLY way; `danxbot_complete` never moves a card, so call this first. Actions: ready (Review→ToDo); pickup (ToDo→In Progress; checks every dispatch gate — ready, blocked, open_problem_count (a card needs a human exactly when this is > 0), depends_on terminal, conflict_on idle — and refuses 409 with failed_gate naming the cause; `manual:true` is a self-pickup for work in YOUR session: it bypasses card-flow gates EXCEPT open_problem_count, which never lets a card start, and is never auto-rolled-back — see `assigned_agent`'s own field description for the dispatched-agent requirement); rollback_pickup (see `keep_assignment`'s own field description); complete (your explicit decision; 409 on an Epic with non-terminal children (non_terminal_phases[]) or while a required POST quality gate is not pass (failed_gate 'quality_gate_post' + failed_post_gates[])); cancel (terminal); block (non-empty reason; only holds dispatch, never asks a human — for that use issue_problem add; env faults use `danxbot_complete({status:'failed'})`); unblock; archive (to Backlog, clears ready_at); reopen (terminal→active). Terminal cards refuse all but reopen; forward stamps never clear earlier ones. A pickup that loses a race is refused 409 `failed_gate: \"dispatch_id\"` — re-read assigned_agent/dispatch_id, never retry blindly.", {
|
|
565
572
|
id: z.string().min(1),
|
|
566
573
|
action: z.enum(TRANSITION_ACTIONS),
|
|
567
574
|
reason: z.string().optional(),
|
|
@@ -580,14 +587,14 @@ strictTool("issue_transition",
|
|
|
580
587
|
...boardField,
|
|
581
588
|
}, async (args) => jsonResult(await issueTransition(client, args)));
|
|
582
589
|
// ---------------- issue_triage ----------------
|
|
583
|
-
strictTool("issue_triage", "Record a triage confidence score
|
|
590
|
+
strictTool("issue_triage", "Record a triage confidence score. Caller sends a single `confidence` integer 0-5 plus a required non-empty `reason` — the server computes the verdict by comparing `confidence` against the board's configured thresholds (all band edges inclusive on the low side): confidence <= cancelThreshold -> cancel (stamps cancelled_at, terminal); cancelThreshold < confidence <= archiveThreshold -> defer (stamps archived_at AND ready_at:null); archiveThreshold < confidence <= reviewThreshold -> keep (no column stamp); confidence > reviewThreshold -> approve (stamps ready_at). REFUSES 409 on terminal cards. a keep/defer verdict does NOT block the card: it opens a problem asking the reason with three real choices (approve and ready / defer / cancel, one recommended) — opening it IS what puts the card in front of a human, the same escalation shape every other machine writer uses (the dashboard's Needs You tab reads only open_problem_count). Answering that problem applies the chosen outcome through the normal issue_transition actions automatically. It is not a cross-card ordering gate; use issue_dependency (kind: depends_on) to sequence one card after another.", {
|
|
584
591
|
id: z.string().min(1),
|
|
585
592
|
confidence: z.number().int().min(0).max(5),
|
|
586
593
|
reason: z.string().min(1),
|
|
587
594
|
...boardField,
|
|
588
595
|
}, async (args) => jsonResult(await issueTriage(client, args)));
|
|
589
596
|
// ---------------- issue_comment ----------------
|
|
590
|
-
strictTool("issue_comment", "Comment CRUD
|
|
597
|
+
strictTool("issue_comment", "Comment CRUD. action=add → {text, metadata?, problem_id?} (server stamps author from bearer + auto-incrementing ordinal); action=edit → PATCH /:cid {text}; action=delete → DELETE /:cid (soft-delete, audit trail preserved — comments are NEVER hard-deleted). Client-supplied author is IGNORED (server-stamped to prevent impersonation). `metadata` (action=add only) is an OPTIONAL opaque JSON object a calling app attaches to the comment — e.g. a generated `{sql, explanation}` packet its own UI renders specially. danxbot stores + returns it verbatim and enforces NO shape on its contents; omit for a plain markdown-only comment (unaffected either way). `problem_id` (action=add only) OPTIONALLY threads the comment as a follow-up question under one of this SAME card's problems (from `issue_problem` list/add) WITHOUT answering it — commenting never changes open_problem_count, blocked, or records a decision; use issue_problem's answer route for that. An unknown id, another card's id, or a removed problem's id all 404 naming the problem id — an ANSWERED (but not removed) problem still accepts a follow-up comment, since the thread continues after a decision.", {
|
|
591
598
|
id: z.string().min(1),
|
|
592
599
|
action: z.enum(["add", "edit", "delete"]),
|
|
593
600
|
comment_id: z.number().int().positive().optional(),
|
|
@@ -604,7 +611,7 @@ const CHECKLIST_ITEM_INPUT = z
|
|
|
604
611
|
status: z.enum(CHECKLIST_ITEM_STATUSES).optional(),
|
|
605
612
|
})
|
|
606
613
|
.strict();
|
|
607
|
-
strictTool("issue_checklist", "Targeted checklist CUD
|
|
614
|
+
strictTool("issue_checklist", "Targeted checklist CUD — mutates ONE checklist/item without `issue_edit({checklists})`'s wholesale replace, which drops any checklist you omit and churns every item id (orphaning its Trello mirror). Actions: add_list (name, items?) creates a checklist; update_list renames it; remove_list soft-deletes it; add_item appends an item (status defaults incomplete); update_item changes only the fields passed (≥1 required, keeps id + Trello link); remove_item soft-deletes one item. Status: incomplete|failing|passing|cancelled|deferred (terminal = passing|cancelled|deferred; deferred means the work is done but a real-world/post-deploy check remains — requires a non-empty `detail`). checklist_id required for every action except add_list; item_id for update_item/remove_item. Unknown card/checklist/item → 404, invalid status → 400. Additive — `issue_edit({checklists})` still works for bulk authoring.", {
|
|
608
615
|
id: z.string().min(1),
|
|
609
616
|
action: z.enum([
|
|
610
617
|
"add_list",
|
|
@@ -640,12 +647,10 @@ const STEP_INPUT = z.lazy(() => z
|
|
|
640
647
|
.int()
|
|
641
648
|
.positive()
|
|
642
649
|
.optional()
|
|
643
|
-
.describe("present -> this node IS an existing step (matched on this id
|
|
644
|
-
"
|
|
645
|
-
"
|
|
646
|
-
"
|
|
647
|
-
"for the ones you want preserved — send ids whenever an existing step's identity matters (checked " +
|
|
648
|
-
"progress, a later single-step edit)."),
|
|
650
|
+
.describe("present -> this node IS an existing step (matched on this id; 400 if not a live child of this exact " +
|
|
651
|
+
"parent scope). absent -> matched against unclaimed siblings by TITLE (first match), else created new. " +
|
|
652
|
+
"An id-less MIDDLE insert recreates every later id-less sibling's row — send ids whenever an existing " +
|
|
653
|
+
"step's identity matters (checked progress, a later edit)."),
|
|
649
654
|
title: z
|
|
650
655
|
.string()
|
|
651
656
|
.min(1)
|
|
@@ -655,7 +660,7 @@ const STEP_INPUT = z.lazy(() => z
|
|
|
655
660
|
steps: z.array(STEP_INPUT).optional().describe("this step's own children, nested — refused past 3 levels total"),
|
|
656
661
|
})
|
|
657
662
|
.strict());
|
|
658
|
-
strictTool("issue_problem", "A card's PROBLEMS
|
|
663
|
+
strictTool("issue_problem", "A card's PROBLEMS: one statement the operator must resolve (a question, or a flaw in the plan) OR an action only a person can carry out, each with its own solutions/answers — one problem per question. OPEN = not yet answered; the card needs a human exactly while open_problem_count > 0 — adding a problem IS putting the card in front of a human, there is no separate flag. list → live problems in order, each {id, statement, context, type, summary, content_hash, open, solutions[], decisions[]}; add {statement, context?, type?, summary?, solutions?} → problem_id + solution_ids in one transaction (zero solutions is valid: the operator answers free-form) plus a `reminders: [{key, text}]` array (DX-3365 — every MCP-response reminder rides this ONE field now, DB-registry-driven and operator-overridable from the dashboard) naming each still-open problem's solution count; edit :pid {base_hash, statement, context?, summary?}; remove :pid {base_hash} — always allowed, even as the card's last open problem (removing it just means the card no longer needs a human). A stale base_hash → 409 `stale_problem` with currentHash + currentProblem: merge, then retry. No answer action — the operator answers in the dashboard. `statement` is capped at 200 characters (400 names the actual length otherwise): one plain sentence, with any investigation detail in `context` (markdown, no cap) instead. Read `type`'s and `summary`'s own descriptions below before your first `add` — together they teach which type this is and the three-field split (`statement`/`summary`/`context`) an action needs.", {
|
|
659
664
|
id: z.string().min(1),
|
|
660
665
|
action: z.enum(["list", "add", "edit", "remove"]),
|
|
661
666
|
problem_id: z.number().int().positive().optional().describe("edit/remove"),
|
|
@@ -678,19 +683,16 @@ strictTool("issue_problem", "A card's PROBLEMS via /api/issues/:id/problems[/:pi
|
|
|
678
683
|
type: z
|
|
679
684
|
.enum(["question", "action"])
|
|
680
685
|
.optional()
|
|
681
|
-
.describe("add only.
|
|
682
|
-
"
|
|
683
|
-
"
|
|
684
|
-
"
|
|
685
|
-
"
|
|
686
|
-
"
|
|
687
|
-
"
|
|
688
|
-
"
|
|
689
|
-
"
|
|
690
|
-
"
|
|
691
|
-
"hand in the console\" vs \"run the provisioning script\" vs \"ask the vendor\"), and EACH ONE MUST CARRY " +
|
|
692
|
-
"AT LEAST ONE STEP (refused 400 otherwise) — an action with no procedure is not yet actionable. Omitted " +
|
|
693
|
-
"defaults to \"question\" — decide deliberately every time."),
|
|
686
|
+
.describe("add only. Test: could you do this yourself if you tried harder, and is the only thing missing a decision? " +
|
|
687
|
+
"Yes → \"question\": statement is the question (one plain sentence); summary optional (why it matters); " +
|
|
688
|
+
"context is the evidence; solutions[] are candidate ANSWERS with their own pro/con, done once one is " +
|
|
689
|
+
"picked. No — the blocker is access, credentials, hardware, a human's authority, or a system you " +
|
|
690
|
+
"genuinely cannot reach — \"action\": statement is WHAT IS TO BE DONE, never phrased as a question " +
|
|
691
|
+
"(\"Rotate the staging DB credential\", not \"Should we rotate it?\"); summary is REQUIRED, stating why " +
|
|
692
|
+
"it's needed and why you can't do it yourself (an add with no summary refuses 400); context is detail " +
|
|
693
|
+
"for whoever carries it out; solutions[] are the possible ROUTES (e.g. \"rotate by hand\" vs \"run the " +
|
|
694
|
+
"provisioning script\"), each MUST carry ≥1 step (400 otherwise — no procedure means not yet actionable). " +
|
|
695
|
+
"Omitted defaults to \"question\" — decide deliberately every time."),
|
|
694
696
|
summary: z
|
|
695
697
|
.string()
|
|
696
698
|
.nullable()
|
|
@@ -710,35 +712,30 @@ strictTool("issue_problem", "A card's PROBLEMS via /api/issues/:id/problems[/:pi
|
|
|
710
712
|
...boardField,
|
|
711
713
|
}, async (args) => jsonResult(await issueProblem(client, args)));
|
|
712
714
|
// ---------------- issue_solution ----------------
|
|
713
|
-
strictTool("issue_solution", "One problem's options
|
|
714
|
-
"procedure steps
|
|
715
|
+
strictTool("issue_solution", "One problem's options, AND one solution's individual " +
|
|
716
|
+
"procedure steps; `problem_id` is REQUIRED (from issue_problem list/add; " +
|
|
715
717
|
"another problem's solution id → 404). add {title, body?, pro?, con?, recommended?, steps?}: title names the " +
|
|
716
|
-
"option/route, body
|
|
717
|
-
"
|
|
718
|
-
"
|
|
719
|
-
"
|
|
720
|
-
"
|
|
721
|
-
"
|
|
722
|
-
"
|
|
723
|
-
"
|
|
724
|
-
"
|
|
725
|
-
"
|
|
726
|
-
"
|
|
727
|
-
"
|
|
728
|
-
"
|
|
729
|
-
"
|
|
730
|
-
"
|
|
731
|
-
"
|
|
732
|
-
"
|
|
733
|
-
"
|
|
734
|
-
"
|
|
735
|
-
"
|
|
736
|
-
"
|
|
737
|
-
"silently clamped to append; nesting past depth 3 → 400. edit_step {solution_id, step_id, base_hash, title?, " +
|
|
738
|
-
"description?} — never moves a step (no parent_step_id/position here). remove_step {solution_id, step_id, " +
|
|
739
|
-
"base_hash} — soft-deletes it AND its own live children; refused (409) if this solution belongs to an ACTION " +
|
|
740
|
-
"problem and removing it would leave zero live steps. A stale base_hash on a step → 409 `stale_step` with " +
|
|
741
|
-
"currentHash + currentStep (carrying its real derived `label`).", {
|
|
718
|
+
"option/route, body its markdown detail, pro/con the case for and against; `steps` authors its WHOLE procedure " +
|
|
719
|
+
"in one call — an ordered array of {title, description?, steps?}, nestable to 3 levels (a 4th refused 400 " +
|
|
720
|
+
"naming the step and the limit). AC 35332 — under an ACTION problem `steps` must be non-empty (400 otherwise); " +
|
|
721
|
+
"under a QUESTION it may be empty/omitted. Labels (\"1\", \"2a\", \"2a.i\") are ALWAYS DERIVED on read from " +
|
|
722
|
+
"position — never put one in a title. edit :sid {base_hash, ...changed fields, steps?, steps_base_hash?}: " +
|
|
723
|
+
"`steps` omitted leaves the procedure untouched; an explicit array (including [], refused if it would leave " +
|
|
724
|
+
"an action's solution with zero steps) DIFFS against the stored tree the same way STEP_INPUT's own `id` field " +
|
|
725
|
+
"describes. `steps_base_hash` is REQUIRED whenever `steps` is sent — the solution's current `steps_hash`; " +
|
|
726
|
+
"stale → 409 `stale_steps` with the current tree. Prefer add_step/edit_step/remove_step below over resending " +
|
|
727
|
+
"the whole tree for a one-word fix. remove :sid {base_hash}. A stale base_hash → 409 `stale_solution` with " +
|
|
728
|
+
"currentHash + currentSolution: merge, then retry. At most ONE live recommended per problem (second → 409 " +
|
|
729
|
+
"naming `recommended_solution_id`). A CHOSEN option's words AND whole procedure are frozen — every route below " +
|
|
730
|
+
"also refuses once a decision has chosen this solution (add a new solution instead).\n\n" +
|
|
731
|
+
"Granular single-step edits: add_step {solution_id, title, " +
|
|
732
|
+
"description?, parent_step_id?, position?} — title is ONE imperative line, never a label (derived on read); " +
|
|
733
|
+
"parent_step_id omitted/null = top-level; position 1-indexed among current live children, omitted = append, " +
|
|
734
|
+
"beyond sibling count refused 400; nesting past depth 3 → 400. edit_step {solution_id, step_id, base_hash, " +
|
|
735
|
+
"title?, description?} — never moves a step. remove_step {solution_id, step_id, base_hash} — soft-deletes it " +
|
|
736
|
+
"and its own live children; refused 409 if this solution belongs to an ACTION problem and removing it would " +
|
|
737
|
+
"leave zero live steps. A stale base_hash on a step → 409 `stale_step` with currentHash + currentStep (its " +
|
|
738
|
+
"derived `label`).", {
|
|
742
739
|
id: z.string().min(1),
|
|
743
740
|
action: z.enum(["add", "edit", "remove", "add_step", "edit_step", "remove_step"]),
|
|
744
741
|
problem_id: z.number().int().positive(),
|
|
@@ -770,7 +767,7 @@ strictTool("issue_solution", "One problem's options via /api/issues/:id/problems
|
|
|
770
767
|
...boardField,
|
|
771
768
|
}, async (args) => jsonResult(await issueSolution(client, args)));
|
|
772
769
|
// ---------------- issue_dependency ----------------
|
|
773
|
-
strictTool("issue_dependency", 'Dependency CRUD
|
|
770
|
+
strictTool("issue_dependency", 'Dependency CRUD. add: {kind, target_id, reason}, kind ∈ {depends_on, conflict_on}. depends_on is cycle-checked (409 on a loop back to source); self-loops refuse 409; re-adding a live triple returns the existing id. remove: {dependency_id} — reason is fixed server-side to "recorded_in_error" (removal means NOT related, never satisfied), so never pass it. The ONLY mechanism the dispatch picker uses to sequence one card after another — a held status (e.g. an issue_triage "keep") is not a substitute and gives no cross-card ordering.', {
|
|
774
771
|
id: z.string().min(1),
|
|
775
772
|
action: z.enum(["add", "remove"]),
|
|
776
773
|
kind: z.enum(["depends_on", "conflict_on"]).optional(),
|
|
@@ -780,13 +777,13 @@ strictTool("issue_dependency", 'Dependency CRUD via /api/issues/:id/dependencies
|
|
|
780
777
|
...boardField,
|
|
781
778
|
}, async (args) => jsonResult(await issueDependency(client, args)));
|
|
782
779
|
// ---------------- issue_retire_branch ----------------
|
|
783
|
-
strictTool("issue_retire_branch", "Mark a card's own `card/<id>` branch RETIRED (unsafe to merge)
|
|
780
|
+
strictTool("issue_retire_branch", "Mark a card's own `card/<id>` branch RETIRED (unsafe to merge); pass `reason`. No status gate — settable at any lifecycle stage, unlike the Done/Cancelled-only branch cleanup this is distinct from. `by` is server-stamped, never client-supplied. The next dispatch bootstrap forces `origin/main` as its checkout start point instead of re-attaching to the retired content; the origin ref itself is backed up then deleted separately as lazy hygiene. Idempotent — re-retiring just re-stamps reason/actor/timestamp.", {
|
|
784
781
|
id: z.string().min(1),
|
|
785
782
|
reason: z.string().min(1),
|
|
786
783
|
...boardField,
|
|
787
784
|
}, async (args) => jsonResult(await issueRetireBranch(client, args)));
|
|
788
785
|
// ---------------- issue_quality_gate ----------------
|
|
789
|
-
strictTool("issue_quality_gate", "Put one quality gate ON a card, or take it OFF
|
|
786
|
+
strictTool("issue_quality_gate", "Put one quality gate ON a card, or take it OFF (`action`) — the only way after create (issue_create names gates in quality_gates; issue_edit refuses gate keys). A gate on the card is required; add means it now runs, remove means it's gone entirely. PRE `plan-*` gates run before the work dispatch; POST `code-*` gates block complete. Unknown gate, or a never-gated type (Epic/Feature/Task), → 400. `note`/`effort_level` are add-only (400 with remove). Re-adding an existing gate updates note/effort and keeps its verdict; remove discards the row and its verdict. Board-scoped; see `board`.", {
|
|
790
787
|
id: z.string().min(1),
|
|
791
788
|
gate: z.enum([
|
|
792
789
|
"plan-dependency",
|
|
@@ -807,7 +804,7 @@ strictTool("issue_quality_gate", "Put one quality gate ON a card, or take it OFF
|
|
|
807
804
|
...boardField,
|
|
808
805
|
}, async (args) => jsonResult(await issueQualityGate(client, args)));
|
|
809
806
|
// ---------------- issue_quality_gate_verdict ----------------
|
|
810
|
-
strictTool("issue_quality_gate_verdict", "Stamp an operator MANUAL quality-gate VERDICT
|
|
807
|
+
strictTool("issue_quality_gate_verdict", "Stamp an operator MANUAL quality-gate VERDICT (`status`, `message`) — the dashboard Gates-tab Pass/Fail/Revert write. Sibling of `issue_quality_gate` (that toggles whether a gate applies; this records whether it passed) — neither substitutes for the other. Needed to close a card claimed via `issue_transition pickup {manual:true}`: `complete` refuses 409 (`failed_gate: \"quality_gate_post\"`, `failed_post_gates[]`) while any required POST gate (`code-quality`/`code-test-quality`/`code-architecture`) isn't `pass`. `status`: pass|fail|pending (pending reverts a prior verdict, clearing the message). `message` required at >=20 characters for pass/fail (else 400), ignored for pending — record the real reviewer finding, not a rubber stamp. Pure row write: no side effects — a manual fail never blocks the card, a manual pass never releases a dispatch. Unknown gate/status → 400; unknown card → 404. Board-scoped; see `board`.", {
|
|
811
808
|
id: z.string().min(1),
|
|
812
809
|
gate: z.enum([
|
|
813
810
|
"plan-dependency",
|
|
@@ -821,14 +818,26 @@ strictTool("issue_quality_gate_verdict", "Stamp an operator MANUAL quality-gate
|
|
|
821
818
|
message: z.string().optional(),
|
|
822
819
|
...boardField,
|
|
823
820
|
}, async (args) => jsonResult(await issueQualityGateVerdict(client, args)));
|
|
821
|
+
// ---------------- quality_gate_instruction ----------------
|
|
822
|
+
strictTool("quality_gate_instruction", "Fetch a named quality gate's current instruction — the same DB-catalog skill prose a dispatched gate reviewer's clean-room materializes, not card-scoped. Use from an operator session to run a gate manually: fetch the instruction, dispatch a tier-selected `danxbot:worker-*` with it, review, then record the verdict via `issue_quality_gate_verdict` — never a hand-written brief. `gate` is the same enum `issue_quality_gate` accepts. Unknown gate → 400; an unresolvable catalog artifact for this repo → 500. Board-scoped; see `board`.", {
|
|
823
|
+
gate: z.enum([
|
|
824
|
+
"plan-dependency",
|
|
825
|
+
"plan-architecture",
|
|
826
|
+
"plan-tdd",
|
|
827
|
+
"code-test-quality",
|
|
828
|
+
"code-architecture",
|
|
829
|
+
"code-quality",
|
|
830
|
+
]),
|
|
831
|
+
...boardField,
|
|
832
|
+
}, async (args) => jsonResult(await qualityGateInstruction(client, args)));
|
|
824
833
|
// ---------------- issue_retro ----------------
|
|
825
|
-
strictTool("issue_retro", "Replace the retro block
|
|
834
|
+
strictTool("issue_retro", "Replace the retro block: {good, bad, correctable_danxbot_problem, correctable_danxbot_problem_description, action_item_ids[], commits[], tests[]}. Refuses 409 unless the card is terminal (completed_at or cancelled_at). good/bad upsert; the three list fields REPLACE (soft-delete prior live rows, fresh ordinals). action_item_ids[] entries match <PREFIX>-N. commits[] entries: {sha, subject?}. tests[] is required (empty array = ran none): one row per test GROUP that ran (name the group, not individual unit tests) or per e2e test (kind:'e2e', listed explicitly since few/expensive); each row {name, kind:'group'|'e2e', num_tests, num_passing_tests, duration_ms} required, num_assertions/num_passing_assertions nullable (omit when the runner has no assertion totals).", {
|
|
826
835
|
id: z.string().min(1),
|
|
827
836
|
good: z.string().describe("Free-form markdown (prose or a list — pick whichever reads fastest, they render identically). Style rules: see issue_comment's `text` param."),
|
|
828
837
|
bad: z.string().describe("Free-form markdown (prose or a list — pick whichever reads fastest, they render identically). Style rules: see issue_comment's `text` param."),
|
|
829
838
|
correctable_danxbot_problem: z
|
|
830
839
|
.boolean()
|
|
831
|
-
.describe("Required. Did this dispatch hit a problem in danxbot's OWN code/configuration (not \"this card was hard\") that danxbot could change so it stops happening? Answer explicitly every time
|
|
840
|
+
.describe("Required. Did this dispatch hit a problem in danxbot's OWN code/configuration (not \"this card was hard\") that danxbot could change so it stops happening? A true+described answer starts exactly one automated repair (fix or a ready card) — the only reliable channel for a danxbot defect found mid-dispatch. Answer explicitly every time, never a default."),
|
|
832
841
|
correctable_danxbot_problem_description: z
|
|
833
842
|
.string()
|
|
834
843
|
.describe("Required. Non-empty (naming the concrete problem) when correctable_danxbot_problem is true; must be empty when it is false."),
|
|
@@ -858,7 +867,7 @@ strictTool("issue_retro", "Replace the retro block via PUT /api/issues/:id/retro
|
|
|
858
867
|
// route's MAX_DECODED_BYTES (src/issues/write/attachments.ts). This package is
|
|
859
868
|
// a separate published artifact and cannot import that constant, so the number
|
|
860
869
|
// is restated here as prose — keep the two in sync if the backend ceiling moves.
|
|
861
|
-
strictTool("issue_attach", "Attach a LOCAL file to an issue card
|
|
870
|
+
strictTool("issue_attach", "Attach a LOCAL file to an issue card: `id` (the card) + `file_path` (an ABSOLUTE path on the dispatch's shared filesystem). Reads the bytes, infers MIME from the extension, uploads via the dashboard: stores in S3, inserts one attachment row, auto-mirrors to the card's linked Trello card and Slack thread. Board-scoped; see `board`. Fail-loud: a relative/empty path is rejected at the boundary; a missing/unreadable file throws before any upload (no partial S3 object or row). 25 MB decoded ceiling (413). Returns `{issue, attachment_id, s3_key}` — find the attachment in `issue.attachments` by `attachment_id` to read its permanent, non-expiring `url`. That url can be embedded in ANY markdown field (a problem's statement/context, a comment, a plan record, a solution body) as `` — the dashboard renders it inline as a thumbnail. Use whenever a screenshot judges something faster than prose.", {
|
|
862
871
|
id: z.string().min(1),
|
|
863
872
|
file_path: z
|
|
864
873
|
.string()
|
|
@@ -867,11 +876,11 @@ strictTool("issue_attach", "Attach a LOCAL file to an issue card via POST /api/i
|
|
|
867
876
|
...boardField,
|
|
868
877
|
}, async (args) => jsonResult(await issueAttach(client, args)));
|
|
869
878
|
// ---------------- repo_knowledge_get ----------------
|
|
870
|
-
strictTool("repo_knowledge_get", "Fetch the board's working-knowledge markdown doc
|
|
879
|
+
strictTool("repo_knowledge_get", "Fetch the board's working-knowledge markdown doc. Board-scoped; see `board`. Returns `{ok, status, body: {content, contentHash, updatedAt, updatedBy, boardId}}` — an unset doc reads as the empty view (content/contentHash `\"\"`), not a 404. Before `repo_knowledge_set`, always get immediately first and pass `contentHash` back as `base_hash` — the concurrency guard rejects a stale write.", {
|
|
871
880
|
...boardField,
|
|
872
881
|
}, async (args) => jsonResult(await repoKnowledgeGet(client, args)));
|
|
873
882
|
// ---------------- repo_knowledge_set ----------------
|
|
874
|
-
strictTool("repo_knowledge_set", 'Write the board\'s working-knowledge markdown doc
|
|
883
|
+
strictTool("repo_knowledge_set", 'Write the board\'s working-knowledge markdown doc. Board-scoped; see `board`. `base_hash` must be the `contentHash` from the immediately-prior `repo_knowledge_get` ("" for the true first write). On mismatch, fails loud with `{error: "stale_repo_knowledge", currentHash}` rather than overwriting — re-get, re-merge, retry with the new hash. On success persists to the DB, publishes `repo-knowledge:updated` over SSE, and returns the new view.', {
|
|
875
884
|
content: z.string(),
|
|
876
885
|
base_hash: z
|
|
877
886
|
.string()
|
|
@@ -880,11 +889,11 @@ strictTool("repo_knowledge_set", 'Write the board\'s working-knowledge markdown
|
|
|
880
889
|
...boardField,
|
|
881
890
|
}, async (args) => jsonResult(await repoKnowledgeSet(client, args)));
|
|
882
891
|
// ---------------- brief_list ----------------
|
|
883
|
-
strictTool("brief_list", "List the board's named Brief pages
|
|
892
|
+
strictTool("brief_list", "List the board's named Brief pages. Board-scoped; see `board`. Returns `{boardId, pages: [{slug, title, contentHash, sortOrder, updatedAt, updatedBy}]}` — metadata only, no content (use `brief_get_page`). Unlike `repo_knowledge_get`/`_set` (one board-level doc), Brief pages are MANY named pages per board (Goals/Architecture/Rules/Caveats tabs), keyed by (board, slug). The reserved `index` slug always exists.", {
|
|
884
893
|
...boardField,
|
|
885
894
|
}, async (args) => jsonResult(await briefList(client, args)));
|
|
886
895
|
// ---------------- brief_get_page ----------------
|
|
887
|
-
strictTool("brief_get_page", 'Fetch one Brief page by slug
|
|
896
|
+
strictTool("brief_get_page", 'Fetch one Brief page by slug. Board-scoped; see `board`. Returns `{boardId, slug, title, content, contentHash, sortOrder, updatedAt, updatedBy}` — a missing page reads as the empty view (content/contentHash `""`), not a 404. Before `brief_set_page`, always get immediately first and pass `contentHash` back as `base_hash` — the concurrency guard rejects a stale write.', {
|
|
888
897
|
slug: z
|
|
889
898
|
.string()
|
|
890
899
|
.min(1)
|
|
@@ -892,7 +901,7 @@ strictTool("brief_get_page", 'Fetch one Brief page by slug via GET /api/brief/pa
|
|
|
892
901
|
...boardField,
|
|
893
902
|
}, async (args) => jsonResult(await briefGetPage(client, args)));
|
|
894
903
|
// ---------------- brief_set_page ----------------
|
|
895
|
-
strictTool("brief_set_page", 'Write one Brief page
|
|
904
|
+
strictTool("brief_set_page", 'Write one Brief page. Board-scoped; see `board`. Body: `{content, title?, sortOrder?, base_hash?}` — same optimistic-concurrency shape as `repo_knowledge_set`, targeting one named page. `base_hash` must be the `contentHash` from the immediately-prior `brief_get_page` (`""` for a true first write). On mismatch fails loud with `{error: "stale_brief_page", currentHash}` — re-get, re-merge, retry, never overwrite blindly. On success persists, publishes `brief:updated` over SSE, and returns the new view. No delete tool on this surface; the reserved `index` slug is never deletable — removing a non-index page is dashboard-UI-only.', {
|
|
896
905
|
slug: z
|
|
897
906
|
.string()
|
|
898
907
|
.min(1)
|
|
@@ -916,13 +925,13 @@ strictTool("brief_set_page", 'Write one Brief page via PUT /api/brief/page?slug=
|
|
|
916
925
|
// plan id — and it can only ever bind the caller's own session. `plan_create`
|
|
917
926
|
// also takes no plan id, but for a different reason: it MAKES a plan rather
|
|
918
927
|
// than acting on one, so there is no existing plan for an id to name yet.
|
|
919
|
-
strictTool("plan_list", "List every plan
|
|
928
|
+
strictTool("plan_list", "List every plan, and learn which plan THIS session is connected to. Plans are GLOBAL, not board-scoped — a plan is a named, dated set of cards an operator assembled by hand, from any repo. Returns `{plans: [{id, ref, name, createdAt, cardCount, boards, status}], session, sessionListenerAttached}` — `ref` is the plan's short reference (`PLN-<id>`), cite it rather than the bare id. `status` is computed fresh on every read, never stored: `awaiting-session` (no live session — a session row isn't released just because a session ended), `planning` (no cards, or only Review/Backlog/terminal ones with ≥1 not Done/Cancelled), `building` (a live session AND ≥1 card ToDo/In Progress or stuck-but-active — Blocked/Needs Help), `complete` (≥1 card, all Done/Cancelled — wins even with no session). Pass `status` to filter. `session` is your own registration (`{sessionId, title, planId, planName, firstSeenAt, lastActiveAt}`) or null outside a Claude Code session; `planId: null` means connected to no plan — `plan_get` to browse, `plan_connect` to bind. `sessionListenerAttached` says whether your event stream is attached (the plugin's plan bridge); false for a few seconds right after connect is normal, false after that means events aren't reaching you — tell the operator. Distinct from the board Brief (`brief_list`).", {
|
|
920
929
|
status: z
|
|
921
930
|
.enum(PLAN_STATUSES)
|
|
922
931
|
.optional()
|
|
923
932
|
.describe("Filter to one computed status: awaiting-session, planning, building, complete. Omit for every plan."),
|
|
924
933
|
}, async (args) => jsonResult(await planList(client, args)));
|
|
925
|
-
strictTool("plan_get", "Read a plan
|
|
934
|
+
strictTool("plan_get", "Read a plan. Pass `plan_id` to read ANY plan; OMIT to read the plan this session is connected to — omitting while connected to none fails loud `{error: \"session_not_connected\"}`, connect first. A BARE call (no `fields`) returns ONLY the plan's cheap scalars: `{plan, boards, cardCount, bucketCounts, status, session, sessionListenerAttached, available_field_groups}` — no cards, records, or architecture body. `plan` carries `{id, ref, name, createdAt}`; `ref` is the plan's short reference (`PLN-<id>`) — cite that, not the bare id. `status` is computed fresh on every read, never stored — see `plan_list` for the four values and what each means. Pass `fields` to opt into: `cards` (member cards, paged via `cards_offset`/`cards_limit` — see their own field descriptions — in stable card-reference order: board prefix then card number, pages never repeat/skip unless membership changes between reads; response carries `cards_total`), `records` (every goal+rule+caveat, keyed by kind) or `records:goal` / `records:rule` / `records:caveat` (one kind, cheaper), `architecture` (`{sections: [{id, planId, contentHash, title, content, sortOrder, createdAt, updatedAt}]}`), `sessions` (every session connected to the plan), `events` (the plan's durable event ledger — every human action and bridge message, paged/filtered via `events_limit`/`events_before`/`events_kinds`/`events_origin`/`events_writer` — see their own field descriptions; response carries `events: {items: [{id, at, kind, writer, origin, originSessionId, targetSessionId, cardId, cardTitle, boardId, detail}], next_cursor}`, `next_cursor` null on the last page; an event on a card whose board you cannot read is left out, plan-level events are always visible). `session`/`sessionListenerAttached` and `available_field_groups` ride every response regardless. `sessionListenerAttached` is `false` for a few seconds right after `plan_connect` while the plugin's event bridge starts; still `false` after that while connected means the plan's card events are not reaching you — tell the operator. ALWAYS `plan_get`/`plan_get_architecture_section` immediately before `plan_update_architecture_section`/`plan_delete_architecture_section` and pass the returned `contentHash` back as `base_hash`.", {
|
|
926
935
|
plan_id: z
|
|
927
936
|
.number()
|
|
928
937
|
.int()
|
|
@@ -952,32 +961,32 @@ strictTool("plan_get", "Read a plan via GET /api/plans (DX-2683). Pass `plan_id`
|
|
|
952
961
|
.positive()
|
|
953
962
|
.max(PLAN_GET_EVENTS_MAX_LIMIT)
|
|
954
963
|
.optional()
|
|
955
|
-
.describe("
|
|
964
|
+
.describe("how many ledger events one page holds, 1.." + PLAN_GET_EVENTS_MAX_LIMIT + " (default " + PLAN_GET_EVENTS_DEFAULT_LIMIT + "). Requires `fields` to include `events`."),
|
|
956
965
|
events_before: z
|
|
957
966
|
.string()
|
|
958
967
|
.min(1)
|
|
959
968
|
.optional()
|
|
960
|
-
.describe("
|
|
969
|
+
.describe("an opaque cursor from a previous page's `next_cursor`. Omit for the newest page. Requires `fields` to include `events`."),
|
|
961
970
|
events_kinds: z
|
|
962
971
|
.array(z.enum(PLAN_EVENT_KINDS))
|
|
963
972
|
.optional()
|
|
964
|
-
.describe("
|
|
973
|
+
.describe("only these event kinds. Omit for every kind. Requires `fields` to include `events`."),
|
|
965
974
|
events_origin: z
|
|
966
975
|
.enum(PLAN_EVENT_ORIGINS)
|
|
967
976
|
.optional()
|
|
968
|
-
.describe("
|
|
977
|
+
.describe("only events with this origin. Omit for every origin. Requires `fields` to include `events`."),
|
|
969
978
|
events_writer: z
|
|
970
979
|
.string()
|
|
971
980
|
.min(1)
|
|
972
981
|
.optional()
|
|
973
|
-
.describe("
|
|
982
|
+
.describe("only events with this exact writer name. Omit for every writer. Requires `fields` to include `events`."),
|
|
974
983
|
}, async (args) => jsonResult(await planGet(client, args)));
|
|
975
|
-
strictTool("plan_create", "Create a new, empty plan
|
|
984
|
+
strictTool("plan_create", "Create a new, empty plan. Global — not board-scoped. Adds no cards, records, or architecture sections, and does not connect any session (call `plan_connect` separately). Returns `{plan: {id, ref, name, createdAt}}` — `ref` is the short reference (`PLN-<id>`). Use `plan.id` with `plan_connect` to start working on it, or `plan_get({plan_id})` to browse.", {
|
|
976
985
|
name: z.string().min(1).describe("The plan's name — shown in the Plans list."),
|
|
977
986
|
}, async (args) => jsonResult(await planCreate(client, args)));
|
|
978
987
|
strictTool("plan_connect",
|
|
979
988
|
// DX-2735: trimmed with the problem tools to stay inside the work-profile budget.
|
|
980
|
-
"Connect THIS session to a plan
|
|
989
|
+
"Connect THIS session to a plan. ONE CALL IS ENOUGH TO START: the reply carries `{session, movedFrom, browserInstruction, briefing, listenerHealth}` — `browserInstruction` is a server-built action to take NOW: it names the plan's URL and tells you to open it (in-app browser if you have one, else default), keep that tab open for the whole session without navigating it away, and use a different tab for your own browsing — the operator's tab for following and talking to you. Returned on every connect, including a re-connect, so it doubles as the post-context-loss reminder. `briefing` is every goal/rule/caveat (ref+body), every architecture section (id+title), the plan's own ref/name/status, a first page of open cards (id/type/status/title/openProblemCount/assignedAgent) with a `morePagesHint` when more exist, and the closed-card count — usually replacing the `plan_get({fields:[...]})` + card batch-read a fresh session used to need. A session is on AT MOST ONE plan: connecting elsewhere MOVES it, and `movedFrom: {id, name} | null` says which plan it left (null = no plan, or already this one). Binds only your OWN session, resolved from the session id this server forwards; afterwards every plan WRITE tool acts on this plan and takes no plan id. `listenerHealth` reports the event bridge's state — `null` (no session), or `{attached, state: \"unattached\"|\"credential_mismatch\"|\"board_scope_narrowed\"|\"healthy\", nextStep}` naming a concrete fix per unhealthy state (same shape `plan_list`/`plan_get` report). Once healthy, every comment, answer, problem added and block/unblock on this plan's cards reaches the session unpolled, relayed by the plugin's event bridge as a line like `[DX-8 \"Title\" repo:board] newms87 answered \"<statement>\": chose \"Pause E2E\"`. Pass `title` (call `get_session({session_id:\"self\"})` first and forward its `title` verbatim) so the dashboard shows the same name Claude does — this server cannot read it itself.", {
|
|
981
990
|
plan_id: z.number().int().positive().describe("The plan id, from `plan_list`."),
|
|
982
991
|
title: z
|
|
983
992
|
.string()
|
|
@@ -1001,15 +1010,15 @@ async (args) => {
|
|
|
1001
1010
|
}),
|
|
1002
1011
|
});
|
|
1003
1012
|
});
|
|
1004
|
-
strictTool("plan_add_record", "Add a goal, rule or caveat to your connected plan (
|
|
1013
|
+
strictTool("plan_add_record", "Add a goal, rule or caveat to your connected plan (see `kind`'s own values below for what each means — never progress/status/session notes, those are card comments). `body` is one plain statement, at most 250 characters (400 if longer); detail goes in markdown `context`. Allocates a permanent reference (`G-1`, `R-4`, `CAV-12`). Takes no plan id; not connected → `plan_connect` first. Returns the created record plus `records_count` (that kind's live count, not the whole list) — read the list with `plan_get({fields:[\"records:<kind>\"]})`.", {
|
|
1005
1014
|
kind: z.enum(["goal", "rule", "caveat"]).describe("goal = outcome, rule = constraint, caveat = architecture trade-off."),
|
|
1006
1015
|
body: z.string().min(1).describe("One plain statement, at most 250 characters. Details go in `context`."),
|
|
1007
1016
|
context: z.string().optional().describe("Markdown detail behind the statement: evidence, history, examples."),
|
|
1008
1017
|
}, async (args) => jsonResult(await planAddRecord(client, args)));
|
|
1009
|
-
strictTool("plan_get_record", "Read one goal/rule/caveat
|
|
1018
|
+
strictTool("plan_get_record", "Read one goal/rule/caveat without pulling the whole plan. Takes no plan id; an unknown or foreign record id → 404. Returns `{record: {id, planId, kind, refNum, ref, body, context, contentHash, createdAt, updatedAt}}` — `context` is markdown detail, or null.", {
|
|
1010
1019
|
record_id: z.number().int().positive().describe("A record id, from `plan_add_record`, `plan_get` or `plan_get_record` itself."),
|
|
1011
1020
|
}, async (args) => jsonResult(await planGetRecord(client, args)));
|
|
1012
|
-
strictTool("plan_update_record", 'Edit a goal/rule/caveat
|
|
1021
|
+
strictTool("plan_update_record", 'Edit a goal/rule/caveat. The reference never moves. `body` stays one plain statement, at most 250 characters (400 otherwise); detail belongs in markdown `context`. `content_hash` must be the record\'s last-read `contentHash` (covers body AND context); on mismatch nothing is written and you get `{error: "stale_plan_record", currentHash, currentBody, currentContext}` — merge and retry with `content_hash: currentHash`, never blindly. Takes no plan id. Returns the edited record plus `records_count` (see `plan_add_record`).', {
|
|
1013
1022
|
record_id: z.number().int().positive().describe("The record id to edit."),
|
|
1014
1023
|
content_hash: z.string().describe("The record's `contentHash` from your last read. Required."),
|
|
1015
1024
|
body: z.string().min(1).describe("The new statement, at most 250 characters. Plain text."),
|
|
@@ -1019,11 +1028,11 @@ strictTool("plan_update_record", 'Edit a goal/rule/caveat of your connected plan
|
|
|
1019
1028
|
.optional()
|
|
1020
1029
|
.describe("New markdown detail. Omit to keep the stored context; null clears it."),
|
|
1021
1030
|
}, async (args) => jsonResult(await planUpdateRecord(client, args)));
|
|
1022
|
-
strictTool("plan_delete_record", 'Soft-delete a goal/rule/caveat
|
|
1031
|
+
strictTool("plan_delete_record", 'Soft-delete a goal/rule/caveat; its reference is retired permanently, never reused. `content_hash` must be the record\'s last-read `contentHash` — stale deletes nothing, returns `{error: "stale_plan_record", currentHash, currentBody, currentContext}`. Takes no plan id. Unknown or already-deleted id → 404. Returns `{records_count}` (see `plan_add_record`).', {
|
|
1023
1032
|
record_id: z.number().int().positive().describe("The record id to delete."),
|
|
1024
1033
|
content_hash: z.string().describe("The record's `contentHash` from your last read. Required."),
|
|
1025
1034
|
}, async (args) => jsonResult(await planDeleteRecord(client, args)));
|
|
1026
|
-
strictTool("plan_add_note", "Write a milestone note to a plan's timeline
|
|
1035
|
+
strictTool("plan_add_note", "Write a milestone note to a plan's timeline — a MILESTONE, not a log: use for a card (or group) finishing, an important decision, or a meaningful goal/rule/caveat/architecture change; routine progress stays a card comment. Terse: `title` at most 60 characters, `body` at most 250 (400 if too long, naming the limit). Links resolve on read into their target (a card's title, a record's ref+body, a section's title); an unknown card, unparseable/foreign record ref, or unknown/foreign section id is refused 400 naming which one. A card link needn't be a plan member; a record/section link must belong to THIS plan. `author` is stamped server-side. Takes an explicit `plan_id` (like `plan_remove_card`/`plan_rename`) so a dispatched worker with no plan connection can still write. Unknown plan → 404. Returns the new note plus `notes_count` (the plan's total live count, not the latest page) — read the timeline with `plan_get({fields:[\"notes\"]})`.", {
|
|
1027
1036
|
plan_id: z.number().int().positive().describe("The plan id, from `plan_list`."),
|
|
1028
1037
|
title: z.string().min(1).describe("At most 60 characters."),
|
|
1029
1038
|
body: z.string().min(1).describe("The wrap-up, at most 250 characters."),
|
|
@@ -1034,7 +1043,7 @@ strictTool("plan_add_note", "Write a milestone note to a plan's timeline, via PO
|
|
|
1034
1043
|
.describe("Goal/rule/caveat references this note announces, e.g. `[\"G-1\", \"R-3\", \"CAV-2\"]`."),
|
|
1035
1044
|
section_ids: z.array(z.number().int().positive()).optional().describe("Architecture section ids this note announces."),
|
|
1036
1045
|
}, async (args) => jsonResult(await planAddNote(client, args)));
|
|
1037
|
-
strictTool("plan_update_note", 'Edit a plan note
|
|
1046
|
+
strictTool("plan_update_note", 'Edit a plan note. `content_hash` must be the note\'s last-read `contentHash` (covers title, body AND the link set); a mismatch writes nothing and returns `{error: "stale_plan_note", currentHash, currentTitle, currentBody, currentLinks}` — merge and retry, never blindly. `title`/`body` optional, keep stored value when omitted. The link fields (`card_ids`/`record_refs`/`section_ids`) are all-or-nothing as a group: omit all three to leave links untouched, send ANY one to REPLACE THE WHOLE SET — no per-link add/remove. Takes an explicit `plan_id` (see `plan_add_note`). Unknown plan or note id → 404. Returns the edited note plus `notes_count`.', {
|
|
1038
1047
|
plan_id: z.number().int().positive().describe("The plan id, from `plan_list`."),
|
|
1039
1048
|
note_id: z.number().int().positive().describe("The note id to edit."),
|
|
1040
1049
|
content_hash: z.string().describe("The note's `contentHash` from your last read. Required."),
|
|
@@ -1044,40 +1053,40 @@ strictTool("plan_update_note", 'Edit a plan note, via PATCH /api/plans/:plan_id/
|
|
|
1044
1053
|
record_refs: z.array(z.string().min(1)).optional().describe("REPLACES the whole link set when sent (with card_ids/section_ids)."),
|
|
1045
1054
|
section_ids: z.array(z.number().int().positive()).optional().describe("REPLACES the whole link set when sent (with card_ids/record_refs)."),
|
|
1046
1055
|
}, async (args) => jsonResult(await planUpdateNote(client, args)));
|
|
1047
|
-
strictTool("plan_delete_note", 'Soft-delete a plan note
|
|
1056
|
+
strictTool("plan_delete_note", 'Soft-delete a plan note. `content_hash` must be the note\'s last-read `contentHash` — stale deletes nothing, returns `{error: "stale_plan_note", currentHash, currentTitle, currentBody, currentLinks}` (same shape as `plan_update_note`). Takes an explicit `plan_id` (see `plan_add_note`). Unknown plan, note, or already-deleted note → 404. Returns `{notes_count}`.', {
|
|
1048
1057
|
plan_id: z.number().int().positive().describe("The plan id, from `plan_list`."),
|
|
1049
1058
|
note_id: z.number().int().positive().describe("The note id to delete."),
|
|
1050
1059
|
content_hash: z.string().describe("The note's `contentHash` from your last read. Required."),
|
|
1051
1060
|
}, async (args) => jsonResult(await planDeleteNote(client, args)));
|
|
1052
|
-
strictTool("plan_add_card", "Add an existing card to the plan this session is connected to
|
|
1061
|
+
strictTool("plan_add_card", "Add an existing card, from ANY board, to the plan this session is connected to. Idempotent (re-adding is a no-op; a card may sit in several plans). Adds MEMBERSHIP only, never edits the card. Takes no plan id — resolved from your connected session. Not connected → `{error: \"session_not_connected\"}`. Unknown card → 404. Returns `{card_id, member: true, cards_count}` (the plan's total member-card count, not the full list — a plan can hold hundreds; read it with `plan_get({fields:[\"cards\"]})`, paged).", {
|
|
1053
1062
|
card_id: z.string().min(1).describe("An existing card id, e.g. `DX-2683`."),
|
|
1054
1063
|
}, async (args) => jsonResult(await planAddCard(client, args)));
|
|
1055
|
-
strictTool("plan_remove_card", "Remove a card from a plan
|
|
1064
|
+
strictTool("plan_remove_card", "Remove a card from a plan — sibling of `plan_add_card`, any board. Idempotent (removing a non-member is a no-op). Removes MEMBERSHIP only — never touches the card itself or its membership in other plans. Unlike `plan_add_card`, takes an EXPLICIT `plan_id` — you may remove from any plan you can name. Unknown plan → 404. Returns `{card_id, member: false, cards_count}` (see `plan_add_card`).", {
|
|
1056
1065
|
plan_id: z.number().int().positive().describe("The plan id, from `plan_list`."),
|
|
1057
1066
|
card_id: z.string().min(1).describe("An existing card id, e.g. `DX-2683`."),
|
|
1058
1067
|
}, async (args) => jsonResult(await planRemoveCard(client, args)));
|
|
1059
|
-
strictTool("plan_rename", "Rename a plan
|
|
1068
|
+
strictTool("plan_rename", "Rename a plan — the only way to change `name`. Takes an EXPLICIT `plan_id`, so you may rename any plan you can name. `name` non-empty (400 otherwise). Unknown plan → 404. Returns the renamed plan `{id, ref, name, createdAt}`.", {
|
|
1060
1069
|
plan_id: z.number().int().positive().describe("The plan id, from `plan_list`."),
|
|
1061
1070
|
name: z.string().min(1).describe("The plan's new name."),
|
|
1062
1071
|
}, async (args) => jsonResult(await planRename(client, args)));
|
|
1063
|
-
strictTool("plan_get_architecture_section", "Read
|
|
1072
|
+
strictTool("plan_get_architecture_section", "Read one section of the plan this session is connected to. Takes no plan id — resolved from your connected session. Not connected → `{error: \"session_not_connected\"}`. Unknown or foreign section id → 404. Returns `{section: {id, planId, contentHash, title, content, sortOrder, createdAt, updatedAt}}`.", {
|
|
1064
1073
|
section_id: z.number().int().positive().describe("A section id, from `plan_get` or `plan_add_architecture_section`."),
|
|
1065
1074
|
}, async (args) => jsonResult(await planGetArchitectureSection(client, args)));
|
|
1066
|
-
strictTool("plan_add_architecture_section", "Append a section to your connected plan's architecture
|
|
1075
|
+
strictTool("plan_add_architecture_section", "Append a section to your connected plan's architecture. Architecture is SECTIONS, not one document — each independently editable and hash-guarded, so editing one never stales a concurrent edit to another. Sorts after every existing live section; use `plan_reorder_architecture_section` to move it. Takes no plan id; not connected → `plan_connect` first. Returns the new section plus the plan's full live section list.", {
|
|
1067
1076
|
title: z.string().min(1).describe("The section's heading, shown in the navigation index."),
|
|
1068
1077
|
content: z.string().describe("The section's markdown. May be empty — a section awaiting its first draft is a real state."),
|
|
1069
1078
|
}, async (args) => jsonResult(await planAddArchitectureSection(client, args)));
|
|
1070
|
-
strictTool("plan_update_architecture_section", 'Edit a section\'s title and/or content
|
|
1079
|
+
strictTool("plan_update_architecture_section", 'Edit a section\'s title and/or content — both optional, send only what changed. `base_hash` must be the section\'s last-read `contentHash`; on mismatch fails loud with `{error: "stale_plan_architecture_section", currentHash, currentTitle, currentContent}` rather than overwriting a concurrent write — merge and retry, never blindly. Takes no plan id. Returns the edited section plus the plan\'s full live section list.', {
|
|
1071
1080
|
section_id: z.number().int().positive().describe("The section id to edit."),
|
|
1072
1081
|
base_hash: z.string().describe("The section's `contentHash` from your last read. Required."),
|
|
1073
1082
|
title: z.string().min(1).optional().describe("New heading. Omit to keep the stored title."),
|
|
1074
1083
|
content: z.string().optional().describe("New markdown. Omit to keep the stored content."),
|
|
1075
1084
|
}, async (args) => jsonResult(await planUpdateArchitectureSection(client, args)));
|
|
1076
|
-
strictTool("plan_delete_architecture_section", 'Soft-delete a section of your connected plan\'s architecture
|
|
1085
|
+
strictTool("plan_delete_architecture_section", 'Soft-delete a section of your connected plan\'s architecture. `base_hash` must be the section\'s last-read `contentHash` — stale deletes nothing, returns `{error: "stale_plan_architecture_section", currentHash, currentTitle, currentContent}`; re-fetch and confirm before retrying, never blindly. Takes no plan id. Unknown or already-deleted section id → 404. Returns the plan\'s remaining live section list.', {
|
|
1077
1086
|
section_id: z.number().int().positive().describe("The section id to delete."),
|
|
1078
1087
|
base_hash: z.string().describe("The section's `contentHash` from your last read. Required."),
|
|
1079
1088
|
}, async (args) => jsonResult(await planDeleteArchitectureSection(client, args)));
|
|
1080
|
-
strictTool("plan_reorder_architecture_section", "Reassign your connected plan's section display order
|
|
1089
|
+
strictTool("plan_reorder_architecture_section", "Reassign your connected plan's section display order. Unguarded by content hash by design — moving a section never changes any `contentHash`. `order` must name EXACTLY the plan's current live section ids, each once — a partial or foreign list refuses 400 rather than silently reordering a subset. Takes no plan id. Returns the plan's full live section list in its new order.", {
|
|
1081
1090
|
order: z
|
|
1082
1091
|
.array(z.number().int().positive())
|
|
1083
1092
|
.min(1)
|
|
@@ -1108,8 +1117,8 @@ const expectedRateField = z
|
|
|
1108
1117
|
.nullable()
|
|
1109
1118
|
.optional()
|
|
1110
1119
|
.describe("Both fields together, or omit/null entirely — never a half-specified rate.");
|
|
1111
|
-
strictTool("failure_category_list", "List every failure category
|
|
1112
|
-
strictTool("failure_category_create", 'Create a new failure category
|
|
1120
|
+
strictTool("failure_category_list", "List every failure category. Board-less — applies across the whole install. Returns `{categories: [{id, name, description, matchers, ignore, ignoreReason, expectedRate, matchedCount, lastSeenMs, createdAtMs, createdBy, updatedAtMs, updatedBy}]}`, id ascending (`[]` on a fresh install). Read this immediately before `failure_category_create`/`_update` so your overlap decision is against the current set, not a stale snapshot.", {}, async () => jsonResult(await failureCategoryList(client)));
|
|
1121
|
+
strictTool("failure_category_create", 'Create a new failure category. Board-less. `matchers` (≥1) is OR-across-matchers — matches an occurrence when ANY ONE matcher\'s fields all hold. `ignore: true` requires non-empty `ignoreReason` (400 otherwise) — use for an expected, non-actionable failure. A matcher set overlapping an EXISTING category refuses 400 naming the conflict — list first and EXPAND that category (`failure_category_update`) instead of a near-duplicate. On success, re-matches every uncategorized occurrence against the new category.', {
|
|
1113
1122
|
name: z.string().min(1).describe("The category's name."),
|
|
1114
1123
|
description: z.string().optional().describe("Optional free-text description. Defaults to empty."),
|
|
1115
1124
|
matchers: z.array(matcherField).min(1).describe("At least one matcher; a category matches an occurrence when ANY ONE matches (OR across matchers)."),
|
|
@@ -1117,7 +1126,7 @@ strictTool("failure_category_create", 'Create a new failure category via POST /a
|
|
|
1117
1126
|
ignoreReason: z.string().nullable().optional().describe("Required (non-empty) when ignore is true."),
|
|
1118
1127
|
expectedRate: expectedRateField,
|
|
1119
1128
|
}, async (args) => jsonResult(await failureCategoryCreate(client, args)));
|
|
1120
|
-
strictTool("failure_category_update", "Patch an existing failure category
|
|
1129
|
+
strictTool("failure_category_update", "Patch an existing failure category. Board-less. Covers both: expanding matchers (send the FULL replacement `matchers` array — it REPLACES, not appends, so include every matcher you want to keep) and marking ignored (`ignore: true` + non-empty `ignoreReason`). At least one field besides `id` required (400 otherwise). Same overlap refusal as create, excluding this category's own prior matchers. On success, re-matches every uncategorized occurrence against the updated set.", {
|
|
1121
1130
|
id: z.number().int().positive().describe("The category id to patch — from failure_category_list."),
|
|
1122
1131
|
name: z.string().min(1).optional(),
|
|
1123
1132
|
description: z.string().optional(),
|
|
@@ -1127,7 +1136,7 @@ strictTool("failure_category_update", "Patch an existing failure category via PA
|
|
|
1127
1136
|
expectedRate: expectedRateField,
|
|
1128
1137
|
}, async (args) => jsonResult(await failureCategoryUpdate(client, args)));
|
|
1129
1138
|
// ---------------- dispatch_transcript_search (DX-3221) ----------------
|
|
1130
|
-
strictTool("dispatch_transcript_search", "Search or tail
|
|
1139
|
+
strictTool("dispatch_transcript_search", "Search or tail another dispatch's stored JSONL transcript. Needs no filesystem access (an authenticated HTTP call — never touches worktree-guard or the worktree boundary) and fixes what Read cannot: a single JSONL entry can exceed Read's token cap with no way to sub-page inside it, so this tool searches itself and returns only a bounded excerpt around a match. With `pattern`: up to `maxMatches` matching lines (case-insensitive regex), each windowed to `contextChars` around the first match. Without `pattern`: the most recent `tail` lines instead, each capped at `contextChars` (`truncated: true` marks a capped excerpt either way, never a thrown error). `dispatchId` is a real `dispatches.id` — e.g. from a failure-repair card's own body.", {
|
|
1131
1140
|
dispatchId: z.string().min(1).describe("The dispatch id whose transcript to search — from a failure-repair card's own body, or any other dispatch id you already have."),
|
|
1132
1141
|
pattern: z.string().min(1).optional().describe("Case-insensitive regex tested against each raw JSONL line. Omit to get a tail read of the most recent lines instead."),
|
|
1133
1142
|
tail: z.number().int().positive().optional().describe("Only used when `pattern` is omitted. How many of the most recent lines to return. Defaults to 20, capped at 200."),
|
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.142",
|
|
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",
|