toolcraft 0.0.185 → 0.0.186
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/tiny-http-mcp-server/dist/composition.json +1 -1
- package/node_modules/tiny-http-mcp-server/package.json +1 -1
- package/node_modules/tiny-mcp-client/dist/index.d.ts +1 -0
- package/node_modules/tiny-mcp-client/dist/index.js +51 -16
- package/node_modules/tiny-stdio-mcp-server/dist/composition.json +1 -1
- package/node_modules/toolcraft-schema/package.json +1 -1
- package/package.json +2 -2
package/composition.json
CHANGED
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
},
|
|
99
99
|
{
|
|
100
100
|
"name": "tiny-http-mcp-server",
|
|
101
|
-
"version": "0.1.
|
|
101
|
+
"version": "0.1.11",
|
|
102
102
|
"license": "MIT"
|
|
103
103
|
},
|
|
104
104
|
{
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
},
|
|
114
114
|
{
|
|
115
115
|
"name": "toolcraft",
|
|
116
|
-
"version": "0.0.
|
|
116
|
+
"version": "0.0.186",
|
|
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.
|
|
126
|
+
"version": "0.0.186",
|
|
127
127
|
"license": "MIT"
|
|
128
128
|
},
|
|
129
129
|
{
|
package/dist/composition.json
CHANGED
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
},
|
|
99
99
|
{
|
|
100
100
|
"name": "tiny-http-mcp-server",
|
|
101
|
-
"version": "0.1.
|
|
101
|
+
"version": "0.1.11",
|
|
102
102
|
"license": "MIT"
|
|
103
103
|
},
|
|
104
104
|
{
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
},
|
|
114
114
|
{
|
|
115
115
|
"name": "toolcraft",
|
|
116
|
-
"version": "0.0.
|
|
116
|
+
"version": "0.0.186",
|
|
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.
|
|
126
|
+
"version": "0.0.186",
|
|
127
127
|
"license": "MIT"
|
|
128
128
|
},
|
|
129
129
|
{
|
|
@@ -567,6 +567,7 @@ declare class HttpTransport implements McpTransport {
|
|
|
567
567
|
private cancelOpenSseReaders;
|
|
568
568
|
private fetchWithAbort;
|
|
569
569
|
private consumeWrittenLines;
|
|
570
|
+
private sendPost;
|
|
570
571
|
private createPostHeaders;
|
|
571
572
|
private createGetHeaders;
|
|
572
573
|
private createDeleteHeaders;
|
|
@@ -2919,6 +2919,9 @@ var HttpTransport = class {
|
|
|
2919
2919
|
this.openSseReaders.clear();
|
|
2920
2920
|
}
|
|
2921
2921
|
async fetchWithAbort(input, init) {
|
|
2922
|
+
if (this.disposed) {
|
|
2923
|
+
throw new Error("HTTP transport disposed");
|
|
2924
|
+
}
|
|
2922
2925
|
const abortController = new AbortController();
|
|
2923
2926
|
this.inFlightFetchAbortControllers.add(abortController);
|
|
2924
2927
|
try {
|
|
@@ -2935,25 +2938,44 @@ var HttpTransport = class {
|
|
|
2935
2938
|
if (this.disposed || line.length === 0) {
|
|
2936
2939
|
continue;
|
|
2937
2940
|
}
|
|
2938
|
-
const
|
|
2939
|
-
const
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
this.dispose(new Error("HTTP transport session expired (404 response)"));
|
|
2947
|
-
return;
|
|
2941
|
+
const parsed = parseJsonRpcMessage(line);
|
|
2942
|
+
const post = this.sendPost(line);
|
|
2943
|
+
if (parsed.type === "request" && parsed.message.method === "initialize" || parsed.type === "notification" && parsed.message.method === "notifications/initialized") {
|
|
2944
|
+
await post;
|
|
2945
|
+
} else {
|
|
2946
|
+
void post.catch((error) => {
|
|
2947
|
+
this.dispose(error instanceof Error ? error : new Error(String(error)));
|
|
2948
|
+
});
|
|
2948
2949
|
}
|
|
2949
|
-
await this.throwForPostHttpError(response);
|
|
2950
|
-
this.captureSessionId(response);
|
|
2951
|
-
this.maybeOpenGetSseStream();
|
|
2952
|
-
void this.forwardResponseMessages(response).catch((error) => {
|
|
2953
|
-
this.dispose(error instanceof Error ? error : new Error(String(error)));
|
|
2954
|
-
});
|
|
2955
2950
|
}
|
|
2956
2951
|
}
|
|
2952
|
+
async sendPost(line) {
|
|
2953
|
+
const hasSessionId = this.sessionId !== void 0;
|
|
2954
|
+
const response = await this.fetchWithOAuthRetry({
|
|
2955
|
+
method: "POST",
|
|
2956
|
+
createHeaders: () => this.createPostHeaders(),
|
|
2957
|
+
body: line
|
|
2958
|
+
});
|
|
2959
|
+
if (this.disposed) {
|
|
2960
|
+
await response.body?.cancel();
|
|
2961
|
+
return;
|
|
2962
|
+
}
|
|
2963
|
+
if (hasSessionId && response.status === 404) {
|
|
2964
|
+
this.sessionId = void 0;
|
|
2965
|
+
this.dispose(new Error("HTTP transport session expired (404 response)"));
|
|
2966
|
+
return;
|
|
2967
|
+
}
|
|
2968
|
+
await this.throwForPostHttpError(response);
|
|
2969
|
+
if (this.disposed) {
|
|
2970
|
+
await response.body?.cancel();
|
|
2971
|
+
return;
|
|
2972
|
+
}
|
|
2973
|
+
this.captureSessionId(response);
|
|
2974
|
+
this.maybeOpenGetSseStream();
|
|
2975
|
+
void this.forwardResponseMessages(response).catch((error) => {
|
|
2976
|
+
this.dispose(error instanceof Error ? error : new Error(String(error)));
|
|
2977
|
+
});
|
|
2978
|
+
}
|
|
2957
2979
|
async createPostHeaders() {
|
|
2958
2980
|
const headers = new Headers(this.headers);
|
|
2959
2981
|
headers.set("Accept", "application/json, text/event-stream");
|
|
@@ -3750,6 +3772,19 @@ function isJsonRpcErrorObject(value) {
|
|
|
3750
3772
|
}
|
|
3751
3773
|
return value.data === void 0 || hasOwn(value, "data");
|
|
3752
3774
|
}
|
|
3775
|
+
function parseJsonRpcMessage(line) {
|
|
3776
|
+
let parsed;
|
|
3777
|
+
try {
|
|
3778
|
+
parsed = JSON.parse(line);
|
|
3779
|
+
} catch {
|
|
3780
|
+
return {
|
|
3781
|
+
type: "invalid",
|
|
3782
|
+
id: null,
|
|
3783
|
+
error: parseError()
|
|
3784
|
+
};
|
|
3785
|
+
}
|
|
3786
|
+
return parseJsonRpcPayload(parsed);
|
|
3787
|
+
}
|
|
3753
3788
|
function parseJsonRpcPayload(parsed) {
|
|
3754
3789
|
if (!isObjectRecord5(parsed)) {
|
|
3755
3790
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "toolcraft",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.186",
|
|
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.
|
|
161
|
+
"toolcraft-schema": "0.0.186",
|
|
162
162
|
"toolcraft-design": "*",
|
|
163
163
|
"@poe-code/frontmatter": "*",
|
|
164
164
|
"@poe-code/agent-mcp-config": "*",
|