[PR #574] [MERGED] fix(deepagents): add browser and node entrypoints #572

Closed
opened 2026-06-05 17:23:47 -04:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/deepagentsjs/pull/574
Author: @hntrl
Created: 6/2/2026
Status: Merged
Merged: 6/2/2026
Merged by: @hntrl

Base: mainHead: hunter/deepagents-node-browser-entrypoints-292


📝 Commits (2)

  • 3446d2e fix(deepagents): add browser and node entrypoints
  • 9a1a1bd docs(deepagents): clarify browser import guidance

📊 Changes

9 files changed (+244 additions, -6 deletions)

View changed files

.changeset/hunter-deepagents-node-browser-entrypoints-292.md (+10 -0)
📝 libs/deepagents/README.md (+19 -0)
📝 libs/deepagents/package.json (+21 -0)
📝 libs/deepagents/src/agent.ts (+1 -1)
📝 libs/deepagents/src/backends/utils.ts (+13 -2)
libs/deepagents/src/browser.ts (+171 -0)
libs/deepagents/src/node.ts (+6 -0)
📝 libs/deepagents/src/types.ts (+1 -1)
📝 libs/deepagents/tsdown.config.ts (+2 -2)

📄 Description

Summary

Fixes #292, #543

This updates deepagents packaging to split environment-specific exports and avoid browser build failures caused by Node-only imports in the default bundle. Browser consumers now have an explicit deepagents/browser entrypoint, while Node consumers can keep using deepagents (or optionally deepagents/node) for the full runtime API.

Changes

deepagents package exports and entrypoints

  • Added src/browser.ts as a browser-safe public barrel that excludes Node-only APIs.
  • Added src/node.ts as an explicit Node entrypoint that re-exports the full API.
  • Updated package.json exports to:
    • route the root browser condition to ./dist/browser.js
    • expose ./browser and ./node subpath exports (ESM + CJS + types).
  • Updated tsdown config to build index, browser, and node outputs.

Runtime import graph hardening

  • Updated createDeepAgent to import StateBackend directly from backends/state so it no longer pulls in the full Node-oriented backends barrel.
  • Updated types.ts to import AnyBackendProtocol from backends/protocol instead of backends/index.
  • Removed named Node builtin path imports from backends/utils.ts by replacing path.basename/path.extname with local helpers.

Documentation and release notes

  • Added a README section documenting import guidance: browser apps should use deepagents/browser, and Node apps can continue to use deepagents.
  • Added a patch changeset for deepagents describing the entrypoint and packaging fix.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/deepagentsjs/pull/574 **Author:** [@hntrl](https://github.com/hntrl) **Created:** 6/2/2026 **Status:** ✅ Merged **Merged:** 6/2/2026 **Merged by:** [@hntrl](https://github.com/hntrl) **Base:** `main` ← **Head:** `hunter/deepagents-node-browser-entrypoints-292` --- ### 📝 Commits (2) - [`3446d2e`](https://github.com/langchain-ai/deepagentsjs/commit/3446d2ea12bfe3d3637010955d235136bdc28e60) fix(deepagents): add browser and node entrypoints - [`9a1a1bd`](https://github.com/langchain-ai/deepagentsjs/commit/9a1a1bd99c304459888758dd866f5d0c6939a4bf) docs(deepagents): clarify browser import guidance ### 📊 Changes **9 files changed** (+244 additions, -6 deletions) <details> <summary>View changed files</summary> ➕ `.changeset/hunter-deepagents-node-browser-entrypoints-292.md` (+10 -0) 📝 `libs/deepagents/README.md` (+19 -0) 📝 `libs/deepagents/package.json` (+21 -0) 📝 `libs/deepagents/src/agent.ts` (+1 -1) 📝 `libs/deepagents/src/backends/utils.ts` (+13 -2) ➕ `libs/deepagents/src/browser.ts` (+171 -0) ➕ `libs/deepagents/src/node.ts` (+6 -0) 📝 `libs/deepagents/src/types.ts` (+1 -1) 📝 `libs/deepagents/tsdown.config.ts` (+2 -2) </details> ### 📄 Description ## Summary Fixes #292, #543 This updates `deepagents` packaging to split environment-specific exports and avoid browser build failures caused by Node-only imports in the default bundle. Browser consumers now have an explicit `deepagents/browser` entrypoint, while Node consumers can keep using `deepagents` (or optionally `deepagents/node`) for the full runtime API. ## Changes ### `deepagents` package exports and entrypoints - Added `src/browser.ts` as a browser-safe public barrel that excludes Node-only APIs. - Added `src/node.ts` as an explicit Node entrypoint that re-exports the full API. - Updated `package.json` exports to: - route the root `browser` condition to `./dist/browser.js` - expose `./browser` and `./node` subpath exports (ESM + CJS + types). - Updated `tsdown` config to build `index`, `browser`, and `node` outputs. ### Runtime import graph hardening - Updated `createDeepAgent` to import `StateBackend` directly from `backends/state` so it no longer pulls in the full Node-oriented backends barrel. - Updated `types.ts` to import `AnyBackendProtocol` from `backends/protocol` instead of `backends/index`. - Removed named Node builtin path imports from `backends/utils.ts` by replacing `path.basename`/`path.extname` with local helpers. ### Documentation and release notes - Added a README section documenting import guidance: browser apps should use `deepagents/browser`, and Node apps can continue to use `deepagents`. - Added a patch changeset for `deepagents` describing the entrypoint and packaging fix. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-06-05 17:23:47 -04:00
yindo closed this issue 2026-06-05 17:23:47 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/deepagentsjs#572