@thehammer/danx-dashboard-mcp 0.1.82 → 0.1.83

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 CHANGED
@@ -844,6 +844,7 @@ export const PLAN_FIELD_GROUPS = [
844
844
  "records:caveat",
845
845
  "architecture",
846
846
  "sessions",
847
+ "notes",
847
848
  ];
848
849
  /**
849
850
  * DX-2834 — the plan-status taxonomy, mirroring `PLAN_FIELD_GROUPS` just
@@ -1147,6 +1148,85 @@ export async function planDeleteRecord(client, args) {
1147
1148
  body: { content_hash: args.content_hash },
1148
1149
  });
1149
1150
  }
1151
+ /**
1152
+ * Write a milestone note to a plan, via `POST /api/plans/:plan_id/notes`.
1153
+ * TAKES AN EXPLICIT `plan_id`, unlike `plan_add_record`/`plan_add_architecture_section`
1154
+ * — mirrors `plan_add_card`'s sibling `plan_remove_card`/`plan_rename`: a
1155
+ * dispatched worker has no plan connection when it finishes a card, and a
1156
+ * card can sit on several plans, so the writer names which one the note
1157
+ * belongs to. A note is a MILESTONE, not a log — write one when a card (or a
1158
+ * related group of cards) finishes, an important decision lands, or a
1159
+ * goal/rule/caveat/architecture section changes meaningfully; routine step
1160
+ * progress stays a card comment. Links resolve on read into what they point
1161
+ * at (a card's title, a record's ref + body, a section's title) — an unknown
1162
+ * card id, an unparseable or foreign record ref, or an unknown or foreign
1163
+ * section id is refused 400 naming exactly which one. A card link does NOT
1164
+ * require the card to be a member of this plan; a record/section link MUST
1165
+ * belong to THIS plan. `author` is stamped server-side from your identity,
1166
+ * never sent by you. Unknown plan → 404. Returns the new note plus the
1167
+ * plan's latest notes page.
1168
+ */
1169
+ export async function planAddNote(client, args) {
1170
+ return client.request({
1171
+ method: "POST",
1172
+ path: `/${args.plan_id}/notes`,
1173
+ basePath: PLANS_BASE_PATH,
1174
+ body: {
1175
+ title: args.title,
1176
+ body: args.body,
1177
+ ...(args.card_ids === undefined ? {} : { card_ids: args.card_ids }),
1178
+ ...(args.record_refs === undefined ? {} : { record_refs: args.record_refs }),
1179
+ ...(args.section_ids === undefined ? {} : { section_ids: args.section_ids }),
1180
+ },
1181
+ });
1182
+ }
1183
+ /**
1184
+ * Edit a plan note, via `PATCH /api/plans/:plan_id/notes/:note_id`.
1185
+ * `content_hash` MUST be the note's `contentHash` from your last read; on a
1186
+ * mismatch nothing is written and you get `{error: "stale_plan_note",
1187
+ * currentHash, currentTitle, currentBody, currentLinks}` — merge into those
1188
+ * and retry with `content_hash: currentHash`, never blindly. `title`/`body`
1189
+ * are each optional and keep their stored value when omitted. The LINK
1190
+ * fields are all-or-nothing as a GROUP: omit all three to keep the stored
1191
+ * link set untouched; send ANY one of them to REPLACE THE WHOLE SET (never a
1192
+ * per-link add/remove — the set is the unit of change). The hash covers
1193
+ * title, body AND the link set, so a stale read of any of the three is
1194
+ * refused. TAKES AN EXPLICIT `plan_id`, same reason as `plan_add_note`.
1195
+ * Unknown plan or note id → 404. Returns the edited note plus the plan's
1196
+ * latest notes page.
1197
+ */
1198
+ export async function planUpdateNote(client, args) {
1199
+ return client.request({
1200
+ method: "PATCH",
1201
+ path: `/${args.plan_id}/notes/${args.note_id}`,
1202
+ basePath: PLANS_BASE_PATH,
1203
+ body: {
1204
+ content_hash: args.content_hash,
1205
+ ...(args.title === undefined ? {} : { title: args.title }),
1206
+ ...(args.body === undefined ? {} : { body: args.body }),
1207
+ ...(args.card_ids === undefined ? {} : { card_ids: args.card_ids }),
1208
+ ...(args.record_refs === undefined ? {} : { record_refs: args.record_refs }),
1209
+ ...(args.section_ids === undefined ? {} : { section_ids: args.section_ids }),
1210
+ },
1211
+ });
1212
+ }
1213
+ /**
1214
+ * Soft-delete a plan note, via `DELETE /api/plans/:plan_id/notes/:note_id`.
1215
+ * `content_hash` MUST be the note's `contentHash` from your last read; a
1216
+ * stale hash deletes nothing and returns the same `{error:
1217
+ * "stale_plan_note", currentHash, currentTitle, currentBody, currentLinks}`
1218
+ * shape `plan_update_note` uses. TAKES AN EXPLICIT `plan_id`, same reason as
1219
+ * `plan_add_note`. Unknown plan, unknown note, or an already-deleted note →
1220
+ * 404. Returns the plan's remaining latest notes page.
1221
+ */
1222
+ export async function planDeleteNote(client, args) {
1223
+ return client.request({
1224
+ method: "DELETE",
1225
+ path: `/${args.plan_id}/notes/${args.note_id}`,
1226
+ basePath: PLANS_BASE_PATH,
1227
+ body: { content_hash: args.content_hash },
1228
+ });
1229
+ }
1150
1230
  // ---------------- failure_category_list / _create / _update (DX-2792) ----------------
1151
1231
  /**
1152
1232
  * DX-2792 (Failure evaluation 3/4) — wraps `src/dashboard/failure-categories-routes.ts`,
package/dist/index.js CHANGED
@@ -101,7 +101,7 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
101
101
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
102
102
  import { z } from "zod";
103
103
  import { DashboardHttpClient } from "./http-client.js";
104
- import { issueAttach, issueChecklist, issueComment, issueCreate, issueDependency, issueEdit, issueGet, issueList, issueProblem, issueQualityGate, issueQualityGateVerdict, issueRetireBranch, issueRetro, issueSolution, issueTransition, issueTriage, briefGetPage, briefList, briefSetPage, failureCategoryCreate, failureCategoryList, failureCategoryUpdate, planAddArchitectureSection, planAddCard, planAddRecord, planConnect, planCreate, planDeleteArchitectureSection, planDeleteRecord, planGet, PLAN_FIELD_GROUPS, PLAN_STATUSES, ISSUE_BATCH_GET_MAX, LIST_PAGE_MAX_LIMIT, PLAN_GET_CARDS_DEFAULT_LIMIT, planGetArchitectureSection, planGetRecord, planList, planRemoveCard, planRename, planReorderArchitectureSection, planUpdateArchitectureSection, planUpdateRecord, repoKnowledgeGet, repoKnowledgeSet, } from "./handlers.js";
104
+ import { issueAttach, issueChecklist, issueComment, issueCreate, issueDependency, issueEdit, issueGet, issueList, issueProblem, issueQualityGate, issueQualityGateVerdict, issueRetireBranch, issueRetro, issueSolution, issueTransition, issueTriage, briefGetPage, briefList, briefSetPage, failureCategoryCreate, failureCategoryList, failureCategoryUpdate, planAddArchitectureSection, planAddCard, planAddNote, planAddRecord, planConnect, planCreate, planDeleteArchitectureSection, planDeleteNote, planDeleteRecord, planGet, PLAN_FIELD_GROUPS, PLAN_STATUSES, ISSUE_BATCH_GET_MAX, LIST_PAGE_MAX_LIMIT, PLAN_GET_CARDS_DEFAULT_LIMIT, planGetArchitectureSection, planGetRecord, planList, planRemoveCard, planRename, planReorderArchitectureSection, planUpdateArchitectureSection, planUpdateNote, planUpdateRecord, repoKnowledgeGet, repoKnowledgeSet, } from "./handlers.js";
105
105
  import { PRIORITY_TIER_WORDS } from "./priority.js";
106
106
  function readEnvOrDie(name) {
107
107
  const v = process.env[name];
@@ -793,6 +793,32 @@ server.tool("plan_delete_record", 'Soft-delete a goal/rule/caveat of your connec
793
793
  record_id: z.number().int().positive().describe("The record id to delete."),
794
794
  content_hash: z.string().describe("The record's `contentHash` from your last read. Required."),
795
795
  }, async (args) => jsonResult(await planDeleteRecord(client, args)));
796
+ server.tool("plan_add_note", "Write a milestone note to a plan's timeline, via POST /api/plans/:plan_id/notes (DX-2915). A note is a MILESTONE, not a log — write one for a card (or related group of cards) finishing, an important decision, or a meaningful goal/rule/caveat/architecture-section change; routine step progress stays a card comment, never a note. Terse tone: `title` at most 60 characters, `body` (the wrap-up) at most 250 (both 400 if too long, naming the limit and actual length). Links resolve on read into what they point at (a card's title, a record's ref+body, a section's title): an unknown card, an unparseable or foreign record ref, or an unknown or foreign section id is refused 400 naming exactly which one. A card link does NOT require the card to be a member of this plan; a record/section link MUST belong to THIS plan. `author` is stamped from your identity server-side — there is no field for it. 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 the plan's latest notes page.", {
797
+ plan_id: z.number().int().positive().describe("The plan id, from `plan_list`."),
798
+ title: z.string().min(1).describe("At most 60 characters."),
799
+ body: z.string().min(1).describe("The wrap-up, at most 250 characters."),
800
+ card_ids: z.array(z.string().min(1)).optional().describe("Card ids this note concerns, e.g. `[\"DX-2894\"]`."),
801
+ record_refs: z
802
+ .array(z.string().min(1))
803
+ .optional()
804
+ .describe("Goal/rule/caveat references this note announces, e.g. `[\"G-1\", \"R-3\", \"CAV-2\"]`."),
805
+ section_ids: z.array(z.number().int().positive()).optional().describe("Architecture section ids this note announces."),
806
+ }, async (args) => jsonResult(await planAddNote(client, args)));
807
+ server.tool("plan_update_note", 'Edit a plan note, via PATCH /api/plans/:plan_id/notes/:note_id (DX-2915). `content_hash` MUST be the note\'s `contentHash` from your last read; a mismatch writes NOTHING and returns `{error: "stale_plan_note", currentHash, currentTitle, currentBody, currentLinks}` — merge into those and retry with `content_hash: currentHash`, never blindly. `title`/`body` are each optional and keep their 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 the stored link set untouched; send ANY one of them to REPLACE THE WHOLE SET — there is no per-link add/remove. The hash covers title, body AND the link set. TAKES AN EXPLICIT `plan_id`, same reason as `plan_add_note`. Unknown plan or note id → 404. Returns the edited note plus the plan\'s latest notes page.', {
808
+ plan_id: z.number().int().positive().describe("The plan id, from `plan_list`."),
809
+ note_id: z.number().int().positive().describe("The note id to edit."),
810
+ content_hash: z.string().describe("The note's `contentHash` from your last read. Required."),
811
+ title: z.string().min(1).optional().describe("New title, at most 60 characters. Omit to keep the stored title."),
812
+ body: z.string().min(1).optional().describe("New wrap-up, at most 250 characters. Omit to keep the stored body."),
813
+ card_ids: z.array(z.string().min(1)).optional().describe("REPLACES the whole link set when sent (with record_refs/section_ids)."),
814
+ record_refs: z.array(z.string().min(1)).optional().describe("REPLACES the whole link set when sent (with card_ids/section_ids)."),
815
+ section_ids: z.array(z.number().int().positive()).optional().describe("REPLACES the whole link set when sent (with card_ids/record_refs)."),
816
+ }, async (args) => jsonResult(await planUpdateNote(client, args)));
817
+ server.tool("plan_delete_note", 'Soft-delete a plan note, via DELETE /api/plans/:plan_id/notes/:note_id (DX-2915). `content_hash` must be the note\'s `contentHash` from your last read; a stale hash deletes nothing and returns `{error: "stale_plan_note", currentHash, currentTitle, currentBody, currentLinks}` — the same shape `plan_update_note` uses. TAKES AN EXPLICIT `plan_id`, same reason as `plan_add_note`. Unknown plan, unknown note, or an already-deleted note → 404. Returns the plan\'s remaining latest notes page.', {
818
+ plan_id: z.number().int().positive().describe("The plan id, from `plan_list`."),
819
+ note_id: z.number().int().positive().describe("The note id to delete."),
820
+ content_hash: z.string().describe("The note's `contentHash` from your last read. Required."),
821
+ }, async (args) => jsonResult(await planDeleteNote(client, args)));
796
822
  server.tool("plan_add_card", "Add an existing card to the plan this session is connected to, via POST /api/plans/mine/cards (DX-2683). The card may live on ANY board — that is what a plan is for. Idempotent: re-adding a card already on the plan is a no-op, not an error, and a card may sit in several plans at once. This adds MEMBERSHIP only; it never edits the card. TAKES NO PLAN ID: the plan is resolved from your connected session. Not connected → `{error: \"session_not_connected\"}`. Unknown card → 404. Returns the plan's full member list.", {
797
823
  card_id: z.string().min(1).describe("An existing card id, e.g. `DX-2683`."),
798
824
  }, async (args) => jsonResult(await planAddCard(client, args)));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thehammer/danx-dashboard-mcp",
3
- "version": "0.1.82",
3
+ "version": "0.1.83",
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",