Fix agent SDK ESM entrypoints#69
Open
alejandrorivas-pixel wants to merge 1 commit into
Open
Conversation
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.jsextensions to relative agent SDK exports/imports so emitted ESM can be resolved by Nodemodulefield at the generateddist/esm/index.jsinstead of the missingdist/mjs/index.jsWhy
The published package metadata advertises ESM entrypoints under
dist/esm, but the generated files contain extensionless relative imports such asexport * from "./validate". Installing@bitte-ai/agent-sdk@0.4.1and importing the package in Node currently fails withERR_MODULE_NOT_FOUNDfordist/esm/validate.Validation
bun run buildbun run lintpackages/agent-sdklocally withnpm pack, installed the tarball into a clean temp project, and verified all of these work:await import("@bitte-ai/agent-sdk")await import("@bitte-ai/agent-sdk/evm")await import("@bitte-ai/agent-sdk/near")require("@bitte-ai/agent-sdk")require("@bitte-ai/agent-sdk/evm")require("@bitte-ai/agent-sdk/near")Note:
bun run teststill fails inpackages/agent-sdk/tests/near/near.rpc.spec.ts; I reproduced the same failure on a fresh clone of currentmain, so it appears unrelated to this change and tied to the live NEAR RPC/account assertions.