@jini-ai/mcp 0.3.2 → 0.3.4

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.
@@ -64,7 +64,7 @@ export interface McpToolDef<Args extends Record<string, unknown> = Record<string
64
64
  * other block the pinned SDK's `ContentBlockSchema` recognizes — reaches the client as a real content
65
65
  * block rather than flattened text (see this module's own doc for the bug this closes). Every other
66
66
  * payload keeps the original behavior: a string passes through as one text block; anything else is
67
- * JSON-stringified into one.
67
+ * JSON-stringified (compact, no indentation) into one.
68
68
  *
69
69
  * @complexity O(n) in the number of content-array entries, only when `payload` already looks like an
70
70
  * envelope; O(1) otherwise.
@@ -107,7 +107,7 @@ function isMcpContentEnvelope(payload) {
107
107
  * other block the pinned SDK's `ContentBlockSchema` recognizes — reaches the client as a real content
108
108
  * block rather than flattened text (see this module's own doc for the bug this closes). Every other
109
109
  * payload keeps the original behavior: a string passes through as one text block; anything else is
110
- * JSON-stringified into one.
110
+ * JSON-stringified (compact, no indentation) into one.
111
111
  *
112
112
  * @complexity O(n) in the number of content-array entries, only when `payload` already looks like an
113
113
  * envelope; O(1) otherwise.
@@ -116,7 +116,10 @@ export function okResult(payload) {
116
116
  if (isMcpContentEnvelope(payload)) {
117
117
  return { content: payload.content };
118
118
  }
119
- const text = typeof payload === 'string' ? payload : JSON.stringify(payload, null, 2);
119
+ // Compact on the wire: indentation made nested results ~2.5x larger for the model to read. A view
120
+ // that shows a result to a person re-indents it at render time (`@jini-ai/chat`'s
121
+ // `formatToolOutputForDisplay`).
122
+ const text = typeof payload === 'string' ? payload : JSON.stringify(payload);
120
123
  return { content: [{ type: 'text', text }] };
121
124
  }
122
125
  /** Wraps a tool failure as an MCP `isError` result. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jini-ai/mcp",
3
- "version": "0.3.2",
3
+ "version": "0.3.4",
4
4
  "description": "Model Context Protocol adapters: server config schema and IO, an MCP client, and agent-side MCP server installation.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -48,7 +48,7 @@
48
48
  "@modelcontextprotocol/sdk": "^1.29.0",
49
49
  "undici": "^7.25.0",
50
50
  "@jini-ai/platform": "0.3.0",
51
- "@jini-ai/cli": "0.3.0"
51
+ "@jini-ai/cli": "0.3.1"
52
52
  },
53
53
  "scripts": {
54
54
  "build": "tsc -p tsconfig.json && chmod +x dist/bin/serve.js",