toolcraft 0.0.200 → 0.0.201

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/composition.json CHANGED
@@ -98,7 +98,7 @@
98
98
  },
99
99
  {
100
100
  "name": "tiny-http-mcp-server",
101
- "version": "0.1.14",
101
+ "version": "0.1.15",
102
102
  "license": "MIT"
103
103
  },
104
104
  {
@@ -113,7 +113,7 @@
113
113
  },
114
114
  {
115
115
  "name": "toolcraft",
116
- "version": "0.0.200",
116
+ "version": "0.0.201",
117
117
  "license": "MIT"
118
118
  },
119
119
  {
@@ -123,7 +123,7 @@
123
123
  },
124
124
  {
125
125
  "name": "toolcraft-schema",
126
- "version": "0.0.200",
126
+ "version": "0.0.201",
127
127
  "license": "MIT"
128
128
  },
129
129
  {
@@ -98,7 +98,7 @@
98
98
  },
99
99
  {
100
100
  "name": "tiny-http-mcp-server",
101
- "version": "0.1.14",
101
+ "version": "0.1.15",
102
102
  "license": "MIT"
103
103
  },
104
104
  {
@@ -113,7 +113,7 @@
113
113
  },
114
114
  {
115
115
  "name": "toolcraft",
116
- "version": "0.0.200",
116
+ "version": "0.0.201",
117
117
  "license": "MIT"
118
118
  },
119
119
  {
@@ -123,7 +123,7 @@
123
123
  },
124
124
  {
125
125
  "name": "toolcraft-schema",
126
- "version": "0.0.200",
126
+ "version": "0.0.201",
127
127
  "license": "MIT"
128
128
  },
129
129
  {
@@ -18,7 +18,7 @@
18
18
  },
19
19
  {
20
20
  "name": "tiny-http-mcp-server",
21
- "version": "0.1.14",
21
+ "version": "0.1.15",
22
22
  "license": "MIT"
23
23
  },
24
24
  {
@@ -754,7 +754,7 @@ export class StreamableHttpTransport {
754
754
  const history = this.sseEventHistory.get(sessionId) ?? [];
755
755
  for (const event of history) {
756
756
  if (event.id > lastEventId && !res.writableEnded) {
757
- res.write(formatSseEvent({ id: String(event.id), data: event.data }));
757
+ this.writeToLiveGetStream(res, formatSseEvent({ id: String(event.id), data: event.data }));
758
758
  }
759
759
  }
760
760
  }
@@ -64,12 +64,19 @@ async function readStreamBody(req, maxBytes) {
64
64
  return Buffer.concat(chunks).toString("utf8");
65
65
  }
66
66
  async function readRawBody(req, preParsed, options) {
67
- if (preParsed !== undefined) {
68
- return preParsed;
69
- }
70
67
  const reqWithBody = req;
71
- if (reqWithBody.body !== undefined) {
72
- return reqWithBody.body;
68
+ const body = preParsed !== undefined ? preParsed : reqWithBody.body;
69
+ if (body !== undefined) {
70
+ if (options.maxBytes !== undefined) {
71
+ const serialized = JSON.stringify(body);
72
+ if (serialized === undefined) {
73
+ throw new Error("Invalid Request");
74
+ }
75
+ if (Buffer.byteLength(serialized, "utf8") > options.maxBytes) {
76
+ throw new Error("Payload too large");
77
+ }
78
+ }
79
+ return body;
73
80
  }
74
81
  const raw = await readStreamBody(req, options.maxBytes);
75
82
  try {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tiny-http-mcp-server",
3
- "version": "0.1.14",
3
+ "version": "0.1.15",
4
4
  "description": "Minimal MCP server over HTTP built on tiny-stdio-mcp-server",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -8,7 +8,7 @@
8
8
  },
9
9
  {
10
10
  "name": "toolcraft-schema",
11
- "version": "0.0.200",
11
+ "version": "0.0.201",
12
12
  "license": "MIT"
13
13
  }
14
14
  ]
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toolcraft-schema",
3
- "version": "0.0.200",
3
+ "version": "0.0.201",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toolcraft",
3
- "version": "0.0.200",
3
+ "version": "0.0.201",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -158,7 +158,7 @@
158
158
  "yaml"
159
159
  ],
160
160
  "optionalDependencies": {
161
- "toolcraft-schema": "0.0.200",
161
+ "toolcraft-schema": "0.0.201",
162
162
  "toolcraft-design": "*",
163
163
  "@poe-code/frontmatter": "*",
164
164
  "@poe-code/agent-mcp-config": "*",