@workglow/util 0.0.117 → 0.0.119

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.
@@ -11,11 +11,13 @@ export type JsonSchemaCustomProps = {
11
11
  "x-ui-order"?: number;
12
12
  "x-ui-priority"?: number;
13
13
  "x-ui-viewer"?: string;
14
+ "x-ui-type-override"?: boolean;
14
15
  "x-ui-editor"?: string;
15
16
  "x-ui-group"?: string;
16
17
  "x-ui-group-order"?: number;
17
18
  "x-ui-group-priority"?: number;
18
19
  "x-ui-group-open"?: boolean;
20
+ "x-ui-enum-labels"?: Record<string, string>;
19
21
  "x-ui-manual"?: boolean;
20
22
  "x-ui"?: unknown;
21
23
  "x-ui-iteration"?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"JsonSchema.d.ts","sourceRoot":"","sources":["../../src/json-schema/JsonSchema.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAE3F,MAAM,MAAM,qBAAqB,GAAG;IAClC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,eAAe,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACnC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,kBAAk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CAAC;CACjC,CAAC;AAEF,MAAM,MAAM,UAAU,CAAC,SAAS,SAAS,mBAAmB,GAAG,qBAAqB,IAClF,kBAAkB,CAAC,SAAS,CAAC,CAAC"}
@@ -5,7 +5,10 @@
5
5
  *
6
6
  * MCP OAuth provider adapter backed by ICredentialStore, and factory function.
7
7
  */
8
+ import { UnauthorizedError } from "@modelcontextprotocol/sdk/client/auth.js";
8
9
  import type { AddClientAuthentication, OAuthClientProvider, OAuthDiscoveryState } from "@modelcontextprotocol/sdk/client/auth.js";
10
+ export { UnauthorizedError };
11
+ export type { OAuthClientProvider };
9
12
  import type { OAuthClientInformationMixed, OAuthClientMetadata, OAuthTokens } from "@modelcontextprotocol/sdk/shared/auth.js";
10
13
  import type { ICredentialStore } from "../credentials/ICredentialStore";
11
14
  import type { McpAuthConfig } from "./McpAuthTypes";
@@ -1 +1 @@
1
- {"version":3,"file":"McpAuthProvider.d.ts","sourceRoot":"","sources":["../../src/mcp/McpAuthProvider.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAQH,OAAO,KAAK,EACV,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EACV,2BAA2B,EAC3B,mBAAmB,EACnB,WAAW,EACZ,MAAM,0CAA0C,CAAC;AAElD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAoBpD;;;;;;GAMG;AACH,qBAAa,4BAA6B,YAAW,mBAAmB;IACtE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAmB;IACzC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAsB;IACtD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAA2B;IACxD,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAA0C;IAE7E,sEAAsE;IACtE,m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0BjB;AAID;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,aAAa,EACnB,SAAS,EAAE,MAAM,EACjB,eAAe,CAAC,EAAE,gBAAgB,GACjC,mBAAmB,GAAG,SAAS,CAuJjC;AAID;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,aAAa,EACnB,eAAe,CAAC,EAAE,gBAAgB,GACjC,OAAO,CAAC,aAAa,CAAC,CA6CxB"}
@@ -53,69 +53,161 @@ export interface McpAuthAuthorizationCode {
53
53
  }
54
54
  export type McpAuthConfig = McpAuthNone | McpAuthBearer | McpAuthClientCredentials | McpAuthPrivateKeyJwt | McpAuthStaticPrivateKeyJwt | McpAuthAuthorizationCode;
55
55
  export declare const mcpAuthConfigSchema: {
56
- readonly auth_type: {
57
- readonly type: "string";
58
- readonly enum: readonly ["none", "bearer", "client_credentials", "private_key_jwt", "static_private_key_jwt", "authorization_code"];
59
- readonly title: "Auth Type";
60
- readonly description: "Authentication method for connecting to the MCP server";
61
- readonly default: "none";
62
- };
63
- readonly auth_token: {
64
- readonly type: "string";
65
- readonly format: "credential";
66
- readonly title: "Bearer Token";
67
- readonly description: "Static bearer token or API key (for bearer auth)";
68
- };
69
- readonly auth_client_id: {
70
- readonly type: "string";
71
- readonly title: "Client ID";
72
- readonly description: "OAuth client ID (for OAuth auth types)";
73
- };
74
- readonly auth_client_secret: {
75
- readonly type: "string";
76
- readonly format: "credential";
77
- readonly title: "Client Secret";
78
- readonly description: "OAuth client secret (for client_credentials auth)";
79
- };
80
- readonly auth_private_key: {
81
- readonly type: "string";
82
- readonly format: "credential";
83
- readonly title: "Private Key";
84
- readonly description: "PEM or JWK private key (for private_key_jwt auth)";
85
- };
86
- readonly auth_algorithm: {
87
- readonly type: "string";
88
- readonly title: "Algorithm";
89
- readonly description: "JWT signing algorithm, e.g. RS256, ES256 (for private_key_jwt auth)";
90
- };
91
- readonly auth_jwt_bearer_assertion: {
92
- readonly type: "string";
93
- readonly format: "credential";
94
- readonly title: "JWT Assertion";
95
- readonly description: "Pre-built JWT assertion (for static_private_key_jwt auth)";
96
- };
97
- readonly auth_redirect_url: {
98
- readonly type: "string";
99
- readonly format: "uri";
100
- readonly title: "Redirect URL";
101
- readonly description: "OAuth redirect URL (for authorization_code auth)";
102
- };
103
- readonly auth_scope: {
104
- readonly type: "string";
105
- readonly title: "Scope";
106
- readonly description: "OAuth scope (space-separated)";
107
- };
108
- readonly auth_client_name: {
109
- readonly type: "string";
110
- readonly title: "Client Name";
111
- readonly description: "Optional OAuth client display name";
112
- };
113
- readonly auth_jwt_lifetime_seconds: {
114
- readonly type: "number";
115
- readonly title: "JWT Lifetime";
116
- readonly description: "JWT lifetime in seconds (default: 300)";
117
- readonly minimum: 1;
56
+ readonly properties: {
57
+ readonly auth_type: {
58
+ readonly type: "string";
59
+ readonly enum: readonly ["none", "bearer", "client_credentials", "private_key_jwt", "static_private_key_jwt", "authorization_code"];
60
+ readonly title: "Auth Type";
61
+ readonly description: "Authentication method for connecting to the MCP server";
62
+ readonly default: "none";
63
+ };
64
+ readonly auth_token: {
65
+ readonly type: "string";
66
+ readonly format: "credential";
67
+ readonly title: "Bearer Token";
68
+ readonly description: "Static bearer token or API key (for bearer auth)";
69
+ };
70
+ readonly auth_client_id: {
71
+ readonly type: "string";
72
+ readonly title: "Client ID";
73
+ readonly description: "OAuth client ID (for OAuth auth types)";
74
+ };
75
+ readonly auth_client_secret: {
76
+ readonly type: "string";
77
+ readonly format: "credential";
78
+ readonly title: "Client Secret";
79
+ readonly description: "OAuth client secret (for client_credentials auth)";
80
+ };
81
+ readonly auth_private_key: {
82
+ readonly type: "string";
83
+ readonly format: "credential";
84
+ readonly title: "Private Key";
85
+ readonly description: "PEM or JWK private key (for private_key_jwt auth)";
86
+ };
87
+ readonly auth_algorithm: {
88
+ readonly type: "string";
89
+ readonly title: "Algorithm";
90
+ readonly description: "JWT signing algorithm, e.g. RS256, ES256 (for private_key_jwt auth)";
91
+ };
92
+ readonly auth_jwt_bearer_assertion: {
93
+ readonly type: "string";
94
+ readonly format: "credential";
95
+ readonly title: "JWT Assertion";
96
+ readonly description: "Pre-built JWT assertion (for static_private_key_jwt auth)";
97
+ };
98
+ readonly auth_redirect_url: {
99
+ readonly type: "string";
100
+ readonly format: "uri";
101
+ readonly title: "Redirect URL";
102
+ readonly description: "OAuth redirect URL (for authorization_code auth)";
103
+ };
104
+ readonly auth_scope: {
105
+ readonly type: "string";
106
+ readonly title: "Scope";
107
+ readonly description: "OAuth scope (space-separated)";
108
+ };
109
+ readonly auth_client_name: {
110
+ readonly type: "string";
111
+ readonly title: "Client Name";
112
+ readonly description: "Optional OAuth client display name";
113
+ };
114
+ readonly auth_jwt_lifetime_seconds: {
115
+ readonly type: "number";
116
+ readonly title: "JWT Lifetime";
117
+ readonly description: "JWT lifetime in seconds (default: 300)";
118
+ readonly minimum: 1;
119
+ };
118
120
  };
121
+ readonly allOf: readonly [{
122
+ readonly if: {
123
+ readonly properties: {
124
+ readonly auth_type: {
125
+ readonly const: "bearer";
126
+ };
127
+ };
128
+ readonly required: readonly ["auth_type"];
129
+ };
130
+ readonly then: {
131
+ readonly required: readonly ["auth_token"];
132
+ readonly properties: {
133
+ readonly auth_token: true;
134
+ };
135
+ };
136
+ }, {
137
+ readonly if: {
138
+ readonly properties: {
139
+ readonly auth_type: {
140
+ readonly const: "client_credentials";
141
+ };
142
+ };
143
+ readonly required: readonly ["auth_type"];
144
+ };
145
+ readonly then: {
146
+ readonly required: readonly ["auth_client_id", "auth_client_secret"];
147
+ readonly properties: {
148
+ readonly auth_client_id: true;
149
+ readonly auth_client_secret: true;
150
+ readonly auth_client_name: true;
151
+ readonly auth_scope: true;
152
+ };
153
+ };
154
+ }, {
155
+ readonly if: {
156
+ readonly properties: {
157
+ readonly auth_type: {
158
+ readonly const: "private_key_jwt";
159
+ };
160
+ };
161
+ readonly required: readonly ["auth_type"];
162
+ };
163
+ readonly then: {
164
+ readonly required: readonly ["auth_client_id", "auth_private_key", "auth_algorithm"];
165
+ readonly properties: {
166
+ readonly auth_client_id: true;
167
+ readonly auth_private_key: true;
168
+ readonly auth_algorithm: true;
169
+ readonly auth_client_name: true;
170
+ readonly auth_jwt_lifetime_seconds: true;
171
+ readonly auth_scope: true;
172
+ };
173
+ };
174
+ }, {
175
+ readonly if: {
176
+ readonly properties: {
177
+ readonly auth_type: {
178
+ readonly const: "static_private_key_jwt";
179
+ };
180
+ };
181
+ readonly required: readonly ["auth_type"];
182
+ };
183
+ readonly then: {
184
+ readonly required: readonly ["auth_client_id", "auth_jwt_bearer_assertion"];
185
+ readonly properties: {
186
+ readonly auth_client_id: true;
187
+ readonly auth_jwt_bearer_assertion: true;
188
+ readonly auth_client_name: true;
189
+ readonly auth_scope: true;
190
+ };
191
+ };
192
+ }, {
193
+ readonly if: {
194
+ readonly properties: {
195
+ readonly auth_type: {
196
+ readonly const: "authorization_code";
197
+ };
198
+ };
199
+ readonly required: readonly ["auth_type"];
200
+ };
201
+ readonly then: {
202
+ readonly required: readonly ["auth_client_id", "auth_redirect_url"];
203
+ readonly properties: {
204
+ readonly auth_client_id: true;
205
+ readonly auth_client_secret: true;
206
+ readonly auth_redirect_url: true;
207
+ readonly auth_scope: true;
208
+ };
209
+ };
210
+ }];
119
211
  };
120
212
  /**
121
213
  * Constructs a typed McpAuthConfig from flat schema properties.
@@ -1 +1 @@
1
- {"version":3,"file":"McpAuthTypes.d.ts","sourceRoot":"","sources":["../../src/mcp/McpAuthTypes.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;GAEG;AACH,eAAO,MAAM,YAAY,sHAOf,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAIxD,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;I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AAG,aAAa,GAAG,SAAS,CAqExF"}
@@ -9,83 +9,176 @@
9
9
  import { Client } from "@modelcontextprotocol/sdk/client";
10
10
  import type { Transport } from "@modelcontextprotocol/sdk/shared/transport.js";
11
11
  import type { McpAuthConfig } from "./McpAuthTypes";
12
+ import type { OAuthClientProvider } from "@modelcontextprotocol/sdk/client/auth.js";
12
13
  export declare const mcpTransportTypes: readonly ["streamable-http", "sse"];
13
14
  export declare const mcpServerConfigSchema: {
14
- readonly auth_type: {
15
- readonly type: "string";
16
- readonly enum: readonly ["none", "bearer", "client_credentials", "private_key_jwt", "static_private_key_jwt", "authorization_code"];
17
- readonly title: "Auth Type";
18
- readonly description: "Authentication method for connecting to the MCP server";
19
- readonly default: "none";
20
- };
21
- readonly auth_token: {
22
- readonly type: "string";
23
- readonly format: "credential";
24
- readonly title: "Bearer Token";
25
- readonly description: "Static bearer token or API key (for bearer auth)";
26
- };
27
- readonly auth_client_id: {
28
- readonly type: "string";
29
- readonly title: "Client ID";
30
- readonly description: "OAuth client ID (for OAuth auth types)";
31
- };
32
- readonly auth_client_secret: {
33
- readonly type: "string";
34
- readonly format: "credential";
35
- readonly title: "Client Secret";
36
- readonly description: "OAuth client secret (for client_credentials auth)";
37
- };
38
- readonly auth_private_key: {
39
- readonly type: "string";
40
- readonly format: "credential";
41
- readonly title: "Private Key";
42
- readonly description: "PEM or JWK private key (for private_key_jwt auth)";
43
- };
44
- readonly auth_algorithm: {
45
- readonly type: "string";
46
- readonly title: "Algorithm";
47
- readonly description: "JWT signing algorithm, e.g. RS256, ES256 (for private_key_jwt auth)";
48
- };
49
- readonly auth_jwt_bearer_assertion: {
50
- readonly type: "string";
51
- readonly format: "credential";
52
- readonly title: "JWT Assertion";
53
- readonly description: "Pre-built JWT assertion (for static_private_key_jwt auth)";
54
- };
55
- readonly auth_redirect_url: {
56
- readonly type: "string";
57
- readonly format: "uri";
58
- readonly title: "Redirect URL";
59
- readonly description: "OAuth redirect URL (for authorization_code auth)";
60
- };
61
- readonly auth_scope: {
62
- readonly type: "string";
63
- readonly title: "Scope";
64
- readonly description: "OAuth scope (space-separated)";
65
- };
66
- readonly auth_client_name: {
67
- readonly type: "string";
68
- readonly title: "Client Name";
69
- readonly description: "Optional OAuth client display name";
70
- };
71
- readonly auth_jwt_lifetime_seconds: {
72
- readonly type: "number";
73
- readonly title: "JWT Lifetime";
74
- readonly description: "JWT lifetime in seconds (default: 300)";
75
- readonly minimum: 1;
76
- };
77
- readonly transport: {
78
- readonly type: "string";
79
- readonly enum: readonly ["streamable-http", "sse"];
80
- readonly title: "Transport";
81
- readonly description: "The transport type to use for connecting to the MCP server";
82
- };
83
- readonly server_url: {
84
- readonly type: "string";
85
- readonly format: "uri";
86
- readonly title: "Server URL";
87
- readonly description: "The URL of the MCP server (for streamable-http transport)";
15
+ readonly properties: {
16
+ readonly auth_type: {
17
+ readonly type: "string";
18
+ readonly enum: readonly ["none", "bearer", "client_credentials", "private_key_jwt", "static_private_key_jwt", "authorization_code"];
19
+ readonly title: "Auth Type";
20
+ readonly description: "Authentication method for connecting to the MCP server";
21
+ readonly default: "none";
22
+ };
23
+ readonly auth_token: {
24
+ readonly type: "string";
25
+ readonly format: "credential";
26
+ readonly title: "Bearer Token";
27
+ readonly description: "Static bearer token or API key (for bearer auth)";
28
+ };
29
+ readonly auth_client_id: {
30
+ readonly type: "string";
31
+ readonly title: "Client ID";
32
+ readonly description: "OAuth client ID (for OAuth auth types)";
33
+ };
34
+ readonly auth_client_secret: {
35
+ readonly type: "string";
36
+ readonly format: "credential";
37
+ readonly title: "Client Secret";
38
+ readonly description: "OAuth client secret (for client_credentials auth)";
39
+ };
40
+ readonly auth_private_key: {
41
+ readonly type: "string";
42
+ readonly format: "credential";
43
+ readonly title: "Private Key";
44
+ readonly description: "PEM or JWK private key (for private_key_jwt auth)";
45
+ };
46
+ readonly auth_algorithm: {
47
+ readonly type: "string";
48
+ readonly title: "Algorithm";
49
+ readonly description: "JWT signing algorithm, e.g. RS256, ES256 (for private_key_jwt auth)";
50
+ };
51
+ readonly auth_jwt_bearer_assertion: {
52
+ readonly type: "string";
53
+ readonly format: "credential";
54
+ readonly title: "JWT Assertion";
55
+ readonly description: "Pre-built JWT assertion (for static_private_key_jwt auth)";
56
+ };
57
+ readonly auth_redirect_url: {
58
+ readonly type: "string";
59
+ readonly format: "uri";
60
+ readonly title: "Redirect URL";
61
+ readonly description: "OAuth redirect URL (for authorization_code auth)";
62
+ };
63
+ readonly auth_scope: {
64
+ readonly type: "string";
65
+ readonly title: "Scope";
66
+ readonly description: "OAuth scope (space-separated)";
67
+ };
68
+ readonly auth_client_name: {
69
+ readonly type: "string";
70
+ readonly title: "Client Name";
71
+ readonly description: "Optional OAuth client display name";
72
+ };
73
+ readonly auth_jwt_lifetime_seconds: {
74
+ readonly type: "number";
75
+ readonly title: "JWT Lifetime";
76
+ readonly description: "JWT lifetime in seconds (default: 300)";
77
+ readonly minimum: 1;
78
+ };
79
+ readonly transport: {
80
+ readonly type: "string";
81
+ readonly enum: readonly ["streamable-http", "sse"];
82
+ readonly title: "Transport";
83
+ readonly description: "The transport type to use for connecting to the MCP server";
84
+ };
85
+ readonly server_url: {
86
+ readonly type: "string";
87
+ readonly format: "uri";
88
+ readonly title: "Server URL";
89
+ readonly description: "The URL of the MCP server (for streamable-http transport)";
90
+ };
88
91
  };
92
+ readonly allOf: readonly [{
93
+ readonly if: {
94
+ readonly properties: {
95
+ readonly auth_type: {
96
+ readonly const: "bearer";
97
+ };
98
+ };
99
+ readonly required: readonly ["auth_type"];
100
+ };
101
+ readonly then: {
102
+ readonly required: readonly ["auth_token"];
103
+ readonly properties: {
104
+ readonly auth_token: true;
105
+ };
106
+ };
107
+ }, {
108
+ readonly if: {
109
+ readonly properties: {
110
+ readonly auth_type: {
111
+ readonly const: "client_credentials";
112
+ };
113
+ };
114
+ readonly required: readonly ["auth_type"];
115
+ };
116
+ readonly then: {
117
+ readonly required: readonly ["auth_client_id", "auth_client_secret"];
118
+ readonly properties: {
119
+ readonly auth_client_id: true;
120
+ readonly auth_client_secret: true;
121
+ readonly auth_client_name: true;
122
+ readonly auth_scope: true;
123
+ };
124
+ };
125
+ }, {
126
+ readonly if: {
127
+ readonly properties: {
128
+ readonly auth_type: {
129
+ readonly const: "private_key_jwt";
130
+ };
131
+ };
132
+ readonly required: readonly ["auth_type"];
133
+ };
134
+ readonly then: {
135
+ readonly required: readonly ["auth_client_id", "auth_private_key", "auth_algorithm"];
136
+ readonly properties: {
137
+ readonly auth_client_id: true;
138
+ readonly auth_private_key: true;
139
+ readonly auth_algorithm: true;
140
+ readonly auth_client_name: true;
141
+ readonly auth_jwt_lifetime_seconds: true;
142
+ readonly auth_scope: true;
143
+ };
144
+ };
145
+ }, {
146
+ readonly if: {
147
+ readonly properties: {
148
+ readonly auth_type: {
149
+ readonly const: "static_private_key_jwt";
150
+ };
151
+ };
152
+ readonly required: readonly ["auth_type"];
153
+ };
154
+ readonly then: {
155
+ readonly required: readonly ["auth_client_id", "auth_jwt_bearer_assertion"];
156
+ readonly properties: {
157
+ readonly auth_client_id: true;
158
+ readonly auth_jwt_bearer_assertion: true;
159
+ readonly auth_client_name: true;
160
+ readonly auth_scope: true;
161
+ };
162
+ };
163
+ }, {
164
+ readonly if: {
165
+ readonly properties: {
166
+ readonly auth_type: {
167
+ readonly const: "authorization_code";
168
+ };
169
+ };
170
+ readonly required: readonly ["auth_type"];
171
+ };
172
+ readonly then: {
173
+ readonly required: readonly ["auth_client_id", "auth_redirect_url"];
174
+ readonly properties: {
175
+ readonly auth_client_id: true;
176
+ readonly auth_client_secret: true;
177
+ readonly auth_redirect_url: true;
178
+ readonly auth_scope: true;
179
+ };
180
+ };
181
+ }];
89
182
  };
90
183
  export type McpTransportType = (typeof mcpTransportTypes)[number];
91
184
  export interface McpServerConfig {
@@ -93,6 +186,7 @@ export interface McpServerConfig {
93
186
  server_url?: string;
94
187
  auth?: McpAuthConfig;
95
188
  auth_type?: string;
189
+ authProvider?: OAuthClientProvider;
96
190
  }
97
191
  export declare function createMcpClient(config: McpServerConfig, signal?: AbortSignal): Promise<{
98
192
  client: Client;
@@ -1 +1 @@
1
- {"version":3,"file":"McpClientUtil.browser.d.ts","sourceRoot":"","sources":["../../src/mcp/McpClientUtil.browser.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAG1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+CAA+C,CAAC;AAK/E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD,eAAO,MAAM,iBAAiB,qCAAsC,CAAC;AAErE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAcqB,CAAC;AAExD,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,gBAAgB,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,aAAa,CAAC;IAErB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAsB,eAAe,CACnC,MAAM,EAAE,eAAe,EACvB,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,SAAS,CAAA;CAAE,CAAC,CA0FnD;AAED,eAAO,MAAM,gBAAgB;;CAE5B,CAAC"}
1
+ {"version":3,"file":"McpClientUtil.browser.d.ts","sourceRoot":"","sources":["../../src/mcp/McpClientUtil.browser.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,kCAAkC,CAAC;AAG1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+CAA+C,CAAC;AAI/E,OAAO,K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