toolcraft 0.0.744 → 0.0.746
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 +3 -3
- package/dist/composition.json +3 -3
- package/node_modules/auth-store/dist/transaction-lock.js +2 -2
- package/node_modules/tiny-http-mcp-server/dist/composition.json +1 -1
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/README.md +1 -1
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/client-registration.js +1 -1
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/loopback-authorization.d.ts +2 -9
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/loopback-authorization.js +8 -48
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/redirect-target.d.ts +10 -0
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/redirect-target.js +42 -0
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/resource-bound-store.js +2 -2
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/client/session-transaction.js +4 -3
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/index.browser.d.ts +6 -0
- package/node_modules/tiny-http-mcp-server/node_modules/mcp-oauth/dist/index.browser.js +8 -0
- package/node_modules/tiny-http-mcp-server/package.json +1 -1
- package/node_modules/tiny-mcp-client/dist/index.browser.js +75 -11
- package/node_modules/tiny-mcp-client/dist/index.js +431 -424
- package/node_modules/tiny-stdio-mcp-server/dist/base64.js +6 -1
- package/node_modules/tiny-stdio-mcp-server/dist/composition.json +1 -1
- package/node_modules/tiny-stdio-mcp-server/dist/headers.js +7 -6
- package/node_modules/toolcraft-schema/package.json +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export function encodeHeaderValue(value) {
|
|
2
|
-
const bytes =
|
|
3
|
-
if (
|
|
2
|
+
const bytes = new TextEncoder().encode(value);
|
|
3
|
+
if (new TextDecoder("utf-8", { ignoreBOM: true }).decode(bytes) !== value)
|
|
4
4
|
throw new Error("MCP header value must contain valid Unicode");
|
|
5
5
|
const sentinel = value.startsWith("=?base64?") && value.endsWith("?=");
|
|
6
6
|
const unsafe = value.trim() !== value ||
|
|
@@ -8,17 +8,18 @@ export function encodeHeaderValue(value) {
|
|
|
8
8
|
const code = character.charCodeAt(0);
|
|
9
9
|
return code !== 9 && (code < 32 || code > 126);
|
|
10
10
|
});
|
|
11
|
-
return sentinel || unsafe ? `=?base64?${bytes.
|
|
11
|
+
return sentinel || unsafe ? `=?base64?${btoa(Array.from(bytes, byte => String.fromCharCode(byte)).join(""))}?=` : value;
|
|
12
12
|
}
|
|
13
13
|
export function decodeHeaderValue(value) {
|
|
14
14
|
if (typeof value !== "string")
|
|
15
15
|
return undefined;
|
|
16
16
|
if (value.startsWith("=?base64?") && value.endsWith("?=")) {
|
|
17
17
|
const encoded = value.slice(9, -2);
|
|
18
|
-
const bytes = Buffer.from(encoded, "base64");
|
|
19
|
-
if (bytes.toString("base64") !== encoded)
|
|
20
|
-
return undefined;
|
|
21
18
|
try {
|
|
19
|
+
const binary = atob(encoded);
|
|
20
|
+
if (btoa(binary) !== encoded)
|
|
21
|
+
return undefined;
|
|
22
|
+
const bytes = Uint8Array.from(binary, character => character.charCodeAt(0));
|
|
22
23
|
return new TextDecoder("utf-8", { fatal: true, ignoreBOM: true }).decode(bytes);
|
|
23
24
|
}
|
|
24
25
|
catch {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "toolcraft",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.746",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -162,7 +162,7 @@
|
|
|
162
162
|
"yaml"
|
|
163
163
|
],
|
|
164
164
|
"optionalDependencies": {
|
|
165
|
-
"toolcraft-schema": "0.0.
|
|
165
|
+
"toolcraft-schema": "0.0.746",
|
|
166
166
|
"toolcraft-design": "*",
|
|
167
167
|
"@poe-code/frontmatter": "*",
|
|
168
168
|
"@poe-code/agent-mcp-config": "*",
|