You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 16, 2025. It is now read-only.
Library is not importable in browser environments, despite the documentation claiming so.
Reproduction Steps
Steps to reproduce the behavior:
Install the library in a browser-like package
Get errors at bundle-time or runtime about node:stream import in client.ts
Expected Behavior
I should at least be able to import the contents of tools.ts in browser environments, as that does not depend on any node code. client.ts could also support browsers if it were refactored to support stdio via dependency injection or config, delaying import of node:stream until necessary.
I was able to successfully fork tools.ts without any changes, and connect to an sse transport per-tool, and then convert those tools and use them in the ReactAgent from a browser.
Possible Solution
Minimally, I propose adding an exports field to package.json, and allow users to directly import applicable files, treeshaking files with node dependencies out of the bundle.
Longer term, I think the multi-server Client would be very valuable in browser contexts if node libs were only used when stdio servers provided in the config.