@tmcp/transport-http 0.2.1 → 0.3.0
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/CHANGELOG.md +11 -0
- package/package.json +3 -3
- package/src/index.js +17 -8
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tmcp/transport-http",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Transport for TMCP using HTTP",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"./package.json": "./package.json"
|
|
14
14
|
},
|
|
15
15
|
"peerDependencies": {
|
|
16
|
-
"tmcp": "^1.7.
|
|
16
|
+
"tmcp": "^1.7.1"
|
|
17
17
|
},
|
|
18
18
|
"keywords": [
|
|
19
19
|
"tmcp",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"publint": "^0.3.12",
|
|
30
|
-
"tmcp": "^1.7.
|
|
30
|
+
"tmcp": "^1.7.1"
|
|
31
31
|
},
|
|
32
32
|
"publishConfig": {
|
|
33
33
|
"access": "public"
|
package/src/index.js
CHANGED
|
@@ -87,15 +87,24 @@ export class HttpTransport {
|
|
|
87
87
|
// If session already exists, return existing stream
|
|
88
88
|
const existing_stream = this.#streams.get(session_id);
|
|
89
89
|
if (existing_stream) {
|
|
90
|
-
return new Response(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
90
|
+
return new Response(
|
|
91
|
+
JSON.stringify({
|
|
92
|
+
jsonrpc: '2.0',
|
|
93
|
+
error: {
|
|
94
|
+
code: -32000,
|
|
95
|
+
message:
|
|
96
|
+
'Conflict: Only one SSE stream is allowed per session',
|
|
97
|
+
},
|
|
98
|
+
id: null,
|
|
99
|
+
}),
|
|
100
|
+
{
|
|
101
|
+
headers: {
|
|
102
|
+
'Content-Type': 'application/json',
|
|
103
|
+
'mcp-session-id': session_id,
|
|
104
|
+
},
|
|
105
|
+
status: 409,
|
|
96
106
|
},
|
|
97
|
-
|
|
98
|
-
});
|
|
107
|
+
);
|
|
99
108
|
}
|
|
100
109
|
|
|
101
110
|
// Create new long-lived stream for notifications
|