@effect-uai/mcp 0.17.0 → 0.19.0-dev-20261109183959
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/Client.d.mts +4 -4
- package/dist/Client.mjs.map +1 -1
- package/dist/Toolkit.d.mts +9 -5
- package/dist/Toolkit.d.mts.map +1 -1
- package/dist/Toolkit.mjs +42 -24
- package/dist/Toolkit.mjs.map +1 -1
- package/dist/auth-CRIPfiPB.d.mts +47 -0
- package/dist/auth-CRIPfiPB.d.mts.map +1 -0
- package/dist/internal/auth.d.mts +1 -1
- package/dist/internal/httpTransport.d.mts +3 -3
- package/dist/internal/httpTransport.mjs +1 -1
- package/dist/internal/httpTransport.mjs.map +1 -1
- package/dist/internal/protocol.d.mts +1 -1
- package/dist/internal/protocols/2025-06-18.d.mts +1 -1
- package/dist/internal/protocols/2026-07-28.d.mts +1 -1
- package/dist/internal/protocols/2026-07-28.d.mts.map +1 -1
- package/dist/internal/protocols/2026-07-28.mjs +3 -2
- package/dist/internal/protocols/2026-07-28.mjs.map +1 -1
- package/dist/internal/rpc.d.mts +1 -1
- package/dist/internal/schema.d.mts +2 -2
- package/dist/internal/schema.mjs +39 -5
- package/dist/internal/schema.mjs.map +1 -1
- package/dist/internal/stdioTransport.d.mts +2 -2
- package/dist/internal/stdioTransport.mjs +1 -1
- package/dist/internal/stdioTransport.mjs.map +1 -1
- package/dist/{protocol-kjC3iAMb.d.mts → protocol-C3L9kaRW.d.mts} +3 -3
- package/dist/{protocol-kjC3iAMb.d.mts.map → protocol-C3L9kaRW.d.mts.map} +1 -1
- package/dist/{rpc-Bq95Lio9.d.mts → rpc-Bs2BCLha.d.mts} +2 -2
- package/dist/{rpc-Bq95Lio9.d.mts.map → rpc-Bs2BCLha.d.mts.map} +1 -1
- package/dist/{schema-D2oUNuo5.d.mts → schema-tDws3q4j.d.mts} +158 -11
- package/dist/schema-tDws3q4j.d.mts.map +1 -0
- package/package.json +7 -7
- package/src/Client.ts +2 -2
- package/src/Toolkit.test.ts +83 -0
- package/src/Toolkit.ts +65 -34
- package/src/internal/httpTransport.ts +1 -1
- package/src/internal/protocols/2026-07-28.ts +3 -2
- package/src/internal/schema.ts +44 -5
- package/src/internal/stdioTransport.ts +1 -1
- package/dist/auth-ZDvsxpCo.d.mts +0 -126
- package/dist/auth-ZDvsxpCo.d.mts.map +0 -1
- package/dist/schema-D2oUNuo5.d.mts.map +0 -1
package/src/internal/schema.ts
CHANGED
|
@@ -145,20 +145,59 @@ export const TextContent = Schema.Struct({
|
|
|
145
145
|
})
|
|
146
146
|
export type TextContent = typeof TextContent.Type
|
|
147
147
|
|
|
148
|
-
|
|
148
|
+
export const ImageContent = Schema.Struct({
|
|
149
|
+
type: Schema.Literal("image"),
|
|
150
|
+
data: Schema.String,
|
|
151
|
+
mimeType: Schema.String,
|
|
152
|
+
})
|
|
153
|
+
|
|
154
|
+
export const AudioContent = Schema.Struct({
|
|
155
|
+
type: Schema.Literal("audio"),
|
|
156
|
+
data: Schema.String,
|
|
157
|
+
mimeType: Schema.String,
|
|
158
|
+
})
|
|
159
|
+
|
|
160
|
+
export const ResourceLink = Schema.Struct({
|
|
161
|
+
type: Schema.Literal("resource_link"),
|
|
162
|
+
uri: Schema.String,
|
|
163
|
+
name: Schema.optional(Schema.String),
|
|
164
|
+
mimeType: Schema.optional(Schema.String),
|
|
165
|
+
})
|
|
166
|
+
|
|
167
|
+
export const EmbeddedResource = Schema.Struct({
|
|
168
|
+
type: Schema.Literal("resource"),
|
|
169
|
+
resource: Schema.Union([
|
|
170
|
+
Schema.Struct({ uri: Schema.String, text: Schema.String }),
|
|
171
|
+
Schema.Struct({
|
|
172
|
+
uri: Schema.String,
|
|
173
|
+
blob: Schema.String,
|
|
174
|
+
mimeType: Schema.optional(Schema.String),
|
|
175
|
+
}),
|
|
176
|
+
]),
|
|
177
|
+
})
|
|
178
|
+
|
|
179
|
+
/** A block type this client does not know; summarized for the model. */
|
|
149
180
|
export const OtherContent = Schema.Struct({
|
|
150
181
|
type: Schema.String,
|
|
151
182
|
})
|
|
152
183
|
|
|
153
|
-
export const
|
|
154
|
-
|
|
184
|
+
export const KnownContent = Schema.Union([
|
|
185
|
+
TextContent,
|
|
186
|
+
ImageContent,
|
|
187
|
+
AudioContent,
|
|
188
|
+
ResourceLink,
|
|
189
|
+
EmbeddedResource,
|
|
190
|
+
])
|
|
191
|
+
export type KnownContent = typeof KnownContent.Type
|
|
192
|
+
export const isKnownContent = Schema.is(KnownContent)
|
|
155
193
|
|
|
156
|
-
export const
|
|
194
|
+
export const ContentBlock = Schema.Union([KnownContent, OtherContent])
|
|
195
|
+
export type ContentBlock = typeof ContentBlock.Type
|
|
157
196
|
|
|
158
197
|
export const CallToolResult = Schema.Struct({
|
|
159
198
|
content: Schema.optionalKey(Schema.Array(ContentBlock)),
|
|
160
199
|
isError: Schema.optional(Schema.Boolean),
|
|
161
|
-
structuredContent: Schema.optional(Schema.
|
|
200
|
+
structuredContent: Schema.optional(Schema.Json),
|
|
162
201
|
// Required on modern results; absent on legacy ones.
|
|
163
202
|
resultType: Schema.optional(Schema.String),
|
|
164
203
|
})
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* `meta.headers` a caller passes are HTTP-only and ignored here.
|
|
5
5
|
*/
|
|
6
6
|
import { Cause, Effect, Queue, type Scope, Stream } from "effect"
|
|
7
|
-
import { ChildProcess, ChildProcessSpawner } from "effect/
|
|
7
|
+
import { ChildProcess, ChildProcessSpawner } from "effect/process"
|
|
8
8
|
import * as JSONL from "@effect-uai/core/JSONL"
|
|
9
9
|
import { McpConnectFailed, type McpError, McpTransportClosed } from "../McpError.js"
|
|
10
10
|
import type { Transport } from "./rpc.js"
|
package/dist/auth-ZDvsxpCo.d.mts
DELETED
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import { t as McpAuthError } from "./McpError-DWg9BlW5.mjs";
|
|
2
|
-
import { Data, Effect, Option, Redacted } from "effect";
|
|
3
|
-
//#region src/internal/auth.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* An Effect yielding a bearer token. Any external OAuth, vault, or secret
|
|
6
|
-
* manager plugs in here. Read per request, so a producer minting expensive
|
|
7
|
-
* tokens caches internally (as `OAuth.clientCredentials` does).
|
|
8
|
-
*/
|
|
9
|
-
type TokenSource = Effect.Effect<Redacted.Redacted<string>, McpAuthError>;
|
|
10
|
-
type Auth = Data.TaggedEnum<{
|
|
11
|
-
/** A fixed token: the turnkey case for a token-gated server. */
|
|
12
|
-
Static: {
|
|
13
|
-
readonly token: Redacted.Redacted<string>;
|
|
14
|
-
readonly scheme?: string;
|
|
15
|
-
};
|
|
16
|
-
/** Bring your own, re-read before every request. */
|
|
17
|
-
TokenSource: {
|
|
18
|
-
readonly token: TokenSource;
|
|
19
|
-
readonly scheme?: string;
|
|
20
|
-
};
|
|
21
|
-
/** Built-in OAuth 2.1, which produces a `TokenSource` and rides the same seam. */
|
|
22
|
-
OAuth: {
|
|
23
|
-
readonly source: TokenSource;
|
|
24
|
-
readonly scheme?: string;
|
|
25
|
-
};
|
|
26
|
-
}>;
|
|
27
|
-
declare const Auth: {
|
|
28
|
-
readonly $is: <Tag extends "OAuth" | "Static" | "TokenSource">(tag: Tag) => (u: unknown) => u is Extract<{
|
|
29
|
-
readonly _tag: "OAuth";
|
|
30
|
-
readonly source: TokenSource;
|
|
31
|
-
readonly scheme?: string;
|
|
32
|
-
}, {
|
|
33
|
-
readonly _tag: Tag;
|
|
34
|
-
}> | Extract<{
|
|
35
|
-
readonly _tag: "Static";
|
|
36
|
-
readonly token: Redacted.Redacted<string>;
|
|
37
|
-
readonly scheme?: string;
|
|
38
|
-
}, {
|
|
39
|
-
readonly _tag: Tag;
|
|
40
|
-
}> | Extract<{
|
|
41
|
-
readonly _tag: "TokenSource";
|
|
42
|
-
readonly token: TokenSource;
|
|
43
|
-
readonly scheme?: string;
|
|
44
|
-
}, {
|
|
45
|
-
readonly _tag: Tag;
|
|
46
|
-
}>;
|
|
47
|
-
readonly $match: {
|
|
48
|
-
<Cases extends { readonly [Tag in "OAuth" | "Static" | "TokenSource"]: (args: Extract<{
|
|
49
|
-
readonly _tag: "OAuth";
|
|
50
|
-
readonly source: TokenSource;
|
|
51
|
-
readonly scheme?: string;
|
|
52
|
-
} | {
|
|
53
|
-
readonly _tag: "Static";
|
|
54
|
-
readonly token: Redacted.Redacted<string>;
|
|
55
|
-
readonly scheme?: string;
|
|
56
|
-
} | {
|
|
57
|
-
readonly _tag: "TokenSource";
|
|
58
|
-
readonly token: TokenSource;
|
|
59
|
-
readonly scheme?: string;
|
|
60
|
-
}, {
|
|
61
|
-
readonly _tag: Tag;
|
|
62
|
-
}>) => any; }>(cases: Cases): (value: {
|
|
63
|
-
readonly _tag: "OAuth";
|
|
64
|
-
readonly source: TokenSource;
|
|
65
|
-
readonly scheme?: string;
|
|
66
|
-
} | {
|
|
67
|
-
readonly _tag: "Static";
|
|
68
|
-
readonly token: Redacted.Redacted<string>;
|
|
69
|
-
readonly scheme?: string;
|
|
70
|
-
} | {
|
|
71
|
-
readonly _tag: "TokenSource";
|
|
72
|
-
readonly token: TokenSource;
|
|
73
|
-
readonly scheme?: string;
|
|
74
|
-
}) => import("effect/Unify").Unify<ReturnType<Cases["OAuth" | "Static" | "TokenSource"]>>;
|
|
75
|
-
<Cases extends { readonly [Tag in "OAuth" | "Static" | "TokenSource"]: (args: Extract<{
|
|
76
|
-
readonly _tag: "OAuth";
|
|
77
|
-
readonly source: TokenSource;
|
|
78
|
-
readonly scheme?: string;
|
|
79
|
-
} | {
|
|
80
|
-
readonly _tag: "Static";
|
|
81
|
-
readonly token: Redacted.Redacted<string>;
|
|
82
|
-
readonly scheme?: string;
|
|
83
|
-
} | {
|
|
84
|
-
readonly _tag: "TokenSource";
|
|
85
|
-
readonly token: TokenSource;
|
|
86
|
-
readonly scheme?: string;
|
|
87
|
-
}, {
|
|
88
|
-
readonly _tag: Tag;
|
|
89
|
-
}>) => any; }>(value: {
|
|
90
|
-
readonly _tag: "OAuth";
|
|
91
|
-
readonly source: TokenSource;
|
|
92
|
-
readonly scheme?: string;
|
|
93
|
-
} | {
|
|
94
|
-
readonly _tag: "Static";
|
|
95
|
-
readonly token: Redacted.Redacted<string>;
|
|
96
|
-
readonly scheme?: string;
|
|
97
|
-
} | {
|
|
98
|
-
readonly _tag: "TokenSource";
|
|
99
|
-
readonly token: TokenSource;
|
|
100
|
-
readonly scheme?: string;
|
|
101
|
-
}, cases: Cases): import("effect/Unify").Unify<ReturnType<Cases["OAuth" | "Static" | "TokenSource"]>>;
|
|
102
|
-
};
|
|
103
|
-
readonly OAuth: Data.TaggedEnum.ConstructorFrom<{
|
|
104
|
-
readonly _tag: "OAuth";
|
|
105
|
-
readonly source: TokenSource;
|
|
106
|
-
readonly scheme?: string;
|
|
107
|
-
}, "_tag">;
|
|
108
|
-
readonly Static: Data.TaggedEnum.ConstructorFrom<{
|
|
109
|
-
readonly _tag: "Static";
|
|
110
|
-
readonly token: Redacted.Redacted<string>;
|
|
111
|
-
readonly scheme?: string;
|
|
112
|
-
}, "_tag">;
|
|
113
|
-
readonly TokenSource: Data.TaggedEnum.ConstructorFrom<{
|
|
114
|
-
readonly _tag: "TokenSource";
|
|
115
|
-
readonly token: TokenSource;
|
|
116
|
-
readonly scheme?: string;
|
|
117
|
-
}, "_tag">;
|
|
118
|
-
};
|
|
119
|
-
/**
|
|
120
|
-
* The `Authorization` header for one request, or none for a public server.
|
|
121
|
-
* `Redacted.value` is unwrapped only here.
|
|
122
|
-
*/
|
|
123
|
-
declare const authHeaders: (auth: Option.Option<Auth>) => Effect.Effect<Record<string, string>, McpAuthError>;
|
|
124
|
-
//#endregion
|
|
125
|
-
export { TokenSource as n, authHeaders as r, Auth as t };
|
|
126
|
-
//# sourceMappingURL=auth-ZDvsxpCo.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"auth-ZDvsxpCo.d.mts","names":[],"sources":["../src/internal/auth.ts"],"mappings":";;;;;;;;KA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