@mcp-use/client 2.4.5 → 2.4.6-canary.1
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/dist/.tsbuildinfo +1 -1
- package/dist/auth/url.d.ts +2 -3
- package/dist/auth/url.d.ts.map +1 -1
- package/dist/code-mode/executor-vm.d.ts.map +1 -1
- package/dist/index-browser.js +7 -17
- package/dist/index-browser.js.map +1 -1
- package/dist/index.js +46 -22
- package/dist/index.js.map +1 -1
- package/dist/react/index.js +7 -17
- package/dist/react/index.js.map +1 -1
- package/package.json +2 -2
package/dist/auth/url.d.ts
CHANGED
|
@@ -3,11 +3,10 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Sanitizes URLs to prevent security issues by:
|
|
5
5
|
* - Restricting to http/https protocols only
|
|
6
|
-
* -
|
|
7
|
-
* - Validating hostnames
|
|
6
|
+
* - Validating URL structure using the WHATWG URL parser
|
|
8
7
|
*/
|
|
9
8
|
/**
|
|
10
|
-
* Sanitizes a URL string by
|
|
9
|
+
* Sanitizes a URL string by validating the protocol and returning its normalized href.
|
|
11
10
|
*
|
|
12
11
|
* @param raw - The raw URL string to sanitize
|
|
13
12
|
* @returns The sanitized URL as a string
|
package/dist/auth/url.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../src/auth/url.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../src/auth/url.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAa/C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor-vm.d.ts","sourceRoot":"","sources":["../../src/code-mode/executor-vm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpE,OAAO,EAAE,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAsEvE;;;GAGG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAGvC;
|
|
1
|
+
{"version":3,"file":"executor-vm.d.ts","sourceRoot":"","sources":["../../src/code-mode/executor-vm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEpE,OAAO,EAAE,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAsEvE;;;GAGG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAGvC;AA6ED;;;GAGG;AACH,qBAAa,cAAe,SAAQ,gBAAgB;IAClD,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,aAAa,CAAC,CAAS;gBAEnB,MAAM,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,iBAAiB;IAS1D;;OAEG;YACW,cAAc;IAc5B;;;;;OAKG;IACG,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAsEvE;;;;OAIG;YACW,aAAa;IAuF3B;;;OAGG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAG/B"}
|
package/dist/index-browser.js
CHANGED
|
@@ -128,7 +128,7 @@ var Logger = class {
|
|
|
128
128
|
var logger = Logger.get();
|
|
129
129
|
|
|
130
130
|
// src/utils/version.ts
|
|
131
|
-
var VERSION = "2.4.
|
|
131
|
+
var VERSION = "2.4.6-canary.1";
|
|
132
132
|
function getPackageVersion() {
|
|
133
133
|
return VERSION;
|
|
134
134
|
}
|
|
@@ -822,27 +822,17 @@ import { validateClientMetadataUrl } from "@modelcontextprotocol/client";
|
|
|
822
822
|
|
|
823
823
|
// src/auth/url.ts
|
|
824
824
|
function sanitizeUrl(raw) {
|
|
825
|
-
const abort = () => {
|
|
826
|
-
throw new Error(`Invalid url to pass to open(): ${raw}`);
|
|
827
|
-
};
|
|
828
825
|
let url;
|
|
829
826
|
try {
|
|
830
827
|
url = new URL(raw);
|
|
831
|
-
} catch
|
|
832
|
-
|
|
833
|
-
}
|
|
834
|
-
if (url.protocol !== "
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
if (url.password) url.password = encodeURIComponent(url.password);
|
|
838
|
-
url.pathname = url.pathname.slice(0, 1) + encodeURIComponent(url.pathname.slice(1)).replace(/%2f/gi, "/");
|
|
839
|
-
url.search = url.search.slice(0, 1) + Array.from(url.searchParams.entries()).map(sanitizeParam).join("&");
|
|
840
|
-
url.hash = url.hash.slice(0, 1) + encodeURIComponent(url.hash.slice(1));
|
|
828
|
+
} catch {
|
|
829
|
+
throw new Error(`Invalid url to pass to open(): ${raw}`);
|
|
830
|
+
}
|
|
831
|
+
if (url.protocol !== "http:" && url.protocol !== "https:") {
|
|
832
|
+
throw new Error(`Invalid url to pass to open(): ${raw}`);
|
|
833
|
+
}
|
|
841
834
|
return url.href;
|
|
842
835
|
}
|
|
843
|
-
function sanitizeParam([k, v]) {
|
|
844
|
-
return `${encodeURIComponent(k)}${v.length > 0 ? `=${encodeURIComponent(v)}` : ""}`;
|
|
845
|
-
}
|
|
846
836
|
|
|
847
837
|
// src/auth/session-store.ts
|
|
848
838
|
var OAuthSessionStore = class _OAuthSessionStore {
|