@50arms/platform-mcp 0.1.471 → 0.1.472

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.
@@ -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.471",
615
+ false ? void 0 : "0.1.472",
616
616
  readOwnManifest
617
617
  );
618
618
  function envelope(now) {
@@ -12,8 +12,8 @@ import os from "node:os";
12
12
  import path from "node:path";
13
13
  import { writeFileDurable } from "./durable-write.js";
14
14
  export const ROLE_FILE_INSTRUCTION = "Read this file in full now, with Read (in parts with offset and limit when it is long): it is your role's workflow, the procedure you work by.";
15
- // The profile names the file, so it must be a plain name: never a path a reply could steer.
16
- const PROFILE_NAME = /^[a-z][a-z0-9-]*$/;
15
+ // The profile names the file, so it must be a plain name: never a path a reply could steer. DX-7462: a card type's own profile is a team profile, whose name may hold `_` (`AGENT_NAME_SHAPE`).
16
+ const PROFILE_NAME = /^[a-z][a-z0-9_-]*$/;
17
17
  /**
18
18
  * `result` with its body's `roleInstruction` written to a file and replaced by where it is. A body without the key, or with `null` (nothing to
19
19
  * send), passes unchanged. A `roleInstruction` of any other shape is a dashboard contract break and throws (CP1).
package/dist/tool-defs.js CHANGED
@@ -18,8 +18,29 @@
18
18
  import { Client } from "@modelcontextprotocol/sdk/client/index.js";
19
19
  import { InMemoryTransport } from "@modelcontextprotocol/sdk/inMemory.js";
20
20
  import { server } from "./index.js";
21
+ import { assertWithinTextLimit } from "./text-limit.js";
21
22
  /** The server id the platform catalog mcp-server artifact is keyed by. */
22
23
  export const DANX_DASHBOARD_SERVER_ID = "platform";
24
+ /**
25
+ * DX-4318 / DX-7435: refuses a tool definition whose description, or any parameter description in its schema, is over the text limit Claude Code cuts at. A tool
26
+ * description is also refused where it registers; this is the one place that measures the parameter descriptions, so the `tool-defs.json` generator fails on one.
27
+ */
28
+ export function assertToolDefsWithinTextLimit(tools) {
29
+ const walk = (node, path) => {
30
+ if (node === null || typeof node !== "object")
31
+ return;
32
+ for (const [key, value] of Object.entries(node)) {
33
+ if (key === "description" && typeof value === "string") {
34
+ assertWithinTextLimit(`${path} description`, value);
35
+ }
36
+ walk(value, `${path}.${key}`);
37
+ }
38
+ };
39
+ for (const tool of tools) {
40
+ assertWithinTextLimit(`the "${tool.name}" tool description`, tool.description);
41
+ walk(tool.input_schema, `the "${tool.name}" tool schema`);
42
+ }
43
+ }
23
44
  /**
24
45
  * Introspect `server`'s registered tools via an in-memory `tools/list` — the
25
46
  * exact `{name, description, inputSchema}` the agent's context receives — and
@@ -35,13 +56,15 @@ export async function generateToolDefs() {
35
56
  ]);
36
57
  try {
37
58
  const { tools } = await client.listTools();
38
- return tools
59
+ const defs = tools
39
60
  .map((t) => ({
40
61
  name: t.name,
41
62
  description: t.description ?? "",
42
63
  input_schema: t.inputSchema,
43
64
  }))
44
65
  .sort((a, b) => a.name.localeCompare(b.name));
66
+ assertToolDefsWithinTextLimit(defs);
67
+ return defs;
45
68
  }
46
69
  finally {
47
70
  await client.close();
@@ -56,3 +79,14 @@ export async function generateToolDefsFile() {
56
79
  export function serializeToolDefsFile(file) {
57
80
  return JSON.stringify(file, null, 2) + "\n";
58
81
  }
82
+ /**
83
+ * DX-7439: the one staleness check of the committed `tool-defs.json`, run by `gen-tool-defs --check` and by the landing tree check
84
+ * `mcp-tool-defs-current`. Generates the file from the live registrations and compares it with `committed` (the text at `path`); returns the
85
+ * message to print when they differ, null when the committed file is current.
86
+ */
87
+ export async function staleToolDefsMessage(committed, path) {
88
+ const fresh = serializeToolDefsFile(await generateToolDefsFile());
89
+ return committed === fresh
90
+ ? null
91
+ : `${path} is stale: run \`npm run gen-tool-defs\` in the platform MCP package and commit the result`;
92
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@50arms/platform-mcp",
3
- "version": "0.1.471",
3
+ "version": "0.1.472",
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",