@mcp-use/client 2.0.0-beta.3 → 2.0.0-beta.4
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/index-browser.js
CHANGED
package/dist/index.js
CHANGED
package/dist/react/index.js
CHANGED
|
@@ -1473,7 +1473,7 @@ var HttpConnector = class extends BaseConnector {
|
|
|
1473
1473
|
};
|
|
1474
1474
|
|
|
1475
1475
|
// src/utils/version.ts
|
|
1476
|
-
var VERSION = "2.0.0-beta.
|
|
1476
|
+
var VERSION = "2.0.0-beta.3";
|
|
1477
1477
|
function getPackageVersion() {
|
|
1478
1478
|
return VERSION;
|
|
1479
1479
|
}
|
|
@@ -7478,6 +7478,8 @@ function ViewRendererBase({
|
|
|
7478
7478
|
onMessageRef.current = onMessage;
|
|
7479
7479
|
const toolInputRef = useRef4(toolInput);
|
|
7480
7480
|
toolInputRef.current = toolInput;
|
|
7481
|
+
const partialToolInputRef = useRef4(partialToolInput);
|
|
7482
|
+
partialToolInputRef.current = partialToolInput;
|
|
7481
7483
|
const toolOutputRef = useRef4(toolOutput);
|
|
7482
7484
|
toolOutputRef.current = toolOutput;
|
|
7483
7485
|
const customPropsRef = useRef4(customProps);
|
|
@@ -7777,11 +7779,18 @@ function ViewRendererBase({
|
|
|
7777
7779
|
bridgeRef.current = bridge;
|
|
7778
7780
|
setInitCount((c) => c + 1);
|
|
7779
7781
|
onLifecycleChangeRef.current?.({ status: "initialized" });
|
|
7780
|
-
const
|
|
7781
|
-
|
|
7782
|
-
|
|
7783
|
-
|
|
7784
|
-
|
|
7782
|
+
const currentPartialToolInput = partialToolInputRef.current;
|
|
7783
|
+
if (currentPartialToolInput) {
|
|
7784
|
+
bridge.sendToolInputPartial({
|
|
7785
|
+
arguments: currentPartialToolInput
|
|
7786
|
+
});
|
|
7787
|
+
} else {
|
|
7788
|
+
const mergedArgs = {
|
|
7789
|
+
...toolInputRef.current,
|
|
7790
|
+
...parseCustomProps(customPropsRef.current)
|
|
7791
|
+
};
|
|
7792
|
+
bridge.sendToolInput({ arguments: mergedArgs });
|
|
7793
|
+
}
|
|
7785
7794
|
const toolResultPayload = buildToolResultPayload(
|
|
7786
7795
|
toolOutputRef.current,
|
|
7787
7796
|
customPropsRef.current
|
|
@@ -7845,13 +7854,13 @@ function ViewRendererBase({
|
|
|
7845
7854
|
}, [initCount, partialToolInput]);
|
|
7846
7855
|
useEffect5(() => {
|
|
7847
7856
|
const bridge = bridgeRef.current;
|
|
7848
|
-
if (!bridge || initCount === 0) return;
|
|
7857
|
+
if (!bridge || initCount === 0 || partialToolInput) return;
|
|
7849
7858
|
const mergedArgs = {
|
|
7850
7859
|
...toolInput,
|
|
7851
7860
|
...parseCustomProps(customProps)
|
|
7852
7861
|
};
|
|
7853
7862
|
bridge.sendToolInput({ arguments: mergedArgs });
|
|
7854
|
-
}, [initCount, toolInput, customProps]);
|
|
7863
|
+
}, [initCount, toolInput, partialToolInput, customProps]);
|
|
7855
7864
|
useEffect5(() => {
|
|
7856
7865
|
const bridge = bridgeRef.current;
|
|
7857
7866
|
if (!bridge || initCount === 0) return;
|