mcp-use 1.11.0-canary.4 → 1.11.0-canary.6
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-XXCHNDUF.js → chunk-56NAKAFY.js} +1 -1
- package/dist/{chunk-OIXS25J5.js → chunk-A2F55OQO.js} +13 -4
- package/dist/{chunk-TCLI6SPF.js → chunk-IDLN6TBY.js} +1 -1
- package/dist/{chunk-LHRGDQ5C.js → chunk-IGOT6EXU.js} +1 -1
- package/dist/{chunk-A4WWKMPI.js → chunk-KZBJSFU7.js} +4 -4
- package/dist/{chunk-APOF62EA.js → chunk-OFD5S2YF.js} +1 -1
- package/dist/{chunk-QH52FRP3.js → chunk-RKRRGQMY.js} +2 -2
- package/dist/{chunk-BE23AOUV.js → chunk-WCYUQJUP.js} +4 -4
- package/dist/{chunk-K6YNB2Z3.js → chunk-Y3MECXDY.js} +1 -1
- package/dist/index.cjs +14 -5
- package/dist/index.js +8 -8
- package/dist/src/agents/index.cjs +12 -3
- package/dist/src/agents/index.js +6 -6
- package/dist/src/browser.cjs +12 -3
- package/dist/src/browser.js +6 -6
- package/dist/src/client/base.d.ts +1 -0
- package/dist/src/client/base.d.ts.map +1 -1
- package/dist/src/client/prompts.js +4 -4
- package/dist/src/react/index.cjs +14 -5
- package/dist/src/react/index.js +5 -5
- package/dist/src/server/index.cjs +5 -2
- package/dist/src/server/index.js +9 -6
- package/dist/src/server/widgets/mount-widgets-dev.d.ts.map +1 -1
- package/dist/src/session.d.ts +2 -2
- package/dist/src/session.d.ts.map +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/{tool-execution-helpers-MZUMRG5S.js → tool-execution-helpers-543W3CSL.js} +2 -2
- package/package.json +3 -3
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseConnector
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-56NAKAFY.js";
|
|
4
4
|
import {
|
|
5
5
|
Tel
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-Y3MECXDY.js";
|
|
7
7
|
import {
|
|
8
8
|
logger
|
|
9
9
|
} from "./chunk-FRUZDWXH.js";
|
|
@@ -132,7 +132,7 @@ var MCPSession = class {
|
|
|
132
132
|
* Call a tool on the server.
|
|
133
133
|
*
|
|
134
134
|
* @param name - Name of the tool to call
|
|
135
|
-
* @param args - Arguments to pass to the tool
|
|
135
|
+
* @param args - Arguments to pass to the tool (defaults to empty object)
|
|
136
136
|
* @param options - Optional request options (timeout, progress handlers, etc.)
|
|
137
137
|
* @returns Result from the tool execution
|
|
138
138
|
*
|
|
@@ -142,7 +142,7 @@ var MCPSession = class {
|
|
|
142
142
|
* console.log(`Result: ${result.content[0].text}`);
|
|
143
143
|
* ```
|
|
144
144
|
*/
|
|
145
|
-
async callTool(name, args, options) {
|
|
145
|
+
async callTool(name, args = {}, options) {
|
|
146
146
|
return this.connector.callTool(name, args, options);
|
|
147
147
|
}
|
|
148
148
|
/**
|
|
@@ -800,6 +800,15 @@ var BaseMCPClient = class {
|
|
|
800
800
|
}
|
|
801
801
|
return session;
|
|
802
802
|
}
|
|
803
|
+
requireSession(serverName) {
|
|
804
|
+
const session = this.sessions[serverName];
|
|
805
|
+
if (!session) {
|
|
806
|
+
throw new Error(
|
|
807
|
+
`Session '${serverName}' not found. Available sessions: ${this.activeSessions.join(", ") || "none"}`
|
|
808
|
+
);
|
|
809
|
+
}
|
|
810
|
+
return session;
|
|
811
|
+
}
|
|
803
812
|
getAllActiveSessions() {
|
|
804
813
|
return Object.fromEntries(
|
|
805
814
|
this.activeSessions.map((n) => [n, this.sessions[n]])
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BrowserMCPClient
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-RKRRGQMY.js";
|
|
4
4
|
import {
|
|
5
5
|
BrowserOAuthClientProvider,
|
|
6
6
|
sanitizeUrl
|
|
7
7
|
} from "./chunk-J75I2C26.js";
|
|
8
8
|
import {
|
|
9
9
|
Tel
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-Y3MECXDY.js";
|
|
11
11
|
import {
|
|
12
12
|
__name
|
|
13
13
|
} from "./chunk-3GQAWCBQ.js";
|
|
@@ -1098,7 +1098,7 @@ function WidgetControls({
|
|
|
1098
1098
|
);
|
|
1099
1099
|
const isFullscreen = displayMode === "fullscreen" && isAvailable;
|
|
1100
1100
|
const isPip = displayMode === "pip" && isAvailable;
|
|
1101
|
-
const
|
|
1101
|
+
const isInInspector = typeof window !== "undefined" && window.location.pathname.includes("/inspector/api/");
|
|
1102
1102
|
useEffect4(() => {
|
|
1103
1103
|
const timeoutId = setTimeout(() => {
|
|
1104
1104
|
if (typeof window !== "undefined" && window.openai) {
|
|
@@ -1430,7 +1430,7 @@ function WidgetControls({
|
|
|
1430
1430
|
className: getPositionClasses().join(" "),
|
|
1431
1431
|
style: getPositionOffsetStyles()
|
|
1432
1432
|
},
|
|
1433
|
-
!
|
|
1433
|
+
!isInInspector && /* @__PURE__ */ React4.createElement(React4.Fragment, null, !isFullscreen && !isPip && /* @__PURE__ */ React4.createElement(React4.Fragment, null, (viewControls === true || viewControls === "fullscreen") && /* @__PURE__ */ React4.createElement(IconButton, { onClick: handleFullscreen, label: "Fullscreen" }, /* @__PURE__ */ React4.createElement("path", { d: "M15 3h6v6" }), /* @__PURE__ */ React4.createElement("path", { d: "m21 3-7 7" }), /* @__PURE__ */ React4.createElement("path", { d: "m3 21 7-7" }), /* @__PURE__ */ React4.createElement("path", { d: "M9 21H3v-6" })), (viewControls === true || viewControls === "pip") && /* @__PURE__ */ React4.createElement(IconButton, { onClick: handlePip, label: "Picture in Picture" }, /* @__PURE__ */ React4.createElement("path", { d: "M21 9V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v10c0 1.1.9 2 2 2h4" }), /* @__PURE__ */ React4.createElement("rect", { width: "10", height: "7", x: "12", y: "13", rx: "2" }))), enableDebugger && /* @__PURE__ */ React4.createElement(IconButton, { onClick: handleToggleOverlay, label: "Debug Info" }, /* @__PURE__ */ React4.createElement("path", { d: "M12 20v-9" }), /* @__PURE__ */ React4.createElement("path", { d: "M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z" }), /* @__PURE__ */ React4.createElement("path", { d: "M14.12 3.88 16 2" }), /* @__PURE__ */ React4.createElement("path", { d: "M21 21a4 4 0 0 0-3.81-4" }), /* @__PURE__ */ React4.createElement("path", { d: "M21 5a4 4 0 0 1-3.55 3.97" }), /* @__PURE__ */ React4.createElement("path", { d: "M22 13h-4" }), /* @__PURE__ */ React4.createElement("path", { d: "M3 21a4 4 0 0 1 3.81-4" }), /* @__PURE__ */ React4.createElement("path", { d: "M3 5a4 4 0 0 0 3.55 3.97" }), /* @__PURE__ */ React4.createElement("path", { d: "M6 13H2" }), /* @__PURE__ */ React4.createElement("path", { d: "m8 2 1.88 1.88" }), /* @__PURE__ */ React4.createElement("path", { d: "M9 7.13V6a3 3 0 1 1 6 0v1.13" })))
|
|
1434
1434
|
),
|
|
1435
1435
|
children
|
|
1436
1436
|
), isOverlayOpen && enableDebugger && /* @__PURE__ */ React4.createElement(
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BaseMCPClient,
|
|
3
3
|
HttpConnector
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-A2F55OQO.js";
|
|
5
5
|
import {
|
|
6
6
|
Tel,
|
|
7
7
|
getPackageVersion
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-Y3MECXDY.js";
|
|
9
9
|
import {
|
|
10
10
|
logger
|
|
11
11
|
} from "./chunk-FRUZDWXH.js";
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CodeModeConnector
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OFD5S2YF.js";
|
|
4
4
|
import {
|
|
5
5
|
BaseMCPClient,
|
|
6
6
|
ConnectionManager,
|
|
7
7
|
HttpConnector,
|
|
8
8
|
MCPSession
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-A2F55OQO.js";
|
|
10
10
|
import {
|
|
11
11
|
BaseConnector
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-56NAKAFY.js";
|
|
13
13
|
import {
|
|
14
14
|
Tel,
|
|
15
15
|
Telemetry,
|
|
16
16
|
extractModelInfo,
|
|
17
17
|
getPackageVersion
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-Y3MECXDY.js";
|
|
19
19
|
import {
|
|
20
20
|
logger
|
|
21
21
|
} from "./chunk-FRUZDWXH.js";
|
package/dist/index.cjs
CHANGED
|
@@ -2280,7 +2280,7 @@ var MCPSession = class {
|
|
|
2280
2280
|
* Call a tool on the server.
|
|
2281
2281
|
*
|
|
2282
2282
|
* @param name - Name of the tool to call
|
|
2283
|
-
* @param args - Arguments to pass to the tool
|
|
2283
|
+
* @param args - Arguments to pass to the tool (defaults to empty object)
|
|
2284
2284
|
* @param options - Optional request options (timeout, progress handlers, etc.)
|
|
2285
2285
|
* @returns Result from the tool execution
|
|
2286
2286
|
*
|
|
@@ -2290,7 +2290,7 @@ var MCPSession = class {
|
|
|
2290
2290
|
* console.log(`Result: ${result.content[0].text}`);
|
|
2291
2291
|
* ```
|
|
2292
2292
|
*/
|
|
2293
|
-
async callTool(name, args, options) {
|
|
2293
|
+
async callTool(name, args = {}, options) {
|
|
2294
2294
|
return this.connector.callTool(name, args, options);
|
|
2295
2295
|
}
|
|
2296
2296
|
/**
|
|
@@ -2791,7 +2791,7 @@ __name(generateUUID, "generateUUID");
|
|
|
2791
2791
|
init_logging();
|
|
2792
2792
|
|
|
2793
2793
|
// src/version.ts
|
|
2794
|
-
var VERSION = "1.11.0-canary.
|
|
2794
|
+
var VERSION = "1.11.0-canary.6";
|
|
2795
2795
|
function getPackageVersion() {
|
|
2796
2796
|
return VERSION;
|
|
2797
2797
|
}
|
|
@@ -3537,6 +3537,15 @@ var BaseMCPClient = class {
|
|
|
3537
3537
|
}
|
|
3538
3538
|
return session;
|
|
3539
3539
|
}
|
|
3540
|
+
requireSession(serverName) {
|
|
3541
|
+
const session = this.sessions[serverName];
|
|
3542
|
+
if (!session) {
|
|
3543
|
+
throw new Error(
|
|
3544
|
+
`Session '${serverName}' not found. Available sessions: ${this.activeSessions.join(", ") || "none"}`
|
|
3545
|
+
);
|
|
3546
|
+
}
|
|
3547
|
+
return session;
|
|
3548
|
+
}
|
|
3540
3549
|
getAllActiveSessions() {
|
|
3541
3550
|
return Object.fromEntries(
|
|
3542
3551
|
this.activeSessions.map((n) => [n, this.sessions[n]])
|
|
@@ -10378,7 +10387,7 @@ function WidgetControls({
|
|
|
10378
10387
|
);
|
|
10379
10388
|
const isFullscreen = displayMode === "fullscreen" && isAvailable;
|
|
10380
10389
|
const isPip = displayMode === "pip" && isAvailable;
|
|
10381
|
-
const
|
|
10390
|
+
const isInInspector = typeof window !== "undefined" && window.location.pathname.includes("/inspector/api/");
|
|
10382
10391
|
(0, import_react6.useEffect)(() => {
|
|
10383
10392
|
const timeoutId = setTimeout(() => {
|
|
10384
10393
|
if (typeof window !== "undefined" && window.openai) {
|
|
@@ -10710,7 +10719,7 @@ function WidgetControls({
|
|
|
10710
10719
|
className: getPositionClasses().join(" "),
|
|
10711
10720
|
style: getPositionOffsetStyles()
|
|
10712
10721
|
},
|
|
10713
|
-
!
|
|
10722
|
+
!isInInspector && /* @__PURE__ */ import_react6.default.createElement(import_react6.default.Fragment, null, !isFullscreen && !isPip && /* @__PURE__ */ import_react6.default.createElement(import_react6.default.Fragment, null, (viewControls === true || viewControls === "fullscreen") && /* @__PURE__ */ import_react6.default.createElement(IconButton, { onClick: handleFullscreen, label: "Fullscreen" }, /* @__PURE__ */ import_react6.default.createElement("path", { d: "M15 3h6v6" }), /* @__PURE__ */ import_react6.default.createElement("path", { d: "m21 3-7 7" }), /* @__PURE__ */ import_react6.default.createElement("path", { d: "m3 21 7-7" }), /* @__PURE__ */ import_react6.default.createElement("path", { d: "M9 21H3v-6" })), (viewControls === true || viewControls === "pip") && /* @__PURE__ */ import_react6.default.createElement(IconButton, { onClick: handlePip, label: "Picture in Picture" }, /* @__PURE__ */ import_react6.default.createElement("path", { d: "M21 9V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v10c0 1.1.9 2 2 2h4" }), /* @__PURE__ */ import_react6.default.createElement("rect", { width: "10", height: "7", x: "12", y: "13", rx: "2" }))), enableDebugger && /* @__PURE__ */ import_react6.default.createElement(IconButton, { onClick: handleToggleOverlay, label: "Debug Info" }, /* @__PURE__ */ import_react6.default.createElement("path", { d: "M12 20v-9" }), /* @__PURE__ */ import_react6.default.createElement("path", { d: "M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z" }), /* @__PURE__ */ import_react6.default.createElement("path", { d: "M14.12 3.88 16 2" }), /* @__PURE__ */ import_react6.default.createElement("path", { d: "M21 21a4 4 0 0 0-3.81-4" }), /* @__PURE__ */ import_react6.default.createElement("path", { d: "M21 5a4 4 0 0 1-3.55 3.97" }), /* @__PURE__ */ import_react6.default.createElement("path", { d: "M22 13h-4" }), /* @__PURE__ */ import_react6.default.createElement("path", { d: "M3 21a4 4 0 0 1 3.81-4" }), /* @__PURE__ */ import_react6.default.createElement("path", { d: "M3 5a4 4 0 0 0 3.55 3.97" }), /* @__PURE__ */ import_react6.default.createElement("path", { d: "M6 13H2" }), /* @__PURE__ */ import_react6.default.createElement("path", { d: "m8 2 1.88 1.88" }), /* @__PURE__ */ import_react6.default.createElement("path", { d: "M9 7.13V6a3 3 0 1 1 6 0v1.13" })))
|
|
10714
10723
|
),
|
|
10715
10724
|
children
|
|
10716
10725
|
), isOverlayOpen && enableDebugger && /* @__PURE__ */ import_react6.default.createElement(
|
package/dist/index.js
CHANGED
|
@@ -27,13 +27,13 @@ import {
|
|
|
27
27
|
isValidLLMString,
|
|
28
28
|
loadConfigFile,
|
|
29
29
|
parseLLMString
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-WCYUQJUP.js";
|
|
31
31
|
import "./chunk-JRGQRPTN.js";
|
|
32
32
|
import "./chunk-JQKKMUCT.js";
|
|
33
33
|
import {
|
|
34
34
|
PROMPTS
|
|
35
|
-
} from "./chunk-
|
|
36
|
-
import "./chunk-
|
|
35
|
+
} from "./chunk-IDLN6TBY.js";
|
|
36
|
+
import "./chunk-OFD5S2YF.js";
|
|
37
37
|
import {
|
|
38
38
|
ErrorBoundary,
|
|
39
39
|
Image,
|
|
@@ -45,19 +45,19 @@ import {
|
|
|
45
45
|
useWidgetProps,
|
|
46
46
|
useWidgetState,
|
|
47
47
|
useWidgetTheme
|
|
48
|
-
} from "./chunk-
|
|
49
|
-
import "./chunk-
|
|
48
|
+
} from "./chunk-KZBJSFU7.js";
|
|
49
|
+
import "./chunk-RKRRGQMY.js";
|
|
50
50
|
import {
|
|
51
51
|
HttpConnector,
|
|
52
52
|
MCPSession
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-A2F55OQO.js";
|
|
54
54
|
import {
|
|
55
55
|
BrowserOAuthClientProvider,
|
|
56
56
|
onMcpAuthorization
|
|
57
57
|
} from "./chunk-J75I2C26.js";
|
|
58
58
|
import {
|
|
59
59
|
BaseConnector
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-56NAKAFY.js";
|
|
61
61
|
import {
|
|
62
62
|
ElicitationDeclinedError,
|
|
63
63
|
ElicitationTimeoutError,
|
|
@@ -69,7 +69,7 @@ import {
|
|
|
69
69
|
VERSION,
|
|
70
70
|
getPackageVersion,
|
|
71
71
|
setTelemetrySource
|
|
72
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-Y3MECXDY.js";
|
|
73
73
|
import {
|
|
74
74
|
Logger,
|
|
75
75
|
logger
|
|
@@ -1417,7 +1417,7 @@ __name(generateUUID, "generateUUID");
|
|
|
1417
1417
|
init_logging();
|
|
1418
1418
|
|
|
1419
1419
|
// src/version.ts
|
|
1420
|
-
var VERSION = "1.11.0-canary.
|
|
1420
|
+
var VERSION = "1.11.0-canary.6";
|
|
1421
1421
|
function getPackageVersion() {
|
|
1422
1422
|
return VERSION;
|
|
1423
1423
|
}
|
|
@@ -3945,7 +3945,7 @@ var MCPSession = class {
|
|
|
3945
3945
|
* Call a tool on the server.
|
|
3946
3946
|
*
|
|
3947
3947
|
* @param name - Name of the tool to call
|
|
3948
|
-
* @param args - Arguments to pass to the tool
|
|
3948
|
+
* @param args - Arguments to pass to the tool (defaults to empty object)
|
|
3949
3949
|
* @param options - Optional request options (timeout, progress handlers, etc.)
|
|
3950
3950
|
* @returns Result from the tool execution
|
|
3951
3951
|
*
|
|
@@ -3955,7 +3955,7 @@ var MCPSession = class {
|
|
|
3955
3955
|
* console.log(`Result: ${result.content[0].text}`);
|
|
3956
3956
|
* ```
|
|
3957
3957
|
*/
|
|
3958
|
-
async callTool(name, args, options) {
|
|
3958
|
+
async callTool(name, args = {}, options) {
|
|
3959
3959
|
return this.connector.callTool(name, args, options);
|
|
3960
3960
|
}
|
|
3961
3961
|
/**
|
|
@@ -4170,6 +4170,15 @@ var BaseMCPClient = class {
|
|
|
4170
4170
|
}
|
|
4171
4171
|
return session;
|
|
4172
4172
|
}
|
|
4173
|
+
requireSession(serverName) {
|
|
4174
|
+
const session = this.sessions[serverName];
|
|
4175
|
+
if (!session) {
|
|
4176
|
+
throw new Error(
|
|
4177
|
+
`Session '${serverName}' not found. Available sessions: ${this.activeSessions.join(", ") || "none"}`
|
|
4178
|
+
);
|
|
4179
|
+
}
|
|
4180
|
+
return session;
|
|
4181
|
+
}
|
|
4173
4182
|
getAllActiveSessions() {
|
|
4174
4183
|
return Object.fromEntries(
|
|
4175
4184
|
this.activeSessions.map((n) => [n, this.sessions[n]])
|
package/dist/src/agents/index.js
CHANGED
|
@@ -4,15 +4,15 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
MCPAgent,
|
|
6
6
|
RemoteAgent
|
|
7
|
-
} from "../../chunk-
|
|
7
|
+
} from "../../chunk-WCYUQJUP.js";
|
|
8
8
|
import "../../chunk-JRGQRPTN.js";
|
|
9
9
|
import {
|
|
10
10
|
PROMPTS
|
|
11
|
-
} from "../../chunk-
|
|
12
|
-
import "../../chunk-
|
|
13
|
-
import "../../chunk-
|
|
14
|
-
import "../../chunk-
|
|
15
|
-
import "../../chunk-
|
|
11
|
+
} from "../../chunk-IDLN6TBY.js";
|
|
12
|
+
import "../../chunk-OFD5S2YF.js";
|
|
13
|
+
import "../../chunk-A2F55OQO.js";
|
|
14
|
+
import "../../chunk-56NAKAFY.js";
|
|
15
|
+
import "../../chunk-Y3MECXDY.js";
|
|
16
16
|
import "../../chunk-FRUZDWXH.js";
|
|
17
17
|
import "../../chunk-3GQAWCBQ.js";
|
|
18
18
|
export {
|
package/dist/src/browser.cjs
CHANGED
|
@@ -1610,7 +1610,7 @@ __name(generateUUID, "generateUUID");
|
|
|
1610
1610
|
init_logging();
|
|
1611
1611
|
|
|
1612
1612
|
// src/version.ts
|
|
1613
|
-
var VERSION = "1.11.0-canary.
|
|
1613
|
+
var VERSION = "1.11.0-canary.6";
|
|
1614
1614
|
function getPackageVersion() {
|
|
1615
1615
|
return VERSION;
|
|
1616
1616
|
}
|
|
@@ -3156,7 +3156,7 @@ var MCPSession = class {
|
|
|
3156
3156
|
* Call a tool on the server.
|
|
3157
3157
|
*
|
|
3158
3158
|
* @param name - Name of the tool to call
|
|
3159
|
-
* @param args - Arguments to pass to the tool
|
|
3159
|
+
* @param args - Arguments to pass to the tool (defaults to empty object)
|
|
3160
3160
|
* @param options - Optional request options (timeout, progress handlers, etc.)
|
|
3161
3161
|
* @returns Result from the tool execution
|
|
3162
3162
|
*
|
|
@@ -3166,7 +3166,7 @@ var MCPSession = class {
|
|
|
3166
3166
|
* console.log(`Result: ${result.content[0].text}`);
|
|
3167
3167
|
* ```
|
|
3168
3168
|
*/
|
|
3169
|
-
async callTool(name, args, options) {
|
|
3169
|
+
async callTool(name, args = {}, options) {
|
|
3170
3170
|
return this.connector.callTool(name, args, options);
|
|
3171
3171
|
}
|
|
3172
3172
|
/**
|
|
@@ -3381,6 +3381,15 @@ var BaseMCPClient = class {
|
|
|
3381
3381
|
}
|
|
3382
3382
|
return session;
|
|
3383
3383
|
}
|
|
3384
|
+
requireSession(serverName) {
|
|
3385
|
+
const session = this.sessions[serverName];
|
|
3386
|
+
if (!session) {
|
|
3387
|
+
throw new Error(
|
|
3388
|
+
`Session '${serverName}' not found. Available sessions: ${this.activeSessions.join(", ") || "none"}`
|
|
3389
|
+
);
|
|
3390
|
+
}
|
|
3391
|
+
return session;
|
|
3392
|
+
}
|
|
3384
3393
|
getAllActiveSessions() {
|
|
3385
3394
|
return Object.fromEntries(
|
|
3386
3395
|
this.activeSessions.map((n) => [n, this.sessions[n]])
|
package/dist/src/browser.js
CHANGED
|
@@ -13,30 +13,30 @@ import {
|
|
|
13
13
|
getSupportedProviders,
|
|
14
14
|
isValidLLMString,
|
|
15
15
|
parseLLMString
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-WCYUQJUP.js";
|
|
17
17
|
import "../chunk-JRGQRPTN.js";
|
|
18
|
-
import "../chunk-
|
|
18
|
+
import "../chunk-OFD5S2YF.js";
|
|
19
19
|
import {
|
|
20
20
|
BrowserMCPClient
|
|
21
|
-
} from "../chunk-
|
|
21
|
+
} from "../chunk-RKRRGQMY.js";
|
|
22
22
|
import {
|
|
23
23
|
HttpConnector,
|
|
24
24
|
MCPSession
|
|
25
|
-
} from "../chunk-
|
|
25
|
+
} from "../chunk-A2F55OQO.js";
|
|
26
26
|
import {
|
|
27
27
|
BrowserOAuthClientProvider,
|
|
28
28
|
onMcpAuthorization
|
|
29
29
|
} from "../chunk-J75I2C26.js";
|
|
30
30
|
import {
|
|
31
31
|
BaseConnector
|
|
32
|
-
} from "../chunk-
|
|
32
|
+
} from "../chunk-56NAKAFY.js";
|
|
33
33
|
import {
|
|
34
34
|
Tel,
|
|
35
35
|
Telemetry,
|
|
36
36
|
VERSION,
|
|
37
37
|
getPackageVersion,
|
|
38
38
|
setTelemetrySource
|
|
39
|
-
} from "../chunk-
|
|
39
|
+
} from "../chunk-Y3MECXDY.js";
|
|
40
40
|
import {
|
|
41
41
|
Logger,
|
|
42
42
|
logger
|
|
@@ -25,6 +25,7 @@ export declare abstract class BaseMCPClient {
|
|
|
25
25
|
createSession(serverName: string, autoInitialize?: boolean): Promise<MCPSession>;
|
|
26
26
|
createAllSessions(autoInitialize?: boolean): Promise<Record<string, MCPSession>>;
|
|
27
27
|
getSession(serverName: string): MCPSession | null;
|
|
28
|
+
requireSession(serverName: string): MCPSession;
|
|
28
29
|
getAllActiveSessions(): Record<string, MCPSession>;
|
|
29
30
|
closeSession(serverName: string): Promise<void>;
|
|
30
31
|
closeAllSessions(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/client/base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C;;;;;GAKG;AACH,8BAAsB,aAAa;IACjC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAM;IAC3C,SAAS,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAM;IAC7C,cAAc,EAAE,MAAM,EAAE,CAAM;gBAEzB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;WAM1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,aAAa;IAKzD,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE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N6TBY.js";
|
|
4
|
+
import "../../chunk-OFD5S2YF.js";
|
|
5
|
+
import "../../chunk-56NAKAFY.js";
|
|
6
|
+
import "../../chunk-Y3MECXDY.js";
|
|
7
7
|
import "../../chunk-FRUZDWXH.js";
|
|
8
8
|
import "../../chunk-3GQAWCBQ.js";
|
|
9
9
|
export {
|
package/dist/src/react/index.cjs
CHANGED
|
@@ -876,7 +876,7 @@ function generateUUID() {
|
|
|
876
876
|
__name(generateUUID, "generateUUID");
|
|
877
877
|
|
|
878
878
|
// src/version.ts
|
|
879
|
-
var VERSION = "1.11.0-canary.
|
|
879
|
+
var VERSION = "1.11.0-canary.6";
|
|
880
880
|
function getPackageVersion() {
|
|
881
881
|
return VERSION;
|
|
882
882
|
}
|
|
@@ -2384,7 +2384,7 @@ var MCPSession = class {
|
|
|
2384
2384
|
* Call a tool on the server.
|
|
2385
2385
|
*
|
|
2386
2386
|
* @param name - Name of the tool to call
|
|
2387
|
-
* @param args - Arguments to pass to the tool
|
|
2387
|
+
* @param args - Arguments to pass to the tool (defaults to empty object)
|
|
2388
2388
|
* @param options - Optional request options (timeout, progress handlers, etc.)
|
|
2389
2389
|
* @returns Result from the tool execution
|
|
2390
2390
|
*
|
|
@@ -2394,7 +2394,7 @@ var MCPSession = class {
|
|
|
2394
2394
|
* console.log(`Result: ${result.content[0].text}`);
|
|
2395
2395
|
* ```
|
|
2396
2396
|
*/
|
|
2397
|
-
async callTool(name, args, options) {
|
|
2397
|
+
async callTool(name, args = {}, options) {
|
|
2398
2398
|
return this.connector.callTool(name, args, options);
|
|
2399
2399
|
}
|
|
2400
2400
|
/**
|
|
@@ -2609,6 +2609,15 @@ var BaseMCPClient = class {
|
|
|
2609
2609
|
}
|
|
2610
2610
|
return session;
|
|
2611
2611
|
}
|
|
2612
|
+
requireSession(serverName) {
|
|
2613
|
+
const session = this.sessions[serverName];
|
|
2614
|
+
if (!session) {
|
|
2615
|
+
throw new Error(
|
|
2616
|
+
`Session '${serverName}' not found. Available sessions: ${this.activeSessions.join(", ") || "none"}`
|
|
2617
|
+
);
|
|
2618
|
+
}
|
|
2619
|
+
return session;
|
|
2620
|
+
}
|
|
2612
2621
|
getAllActiveSessions() {
|
|
2613
2622
|
return Object.fromEntries(
|
|
2614
2623
|
this.activeSessions.map((n) => [n, this.sessions[n]])
|
|
@@ -4211,7 +4220,7 @@ function WidgetControls({
|
|
|
4211
4220
|
);
|
|
4212
4221
|
const isFullscreen = displayMode === "fullscreen" && isAvailable;
|
|
4213
4222
|
const isPip = displayMode === "pip" && isAvailable;
|
|
4214
|
-
const
|
|
4223
|
+
const isInInspector = typeof window !== "undefined" && window.location.pathname.includes("/inspector/api/");
|
|
4215
4224
|
(0, import_react6.useEffect)(() => {
|
|
4216
4225
|
const timeoutId = setTimeout(() => {
|
|
4217
4226
|
if (typeof window !== "undefined" && window.openai) {
|
|
@@ -4543,7 +4552,7 @@ function WidgetControls({
|
|
|
4543
4552
|
className: getPositionClasses().join(" "),
|
|
4544
4553
|
style: getPositionOffsetStyles()
|
|
4545
4554
|
},
|
|
4546
|
-
!
|
|
4555
|
+
!isInInspector && /* @__PURE__ */ import_react6.default.createElement(import_react6.default.Fragment, null, !isFullscreen && !isPip && /* @__PURE__ */ import_react6.default.createElement(import_react6.default.Fragment, null, (viewControls === true || viewControls === "fullscreen") && /* @__PURE__ */ import_react6.default.createElement(IconButton, { onClick: handleFullscreen, label: "Fullscreen" }, /* @__PURE__ */ import_react6.default.createElement("path", { d: "M15 3h6v6" }), /* @__PURE__ */ import_react6.default.createElement("path", { d: "m21 3-7 7" }), /* @__PURE__ */ import_react6.default.createElement("path", { d: "m3 21 7-7" }), /* @__PURE__ */ import_react6.default.createElement("path", { d: "M9 21H3v-6" })), (viewControls === true || viewControls === "pip") && /* @__PURE__ */ import_react6.default.createElement(IconButton, { onClick: handlePip, label: "Picture in Picture" }, /* @__PURE__ */ import_react6.default.createElement("path", { d: "M21 9V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v10c0 1.1.9 2 2 2h4" }), /* @__PURE__ */ import_react6.default.createElement("rect", { width: "10", height: "7", x: "12", y: "13", rx: "2" }))), enableDebugger && /* @__PURE__ */ import_react6.default.createElement(IconButton, { onClick: handleToggleOverlay, label: "Debug Info" }, /* @__PURE__ */ import_react6.default.createElement("path", { d: "M12 20v-9" }), /* @__PURE__ */ import_react6.default.createElement("path", { d: "M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z" }), /* @__PURE__ */ import_react6.default.createElement("path", { d: "M14.12 3.88 16 2" }), /* @__PURE__ */ import_react6.default.createElement("path", { d: "M21 21a4 4 0 0 0-3.81-4" }), /* @__PURE__ */ import_react6.default.createElement("path", { d: "M21 5a4 4 0 0 1-3.55 3.97" }), /* @__PURE__ */ import_react6.default.createElement("path", { d: "M22 13h-4" }), /* @__PURE__ */ import_react6.default.createElement("path", { d: "M3 21a4 4 0 0 1 3.81-4" }), /* @__PURE__ */ import_react6.default.createElement("path", { d: "M3 5a4 4 0 0 0 3.55 3.97" }), /* @__PURE__ */ import_react6.default.createElement("path", { d: "M6 13H2" }), /* @__PURE__ */ import_react6.default.createElement("path", { d: "m8 2 1.88 1.88" }), /* @__PURE__ */ import_react6.default.createElement("path", { d: "M9 7.13V6a3 3 0 1 1 6 0v1.13" })))
|
|
4547
4556
|
),
|
|
4548
4557
|
children
|
|
4549
4558
|
), isOverlayOpen && enableDebugger && /* @__PURE__ */ import_react6.default.createElement(
|
package/dist/src/react/index.js
CHANGED
|
@@ -9,18 +9,18 @@ import {
|
|
|
9
9
|
useWidgetProps,
|
|
10
10
|
useWidgetState,
|
|
11
11
|
useWidgetTheme
|
|
12
|
-
} from "../../chunk-
|
|
13
|
-
import "../../chunk-
|
|
14
|
-
import "../../chunk-
|
|
12
|
+
} from "../../chunk-KZBJSFU7.js";
|
|
13
|
+
import "../../chunk-RKRRGQMY.js";
|
|
14
|
+
import "../../chunk-A2F55OQO.js";
|
|
15
15
|
import {
|
|
16
16
|
onMcpAuthorization
|
|
17
17
|
} from "../../chunk-J75I2C26.js";
|
|
18
|
-
import "../../chunk-
|
|
18
|
+
import "../../chunk-56NAKAFY.js";
|
|
19
19
|
import {
|
|
20
20
|
Tel,
|
|
21
21
|
Telemetry,
|
|
22
22
|
setTelemetrySource
|
|
23
|
-
} from "../../chunk-
|
|
23
|
+
} from "../../chunk-Y3MECXDY.js";
|
|
24
24
|
import "../../chunk-FRUZDWXH.js";
|
|
25
25
|
import "../../chunk-3GQAWCBQ.js";
|
|
26
26
|
export {
|
|
@@ -761,7 +761,7 @@ var VERSION;
|
|
|
761
761
|
var init_version = __esm({
|
|
762
762
|
"src/version.ts"() {
|
|
763
763
|
"use strict";
|
|
764
|
-
VERSION = "1.11.0-canary.
|
|
764
|
+
VERSION = "1.11.0-canary.6";
|
|
765
765
|
__name(getPackageVersion, "getPackageVersion");
|
|
766
766
|
}
|
|
767
767
|
});
|
|
@@ -3335,10 +3335,13 @@ async function mountWidgetsDev(app, serverConfig, registerWidget, options) {
|
|
|
3335
3335
|
await fs.mkdir(widgetTempDir, { recursive: true });
|
|
3336
3336
|
const resourcesPath = pathHelpers.join(getCwd(), resourcesDir);
|
|
3337
3337
|
const relativeResourcesPath = pathHelpers.relative(widgetTempDir, resourcesPath).replace(/\\/g, "/");
|
|
3338
|
+
const mcpUsePath = pathHelpers.join(getCwd(), "node_modules", "mcp-use");
|
|
3339
|
+
const relativeMcpUsePath = pathHelpers.relative(widgetTempDir, mcpUsePath).replace(/\\/g, "/");
|
|
3338
3340
|
const cssContent = `@import "tailwindcss";
|
|
3339
3341
|
|
|
3340
|
-
/* Configure Tailwind to scan the resources directory */
|
|
3342
|
+
/* Configure Tailwind to scan the resources directory and mcp-use package */
|
|
3341
3343
|
@source "${relativeResourcesPath}";
|
|
3344
|
+
@source "${relativeMcpUsePath}/**/*.{ts,tsx,js,jsx}";
|
|
3342
3345
|
`;
|
|
3343
3346
|
await fs.writeFile(
|
|
3344
3347
|
pathHelpers.join(widgetTempDir, "styles.css"),
|