toolcraft 0.0.333 → 0.0.335
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/README.md +10 -0
- package/node_modules/tiny-mcp-client/dist/index.d.ts +5 -0
- package/node_modules/tiny-mcp-client/dist/index.js +14 -3
- 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.57",
|
|
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.335",
|
|
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.335",
|
|
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.57",
|
|
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.335",
|
|
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.335",
|
|
127
127
|
"license": "MIT"
|
|
128
128
|
},
|
|
129
129
|
{
|
|
@@ -58,12 +58,22 @@ Legacy SSE mode opens a GET stream and posts messages to the endpoint announced
|
|
|
58
58
|
by the server. Announced endpoints must remain on the original origin without
|
|
59
59
|
embedded credentials or fragments; endpoint changes close the connection.
|
|
60
60
|
Both transports accept the same headers, OAuth provider and response limits.
|
|
61
|
+
`maxResponseBytes` bounds a complete JSON body or each SSE event (default 16 MiB).
|
|
62
|
+
Receive streams may carry many bounded events and keepalive comments; the limit
|
|
63
|
+
does not cap their lifetime bytes. Use request deadlines and cancellation to
|
|
64
|
+
bound pending operations.
|
|
61
65
|
HTTP failures expose `HttpTransportError.status` and `.method`, so callers can
|
|
62
66
|
make transport decisions without parsing error messages. Legacy HTTP/SSE
|
|
63
67
|
`connect()` also waits for the initialized notification POST to complete before
|
|
64
68
|
reporting ready. Completion failures reject the connection and expose
|
|
65
69
|
`rpcMethod: "notifications/initialized"`; they are not setup transport mismatches.
|
|
66
70
|
|
|
71
|
+
`HttpTransport.closeReason` resolves with the original failure as disposal begins.
|
|
72
|
+
Client requests retain that reason even if session deletion is slow or fails.
|
|
73
|
+
Await `transport.closed` to finish cleanup; its reason reports a deletion failure
|
|
74
|
+
when cleanup fails, otherwise the original reason. Custom transports can expose
|
|
75
|
+
the same optional `closeReason` promise when closing requires asynchronous work.
|
|
76
|
+
|
|
67
77
|
## OAuth HTTP support
|
|
68
78
|
|
|
69
79
|
`HttpTransport` accepts `oauth` options from `mcp-oauth`. When a protected server returns a Bearer `WWW-Authenticate` challenge, the transport discovers protected-resource metadata, loads authorization-server metadata, lets the OAuth provider handle authorization, and retries the request when credentials are available.
|
|
@@ -651,6 +651,8 @@ interface McpTransport {
|
|
|
651
651
|
readable: Readable;
|
|
652
652
|
writable: Writable;
|
|
653
653
|
closed: Promise<McpTransportClosedEvent>;
|
|
654
|
+
/** Primary close reason, available before asynchronous transport cleanup finishes. */
|
|
655
|
+
readonly closeReason?: Promise<Error>;
|
|
654
656
|
dispose(reason?: Error): void;
|
|
655
657
|
filterTools?(tools: Tool[], reset?: boolean): Tool[];
|
|
656
658
|
/** Complete a legacy initialization handshake before the client reports ready. */
|
|
@@ -706,6 +708,7 @@ interface HttpTransportOptions {
|
|
|
706
708
|
oauth?: OAuthClientProviderOptions;
|
|
707
709
|
oauthDiscoveryCache?: OAuthDiscoveryCache;
|
|
708
710
|
onWarning?: (message: string) => void;
|
|
711
|
+
/** Maximum JSON response bytes or individual SSE event bytes; not a stream lifetime cap. */
|
|
709
712
|
maxResponseBytes?: number;
|
|
710
713
|
}
|
|
711
714
|
declare class StdioTransport implements McpTransport {
|
|
@@ -725,6 +728,8 @@ declare class HttpTransport implements McpTransport {
|
|
|
725
728
|
readonly readable: Readable;
|
|
726
729
|
readonly writable: Writable;
|
|
727
730
|
readonly closed: Promise<McpTransportClosedEvent>;
|
|
731
|
+
readonly closeReason: Promise<Error>;
|
|
732
|
+
private resolveCloseReason;
|
|
728
733
|
private readonly url;
|
|
729
734
|
private readonly mode;
|
|
730
735
|
private legacyEndpoint;
|
|
@@ -6697,9 +6697,13 @@ var McpClient = class {
|
|
|
6697
6697
|
this.currentInstructions = void 0;
|
|
6698
6698
|
this.subscribedResourceUris.clear();
|
|
6699
6699
|
this.activeProgressTokens.clear();
|
|
6700
|
-
const transportClosedReason = transport.closed.then((closedEvent) => closedEvent.reason).catch(
|
|
6700
|
+
const transportClosedReason = (transport.closeReason ?? transport.closed.then((closedEvent) => closedEvent.reason)).catch(
|
|
6701
6701
|
(error) => error instanceof Error ? error : new Error(String(error))
|
|
6702
6702
|
);
|
|
6703
|
+
let primaryCloseReason;
|
|
6704
|
+
void transportClosedReason.then((reason) => {
|
|
6705
|
+
primaryCloseReason = reason;
|
|
6706
|
+
});
|
|
6703
6707
|
const messageLayer = new JsonRpcMessageLayer(
|
|
6704
6708
|
transport.readable,
|
|
6705
6709
|
transport.writable,
|
|
@@ -6816,7 +6820,7 @@ var McpClient = class {
|
|
|
6816
6820
|
if (this.transport !== transport) {
|
|
6817
6821
|
return;
|
|
6818
6822
|
}
|
|
6819
|
-
this.messageLayer?.dispose(closedEvent.reason);
|
|
6823
|
+
this.messageLayer?.dispose(primaryCloseReason ?? closedEvent.reason);
|
|
6820
6824
|
this.messageLayer = null;
|
|
6821
6825
|
this.transport = null;
|
|
6822
6826
|
this.currentState = "closed";
|
|
@@ -7559,6 +7563,8 @@ var HttpTransport = class {
|
|
|
7559
7563
|
readable;
|
|
7560
7564
|
writable;
|
|
7561
7565
|
closed;
|
|
7566
|
+
closeReason;
|
|
7567
|
+
resolveCloseReason;
|
|
7562
7568
|
url;
|
|
7563
7569
|
mode;
|
|
7564
7570
|
legacyEndpoint;
|
|
@@ -7612,6 +7618,9 @@ var HttpTransport = class {
|
|
|
7612
7618
|
});
|
|
7613
7619
|
this.readable = this.readStream;
|
|
7614
7620
|
this.writable = this.writeStream;
|
|
7621
|
+
this.closeReason = new Promise((resolve) => {
|
|
7622
|
+
this.resolveCloseReason = resolve;
|
|
7623
|
+
});
|
|
7615
7624
|
this.closed = new Promise((resolve) => {
|
|
7616
7625
|
this.resolveClosed = resolve;
|
|
7617
7626
|
});
|
|
@@ -7636,7 +7645,7 @@ var HttpTransport = class {
|
|
|
7636
7645
|
try {
|
|
7637
7646
|
await this.sendPost(serializeJsonRpcMessage({ jsonrpc: "2.0", method: "notifications/initialized" }), signal);
|
|
7638
7647
|
signal.throwIfAborted();
|
|
7639
|
-
if (this.disposed) throw
|
|
7648
|
+
if (this.disposed) throw await this.closeReason;
|
|
7640
7649
|
} catch (error) {
|
|
7641
7650
|
if (error instanceof HttpTransportError)
|
|
7642
7651
|
throw new HttpTransportError(error.message, error.status, error.method, "notifications/initialized");
|
|
@@ -7667,6 +7676,8 @@ var HttpTransport = class {
|
|
|
7667
7676
|
this.rejectLegacyEndpoint?.(reason);
|
|
7668
7677
|
this.rejectLegacyEndpoint = void 0;
|
|
7669
7678
|
this.resolveLegacyEndpoint = void 0;
|
|
7679
|
+
this.resolveCloseReason?.(reason);
|
|
7680
|
+
this.resolveCloseReason = void 0;
|
|
7670
7681
|
this.toolParameterHeaders.clear();
|
|
7671
7682
|
this.abortInFlightFetches(reason);
|
|
7672
7683
|
this.cancelOpenResponseReaders();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "toolcraft",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.335",
|
|
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.335",
|
|
162
162
|
"toolcraft-design": "*",
|
|
163
163
|
"@poe-code/frontmatter": "*",
|
|
164
164
|
"@poe-code/agent-mcp-config": "*",
|