@50arms/platform-mcp 0.1.468 → 0.1.470

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.
@@ -53,6 +53,10 @@ export const DANXBOT_API_EXAMPLES = {
53
53
  type: "Bug",
54
54
  title: "<title>",
55
55
  summary: "<one plain line: what this card is>",
56
+ justification: {
57
+ quote: "<the exact part of the type's rules you rely on>",
58
+ reasoning: "<why this card matches it>",
59
+ },
56
60
  description: "<markdown>",
57
61
  plan: null,
58
62
  },
@@ -107,7 +111,7 @@ export function danxbotApiExamplesText() {
107
111
  return (
108
112
  // DX-7003: a card read answers each comment's shorter version; the tool's description says how to reach the originals.
109
113
  `Correct first calls: card read ${render(e.cardRead)} (\`fields\` is an object, never a comma string; \`comments\` answers each comment's shorter version when it has one: \`comments: {"expanded": true}\` reads the originals, the ones a decision's provenance quote is copied from, and \`comments: {"q": "<words>"}\` searches them); ` +
110
- `card create ${render(e.cardCreate)} (\`plan\` required: "mine" or null; \`summary\` required, on every phase_children[] item too); ` +
114
+ `card create ${render(e.cardCreate)} (\`plan\` required: "mine" or null; \`summary\` and \`justification\` required, on every phase_children[] item too); ` +
111
115
  `card edit ${render(e.cardEdit)} (only the keys you change; \`ac\` replaces the list); ` +
112
116
  `AC tick ${render(e.acTick)}; ` +
113
117
  `transition ${render(e.transition)}; ` +
package/dist/listen.js CHANGED
@@ -474,6 +474,14 @@ function isReviewableNudgeCardRefArray(value) {
474
474
  return (Array.isArray(value) &&
475
475
  value.every((c) => isNudgeCardRef(c) && typeof c.gate === "string"));
476
476
  }
477
+ function isBackgroundCommandArray(value) {
478
+ return (Array.isArray(value) &&
479
+ value.every((c) => isRecord(c) &&
480
+ typeof c.id === "string" &&
481
+ (typeof c.description === "string" || c.description === null) &&
482
+ typeof c.runningMinutes === "number" &&
483
+ Number.isFinite(c.runningMinutes)));
484
+ }
477
485
  function isNudgeCardRefArray(value) {
478
486
  return Array.isArray(value) && value.every(isNudgeCardRef);
479
487
  }
@@ -498,6 +506,8 @@ export function invalidNudgeReason(value) {
498
506
  return "unreadied is not a {id,title}[] array";
499
507
  if (!isReviewableNudgeCardRefArray(value.reviewable))
500
508
  return "reviewable is not a {id,title,gate}[] array";
509
+ if (!isBackgroundCommandArray(value.commands))
510
+ return "commands is not a {id,description,runningMinutes}[] array";
501
511
  if (value.freeSlots !== null &&
502
512
  !(typeof value.freeSlots === "number" &&
503
513
  Number.isInteger(value.freeSlots) &&
@@ -519,6 +529,14 @@ function freeSlotsSentence(freeSlots) {
519
529
  return "No agent slot is free now: start each review as a slot frees.";
520
530
  return `${freeSlots} agent slot${freeSlots === 1 ? " is" : "s are"} free now: start up to that many at once.`;
521
531
  }
532
+ /** DX-6707 (DEC-818) - the label the overdue background commands sit under, and what to do about them. */
533
+ const BACKGROUND_COMMAND_LABEL = "Background command past its 30-minute hold";
534
+ const BACKGROUND_COMMAND_INSTRUCTION = "check each is doing the right thing and not waiting in vain";
535
+ function backgroundCommandList(cmds) {
536
+ return cmds
537
+ .map((c) => `${c.id} "${c.description ?? "no description"}" (running ${c.runningMinutes}m)`)
538
+ .join(", ");
539
+ }
522
540
  function queuedCardList(cards) {
523
541
  return cards.map((c) => `${c.id} "${c.title}" [${c.queueState}]`).join(", ");
524
542
  }
@@ -562,6 +580,9 @@ export function formatNudgeLine(event) {
562
580
  // DX-7127 - the label and instruction come before the ids, like the filed part, so a cut never takes the instruction.
563
581
  if (event.reviewable.length > 0)
564
582
  parts.push(`${REVIEWABLE_LABEL} (${REVIEWABLE_INSTRUCTION}; ${freeSlotsSentence(event.freeSlots)}): ${reviewableCardList(event.reviewable)}`);
583
+ // DX-6707 (DEC-818) - named apart from the cards: the check is the session's own command, not a card it must work.
584
+ if (event.commands.length > 0)
585
+ parts.push(`${BACKGROUND_COMMAND_LABEL} (${BACKGROUND_COMMAND_INSTRUCTION}): ${backgroundCommandList(event.commands)}`);
565
586
  if (event.startable.length > 0)
566
587
  parts.push(`startable: ${queuedCardList(event.startable)}`);
567
588
  if (event.held.length > 0)
@@ -612,7 +612,7 @@ var readOwnManifest = () => JSON.parse(
612
612
  readFileSync(new URL("../../package.json", import.meta.url), "utf8")
613
613
  ).version;
614
614
  var TOOLKIT_VERSION = resolveToolkitVersion(
615
- false ? void 0 : "0.1.468",
615
+ false ? void 0 : "0.1.470",
616
616
  readOwnManifest
617
617
  );
618
618
  function envelope(now) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@50arms/platform-mcp",
3
- "version": "0.1.468",
3
+ "version": "0.1.470",
4
4
  "description": "Stdio MCP server fronting the 50 Arms dashboard API for agents (operator sessions and dispatched workers alike): the generic 50arms_api/50arms_api_list/50arms_api_spec tools reach any route the caller's credential may call, plus dedicated agent-specific tools (session_connect, request_permission, attach_file, and 50arms_slack_reply) (DX-3465, PLN-11 R-25).",
5
5
  "license": "MIT",
6
6
  "type": "module",