mcp-use 1.2.2 → 1.2.3-canary.1
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/.tsbuildinfo +1 -1
- package/dist/{chunk-3RJENWH4.js → chunk-34R6SIER.js} +62 -30
- package/dist/{chunk-RSGKBEHH.js → chunk-37MPZ3D6.js} +2 -2
- package/dist/chunk-3GQAWCBQ.js +13 -0
- package/dist/{chunk-7UX634PO.js → chunk-73SH52J2.js} +5 -63
- package/dist/chunk-EW4MJSHA.js +64 -0
- package/dist/{chunk-KLIBVJ3Z.js → chunk-X2HJQBDI.js} +2 -2
- package/dist/{chunk-MZLETWQQ.js → chunk-YURRUCIM.js} +2 -2
- package/dist/index.cjs +61 -30
- package/dist/index.js +12 -10
- package/dist/{langfuse-LCJ6VJEP.js → langfuse-C4HKZ3NL.js} +3 -3
- package/dist/src/agents/index.cjs +3189 -0
- package/dist/src/agents/index.js +28 -0
- package/dist/src/browser.cjs +61 -30
- package/dist/src/browser.js +11 -9
- package/dist/src/logging.d.ts.map +1 -1
- package/dist/src/react/index.cjs +60 -29
- package/dist/src/react/index.js +4 -4
- package/dist/src/server/index.js +1 -1
- package/dist/tsup.config.d.ts.map +1 -1
- package/package.json +7 -3
- package/dist/chunk-SHUYVCID.js +0 -6
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MCPAgent,
|
|
3
|
+
RemoteAgent
|
|
4
|
+
} from "../../chunk-73SH52J2.js";
|
|
5
|
+
import "../../chunk-YURRUCIM.js";
|
|
6
|
+
import "../../chunk-34R6SIER.js";
|
|
7
|
+
import {
|
|
8
|
+
__name
|
|
9
|
+
} from "../../chunk-3GQAWCBQ.js";
|
|
10
|
+
|
|
11
|
+
// src/agents/base.ts
|
|
12
|
+
var BaseAgent = class {
|
|
13
|
+
static {
|
|
14
|
+
__name(this, "BaseAgent");
|
|
15
|
+
}
|
|
16
|
+
session;
|
|
17
|
+
/**
|
|
18
|
+
* @param session MCP session used for tool invocation
|
|
19
|
+
*/
|
|
20
|
+
constructor(session) {
|
|
21
|
+
this.session = session;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
export {
|
|
25
|
+
BaseAgent,
|
|
26
|
+
MCPAgent,
|
|
27
|
+
RemoteAgent
|
|
28
|
+
};
|
package/dist/src/browser.cjs
CHANGED
|
@@ -44,6 +44,20 @@ async function getNodeModules() {
|
|
|
44
44
|
}
|
|
45
45
|
return { fs: null, path: null };
|
|
46
46
|
}
|
|
47
|
+
function loadWinstonSync() {
|
|
48
|
+
if (typeof require !== "undefined") {
|
|
49
|
+
try {
|
|
50
|
+
winston = require("winston");
|
|
51
|
+
} catch {
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
async function getWinston() {
|
|
56
|
+
if (!winston) {
|
|
57
|
+
winston = await import("winston");
|
|
58
|
+
}
|
|
59
|
+
return winston;
|
|
60
|
+
}
|
|
47
61
|
function isNodeJSEnvironment() {
|
|
48
62
|
try {
|
|
49
63
|
if (typeof navigator !== "undefined" && navigator.userAgent?.includes("Cloudflare-Workers")) {
|
|
@@ -53,8 +67,7 @@ function isNodeJSEnvironment() {
|
|
|
53
67
|
return false;
|
|
54
68
|
}
|
|
55
69
|
const hasNodeGlobals = typeof process !== "undefined" && typeof process.platform !== "undefined" && typeof __dirname !== "undefined";
|
|
56
|
-
|
|
57
|
-
return hasNodeGlobals && hasNodeModules;
|
|
70
|
+
return hasNodeGlobals;
|
|
58
71
|
} catch {
|
|
59
72
|
return false;
|
|
60
73
|
}
|
|
@@ -70,13 +83,14 @@ function resolveLevel(env) {
|
|
|
70
83
|
return "info";
|
|
71
84
|
}
|
|
72
85
|
}
|
|
73
|
-
var
|
|
86
|
+
var winston, DEFAULT_LOGGER_NAME, SimpleConsoleLogger, Logger, logger;
|
|
74
87
|
var init_logging = __esm({
|
|
75
88
|
"src/logging.ts"() {
|
|
76
89
|
"use strict";
|
|
77
|
-
import_winston = require("winston");
|
|
78
90
|
__name(getNodeModules, "getNodeModules");
|
|
79
|
-
|
|
91
|
+
winston = null;
|
|
92
|
+
__name(loadWinstonSync, "loadWinstonSync");
|
|
93
|
+
__name(getWinston, "getWinston");
|
|
80
94
|
DEFAULT_LOGGER_NAME = "mcp-use";
|
|
81
95
|
__name(isNodeJSEnvironment, "isNodeJSEnvironment");
|
|
82
96
|
SimpleConsoleLogger = class {
|
|
@@ -104,8 +118,8 @@ var init_logging = __esm({
|
|
|
104
118
|
return messageIndex <= currentIndex;
|
|
105
119
|
}
|
|
106
120
|
formatMessage(level, message) {
|
|
107
|
-
const
|
|
108
|
-
return `${
|
|
121
|
+
const timestamp = (/* @__PURE__ */ new Date()).toLocaleTimeString("en-US", { hour12: false });
|
|
122
|
+
return `${timestamp} [${this.name}] ${level}: ${message}`;
|
|
109
123
|
}
|
|
110
124
|
error(message) {
|
|
111
125
|
if (this.shouldLog("error")) {
|
|
@@ -151,15 +165,6 @@ var init_logging = __esm({
|
|
|
151
165
|
}
|
|
152
166
|
};
|
|
153
167
|
__name(resolveLevel, "resolveLevel");
|
|
154
|
-
minimalFormatter = printf(({ level, message, label: label2, timestamp: timestamp2 }) => {
|
|
155
|
-
return `${timestamp2} [${label2}] ${level}: ${message}`;
|
|
156
|
-
});
|
|
157
|
-
detailedFormatter = printf(({ level, message, label: label2, timestamp: timestamp2 }) => {
|
|
158
|
-
return `${timestamp2} [${label2}] ${level.toUpperCase()}: ${message}`;
|
|
159
|
-
});
|
|
160
|
-
emojiFormatter = printf(({ level, message, label: label2, timestamp: timestamp2 }) => {
|
|
161
|
-
return `${timestamp2} [${label2}] ${level.toUpperCase()}: ${message}`;
|
|
162
|
-
});
|
|
163
168
|
Logger = class {
|
|
164
169
|
static {
|
|
165
170
|
__name(this, "Logger");
|
|
@@ -179,7 +184,12 @@ var init_logging = __esm({
|
|
|
179
184
|
return this.simpleInstances[name];
|
|
180
185
|
}
|
|
181
186
|
if (!this.instances[name]) {
|
|
182
|
-
|
|
187
|
+
if (!winston) {
|
|
188
|
+
throw new Error("Winston not loaded - call Logger.configure() first");
|
|
189
|
+
}
|
|
190
|
+
const { createLogger, format } = winston;
|
|
191
|
+
const { combine, timestamp, label, colorize, splat } = format;
|
|
192
|
+
this.instances[name] = createLogger({
|
|
183
193
|
level: resolveLevel(process.env.DEBUG),
|
|
184
194
|
format: combine(
|
|
185
195
|
colorize(),
|
|
@@ -194,6 +204,20 @@ var init_logging = __esm({
|
|
|
194
204
|
return this.instances[name];
|
|
195
205
|
}
|
|
196
206
|
static getFormatter() {
|
|
207
|
+
if (!winston) {
|
|
208
|
+
throw new Error("Winston not loaded");
|
|
209
|
+
}
|
|
210
|
+
const { format } = winston;
|
|
211
|
+
const { printf } = format;
|
|
212
|
+
const minimalFormatter = printf(({ level, message, label, timestamp }) => {
|
|
213
|
+
return `${timestamp} [${label}] ${level}: ${message}`;
|
|
214
|
+
});
|
|
215
|
+
const detailedFormatter = printf(({ level, message, label, timestamp }) => {
|
|
216
|
+
return `${timestamp} [${label}] ${level.toUpperCase()}: ${message}`;
|
|
217
|
+
});
|
|
218
|
+
const emojiFormatter = printf(({ level, message, label, timestamp }) => {
|
|
219
|
+
return `${timestamp} [${label}] ${level.toUpperCase()}: ${message}`;
|
|
220
|
+
});
|
|
197
221
|
switch (this.currentFormat) {
|
|
198
222
|
case "minimal":
|
|
199
223
|
return minimalFormatter;
|
|
@@ -206,22 +230,26 @@ var init_logging = __esm({
|
|
|
206
230
|
}
|
|
207
231
|
}
|
|
208
232
|
static async configure(options = {}) {
|
|
209
|
-
const { level, console: console2 = true, file, format
|
|
233
|
+
const { level, console: console2 = true, file, format = "minimal" } = options;
|
|
210
234
|
const debugEnv = typeof process !== "undefined" && process.env?.DEBUG || void 0;
|
|
211
235
|
const resolvedLevel = level ?? resolveLevel(debugEnv);
|
|
212
|
-
this.currentFormat =
|
|
213
|
-
const root = this.get();
|
|
214
|
-
root.level = resolvedLevel;
|
|
215
|
-
const winstonRoot = root;
|
|
236
|
+
this.currentFormat = format;
|
|
216
237
|
if (!isNodeJSEnvironment()) {
|
|
217
238
|
Object.values(this.simpleInstances).forEach((logger2) => {
|
|
218
239
|
logger2.level = resolvedLevel;
|
|
219
240
|
});
|
|
220
241
|
return;
|
|
221
242
|
}
|
|
243
|
+
await getWinston();
|
|
244
|
+
if (!winston) {
|
|
245
|
+
throw new Error("Failed to load winston");
|
|
246
|
+
}
|
|
247
|
+
const root = this.get();
|
|
248
|
+
root.level = resolvedLevel;
|
|
249
|
+
const winstonRoot = root;
|
|
222
250
|
winstonRoot.clear();
|
|
223
251
|
if (console2) {
|
|
224
|
-
winstonRoot.add(new
|
|
252
|
+
winstonRoot.add(new winston.transports.Console());
|
|
225
253
|
}
|
|
226
254
|
if (file) {
|
|
227
255
|
const { fs: nodeFs, path: nodePath } = await getNodeModules();
|
|
@@ -230,9 +258,11 @@ var init_logging = __esm({
|
|
|
230
258
|
if (!nodeFs.existsSync(dir)) {
|
|
231
259
|
nodeFs.mkdirSync(dir, { recursive: true });
|
|
232
260
|
}
|
|
233
|
-
winstonRoot.add(new
|
|
261
|
+
winstonRoot.add(new winston.transports.File({ filename: file }));
|
|
234
262
|
}
|
|
235
263
|
}
|
|
264
|
+
const { format: winstonFormat } = winston;
|
|
265
|
+
const { combine, timestamp, label, colorize, splat } = winstonFormat;
|
|
236
266
|
Object.values(this.instances).forEach((logger2) => {
|
|
237
267
|
if (logger2 && "format" in logger2) {
|
|
238
268
|
logger2.level = resolvedLevel;
|
|
@@ -263,15 +293,16 @@ var init_logging = __esm({
|
|
|
263
293
|
process.env.DEBUG = enabled ? enabled === true ? "2" : String(enabled) : "0";
|
|
264
294
|
}
|
|
265
295
|
}
|
|
266
|
-
static setFormat(
|
|
267
|
-
this.currentFormat =
|
|
268
|
-
this.configure({ format
|
|
296
|
+
static setFormat(format) {
|
|
297
|
+
this.currentFormat = format;
|
|
298
|
+
this.configure({ format });
|
|
269
299
|
}
|
|
270
300
|
};
|
|
271
301
|
if (isNodeJSEnvironment()) {
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
302
|
+
loadWinstonSync();
|
|
303
|
+
if (winston) {
|
|
304
|
+
Logger.configure();
|
|
305
|
+
}
|
|
275
306
|
}
|
|
276
307
|
logger = Logger.get();
|
|
277
308
|
}
|
package/dist/src/browser.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createReadableStreamFromGenerator,
|
|
3
|
+
streamEventsToAISDK,
|
|
4
|
+
streamEventsToAISDKWithTools
|
|
5
|
+
} from "../chunk-EW4MJSHA.js";
|
|
1
6
|
import {
|
|
2
7
|
BaseAdapter,
|
|
3
8
|
LangChainAdapter,
|
|
4
9
|
MCPAgent,
|
|
5
10
|
ObservabilityManager,
|
|
6
|
-
RemoteAgent
|
|
7
|
-
|
|
8
|
-
streamEventsToAISDK,
|
|
9
|
-
streamEventsToAISDKWithTools
|
|
10
|
-
} from "../chunk-7UX634PO.js";
|
|
11
|
+
RemoteAgent
|
|
12
|
+
} from "../chunk-73SH52J2.js";
|
|
11
13
|
import {
|
|
12
14
|
BaseConnector,
|
|
13
15
|
BrowserMCPClient,
|
|
@@ -16,13 +18,13 @@ import {
|
|
|
16
18
|
MCPSession,
|
|
17
19
|
WebSocketConnector,
|
|
18
20
|
onMcpAuthorization
|
|
19
|
-
} from "../chunk-
|
|
20
|
-
import "../chunk-
|
|
21
|
+
} from "../chunk-37MPZ3D6.js";
|
|
22
|
+
import "../chunk-YURRUCIM.js";
|
|
21
23
|
import {
|
|
22
24
|
Logger,
|
|
23
25
|
logger
|
|
24
|
-
} from "../chunk-
|
|
25
|
-
import "../chunk-
|
|
26
|
+
} from "../chunk-34R6SIER.js";
|
|
27
|
+
import "../chunk-3GQAWCBQ.js";
|
|
26
28
|
|
|
27
29
|
// src/browser.ts
|
|
28
30
|
import {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../../src/logging.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../../src/logging.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,SAAS,CAAC;AAwCvD,MAAM,MAAM,QAAQ,GAChB,OAAO,GACP,MAAM,GACN,MAAM,GACN,MAAM,GACN,SAAS,GACT,OAAO,GACP,OAAO,CAAC;AAEZ,UAAU,aAAa;IACrB,KAAK,CAAC,EAAE,QAAQ,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,OAAO,CAAC;CAC3C;AAoCD,cAAM,mBAAmB;IACvB,OAAO,CAAC,MAAM,CAAW;IACzB,OAAO,CAAC,IAAI,CAAS;gBAET,IAAI,GAAE,MAA4B,EAAE,KAAK,GAAE,QAAiB;IAKxE,OAAO,CAAC,SAAS;IAejB,OAAO,CAAC,aAAa;IAKrB,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAM5B,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAM3B,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAM3B,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAM5B,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAM3B,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAM9B,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAO5B,IAAI,KAAK,IAAI,QAAQ,CAEpB;IAED,IAAI,KAAK,CAAC,QAAQ,EAAE,QAAQ,EAE3B;CACF;AAiBD,qBAAa,MAAM;IACjB,OAAO,CAAC,MAAM,CAAC,SAAS,CAGjB;IACP,OAAO,CAAC,MAAM,CAAC,eAAe,CAA2C;IACzE,OAAO,CAAC,MAAM,CAAC,aAAa,CAA+C;WAE7D,GAAG,CACf,IAAI,GAAE,MAA4B,GACjC,aAAa,GAAG,mBAAmB;IAsCtC,OAAO,CAAC,MAAM,CAAC,YAAY;WA+BP,SAAS,CAAC,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;WAgE3D,QAAQ,CAAC,OAAO,EAAE,OAAO,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,IAAI;WA2B5C,SAAS,CAAC,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,OAAO,GAAG,IAAI;CAIxE;AAWD,eAAO,MAAM,MAAM,qCAAe,CAAC"}
|
package/dist/src/react/index.cjs
CHANGED
|
@@ -49,7 +49,6 @@ var import_client = require("@modelcontextprotocol/sdk/client/index.js");
|
|
|
49
49
|
var import_streamableHttp2 = require("@modelcontextprotocol/sdk/client/streamableHttp.js");
|
|
50
50
|
|
|
51
51
|
// src/logging.ts
|
|
52
|
-
var import_winston = require("winston");
|
|
53
52
|
async function getNodeModules() {
|
|
54
53
|
if (typeof process !== "undefined" && process.platform) {
|
|
55
54
|
try {
|
|
@@ -63,7 +62,23 @@ async function getNodeModules() {
|
|
|
63
62
|
return { fs: null, path: null };
|
|
64
63
|
}
|
|
65
64
|
__name(getNodeModules, "getNodeModules");
|
|
66
|
-
var
|
|
65
|
+
var winston = null;
|
|
66
|
+
function loadWinstonSync() {
|
|
67
|
+
if (typeof require !== "undefined") {
|
|
68
|
+
try {
|
|
69
|
+
winston = require("winston");
|
|
70
|
+
} catch {
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
__name(loadWinstonSync, "loadWinstonSync");
|
|
75
|
+
async function getWinston() {
|
|
76
|
+
if (!winston) {
|
|
77
|
+
winston = await import("winston");
|
|
78
|
+
}
|
|
79
|
+
return winston;
|
|
80
|
+
}
|
|
81
|
+
__name(getWinston, "getWinston");
|
|
67
82
|
var DEFAULT_LOGGER_NAME = "mcp-use";
|
|
68
83
|
function isNodeJSEnvironment() {
|
|
69
84
|
try {
|
|
@@ -74,8 +89,7 @@ function isNodeJSEnvironment() {
|
|
|
74
89
|
return false;
|
|
75
90
|
}
|
|
76
91
|
const hasNodeGlobals = typeof process !== "undefined" && typeof process.platform !== "undefined" && typeof __dirname !== "undefined";
|
|
77
|
-
|
|
78
|
-
return hasNodeGlobals && hasNodeModules;
|
|
92
|
+
return hasNodeGlobals;
|
|
79
93
|
} catch {
|
|
80
94
|
return false;
|
|
81
95
|
}
|
|
@@ -106,8 +120,8 @@ var SimpleConsoleLogger = class {
|
|
|
106
120
|
return messageIndex <= currentIndex;
|
|
107
121
|
}
|
|
108
122
|
formatMessage(level, message) {
|
|
109
|
-
const
|
|
110
|
-
return `${
|
|
123
|
+
const timestamp = (/* @__PURE__ */ new Date()).toLocaleTimeString("en-US", { hour12: false });
|
|
124
|
+
return `${timestamp} [${this.name}] ${level}: ${message}`;
|
|
111
125
|
}
|
|
112
126
|
error(message) {
|
|
113
127
|
if (this.shouldLog("error")) {
|
|
@@ -164,15 +178,6 @@ function resolveLevel(env) {
|
|
|
164
178
|
}
|
|
165
179
|
}
|
|
166
180
|
__name(resolveLevel, "resolveLevel");
|
|
167
|
-
var minimalFormatter = printf(({ level, message, label: label2, timestamp: timestamp2 }) => {
|
|
168
|
-
return `${timestamp2} [${label2}] ${level}: ${message}`;
|
|
169
|
-
});
|
|
170
|
-
var detailedFormatter = printf(({ level, message, label: label2, timestamp: timestamp2 }) => {
|
|
171
|
-
return `${timestamp2} [${label2}] ${level.toUpperCase()}: ${message}`;
|
|
172
|
-
});
|
|
173
|
-
var emojiFormatter = printf(({ level, message, label: label2, timestamp: timestamp2 }) => {
|
|
174
|
-
return `${timestamp2} [${label2}] ${level.toUpperCase()}: ${message}`;
|
|
175
|
-
});
|
|
176
181
|
var Logger = class {
|
|
177
182
|
static {
|
|
178
183
|
__name(this, "Logger");
|
|
@@ -192,7 +197,12 @@ var Logger = class {
|
|
|
192
197
|
return this.simpleInstances[name];
|
|
193
198
|
}
|
|
194
199
|
if (!this.instances[name]) {
|
|
195
|
-
|
|
200
|
+
if (!winston) {
|
|
201
|
+
throw new Error("Winston not loaded - call Logger.configure() first");
|
|
202
|
+
}
|
|
203
|
+
const { createLogger, format } = winston;
|
|
204
|
+
const { combine, timestamp, label, colorize, splat } = format;
|
|
205
|
+
this.instances[name] = createLogger({
|
|
196
206
|
level: resolveLevel(process.env.DEBUG),
|
|
197
207
|
format: combine(
|
|
198
208
|
colorize(),
|
|
@@ -207,6 +217,20 @@ var Logger = class {
|
|
|
207
217
|
return this.instances[name];
|
|
208
218
|
}
|
|
209
219
|
static getFormatter() {
|
|
220
|
+
if (!winston) {
|
|
221
|
+
throw new Error("Winston not loaded");
|
|
222
|
+
}
|
|
223
|
+
const { format } = winston;
|
|
224
|
+
const { printf } = format;
|
|
225
|
+
const minimalFormatter = printf(({ level, message, label, timestamp }) => {
|
|
226
|
+
return `${timestamp} [${label}] ${level}: ${message}`;
|
|
227
|
+
});
|
|
228
|
+
const detailedFormatter = printf(({ level, message, label, timestamp }) => {
|
|
229
|
+
return `${timestamp} [${label}] ${level.toUpperCase()}: ${message}`;
|
|
230
|
+
});
|
|
231
|
+
const emojiFormatter = printf(({ level, message, label, timestamp }) => {
|
|
232
|
+
return `${timestamp} [${label}] ${level.toUpperCase()}: ${message}`;
|
|
233
|
+
});
|
|
210
234
|
switch (this.currentFormat) {
|
|
211
235
|
case "minimal":
|
|
212
236
|
return minimalFormatter;
|
|
@@ -219,22 +243,26 @@ var Logger = class {
|
|
|
219
243
|
}
|
|
220
244
|
}
|
|
221
245
|
static async configure(options = {}) {
|
|
222
|
-
const { level, console: console2 = true, file, format
|
|
246
|
+
const { level, console: console2 = true, file, format = "minimal" } = options;
|
|
223
247
|
const debugEnv = typeof process !== "undefined" && process.env?.DEBUG || void 0;
|
|
224
248
|
const resolvedLevel = level ?? resolveLevel(debugEnv);
|
|
225
|
-
this.currentFormat =
|
|
226
|
-
const root = this.get();
|
|
227
|
-
root.level = resolvedLevel;
|
|
228
|
-
const winstonRoot = root;
|
|
249
|
+
this.currentFormat = format;
|
|
229
250
|
if (!isNodeJSEnvironment()) {
|
|
230
251
|
Object.values(this.simpleInstances).forEach((logger2) => {
|
|
231
252
|
logger2.level = resolvedLevel;
|
|
232
253
|
});
|
|
233
254
|
return;
|
|
234
255
|
}
|
|
256
|
+
await getWinston();
|
|
257
|
+
if (!winston) {
|
|
258
|
+
throw new Error("Failed to load winston");
|
|
259
|
+
}
|
|
260
|
+
const root = this.get();
|
|
261
|
+
root.level = resolvedLevel;
|
|
262
|
+
const winstonRoot = root;
|
|
235
263
|
winstonRoot.clear();
|
|
236
264
|
if (console2) {
|
|
237
|
-
winstonRoot.add(new
|
|
265
|
+
winstonRoot.add(new winston.transports.Console());
|
|
238
266
|
}
|
|
239
267
|
if (file) {
|
|
240
268
|
const { fs: nodeFs, path: nodePath } = await getNodeModules();
|
|
@@ -243,9 +271,11 @@ var Logger = class {
|
|
|
243
271
|
if (!nodeFs.existsSync(dir)) {
|
|
244
272
|
nodeFs.mkdirSync(dir, { recursive: true });
|
|
245
273
|
}
|
|
246
|
-
winstonRoot.add(new
|
|
274
|
+
winstonRoot.add(new winston.transports.File({ filename: file }));
|
|
247
275
|
}
|
|
248
276
|
}
|
|
277
|
+
const { format: winstonFormat } = winston;
|
|
278
|
+
const { combine, timestamp, label, colorize, splat } = winstonFormat;
|
|
249
279
|
Object.values(this.instances).forEach((logger2) => {
|
|
250
280
|
if (logger2 && "format" in logger2) {
|
|
251
281
|
logger2.level = resolvedLevel;
|
|
@@ -276,15 +306,16 @@ var Logger = class {
|
|
|
276
306
|
process.env.DEBUG = enabled ? enabled === true ? "2" : String(enabled) : "0";
|
|
277
307
|
}
|
|
278
308
|
}
|
|
279
|
-
static setFormat(
|
|
280
|
-
this.currentFormat =
|
|
281
|
-
this.configure({ format
|
|
309
|
+
static setFormat(format) {
|
|
310
|
+
this.currentFormat = format;
|
|
311
|
+
this.configure({ format });
|
|
282
312
|
}
|
|
283
313
|
};
|
|
284
314
|
if (isNodeJSEnvironment()) {
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
315
|
+
loadWinstonSync();
|
|
316
|
+
if (winston) {
|
|
317
|
+
Logger.configure();
|
|
318
|
+
}
|
|
288
319
|
}
|
|
289
320
|
var logger = Logger.get();
|
|
290
321
|
|
package/dist/src/react/index.js
CHANGED
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
useWidgetProps,
|
|
5
5
|
useWidgetState,
|
|
6
6
|
useWidgetTheme
|
|
7
|
-
} from "../../chunk-
|
|
7
|
+
} from "../../chunk-X2HJQBDI.js";
|
|
8
8
|
import {
|
|
9
9
|
onMcpAuthorization
|
|
10
|
-
} from "../../chunk-
|
|
11
|
-
import "../../chunk-
|
|
12
|
-
import "../../chunk-
|
|
10
|
+
} from "../../chunk-37MPZ3D6.js";
|
|
11
|
+
import "../../chunk-34R6SIER.js";
|
|
12
|
+
import "../../chunk-3GQAWCBQ.js";
|
|
13
13
|
export {
|
|
14
14
|
onMcpAuthorization,
|
|
15
15
|
useMcp,
|
package/dist/src/server/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tsup.config.d.ts","sourceRoot":"","sources":["../tsup.config.ts"],"names":[],"mappings":";AAEA,
|
|
1
|
+
{"version":3,"file":"tsup.config.d.ts","sourceRoot":"","sources":["../tsup.config.ts"],"names":[],"mappings":";AAEA,wBA0BG"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-use",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.3-canary.1",
|
|
5
5
|
"description": "Opinionated MCP Framework for TypeScript (@modelcontextprotocol/sdk compatible) - Build MCP Agents and Clients + MCP Servers with support for MCP-UI.",
|
|
6
6
|
"author": "mcp-use, Inc.",
|
|
7
7
|
"license": "MIT",
|
|
@@ -29,6 +29,10 @@
|
|
|
29
29
|
"types": "./dist/index.d.ts",
|
|
30
30
|
"import": "./dist/index.js"
|
|
31
31
|
},
|
|
32
|
+
"./agent": {
|
|
33
|
+
"types": "./dist/src/agents/index.d.ts",
|
|
34
|
+
"import": "./dist/src/agents/index.js"
|
|
35
|
+
},
|
|
32
36
|
"./browser": {
|
|
33
37
|
"types": "./dist/src/browser.d.ts",
|
|
34
38
|
"import": "./dist/src/browser.js"
|
|
@@ -112,8 +116,8 @@
|
|
|
112
116
|
"ws": "^8.18.2",
|
|
113
117
|
"zod": "^3.25.48",
|
|
114
118
|
"zod-to-json-schema": "^3.24.6",
|
|
115
|
-
"@mcp-use/cli": "2.1.
|
|
116
|
-
"@mcp-use/inspector": "0.4.
|
|
119
|
+
"@mcp-use/cli": "2.1.24-canary.1",
|
|
120
|
+
"@mcp-use/inspector": "0.4.12-canary.1"
|
|
117
121
|
},
|
|
118
122
|
"devDependencies": {
|
|
119
123
|
"@antfu/eslint-config": "^4.13.2",
|