Skip to content

Fix agent SDK ESM entrypoints#69

Open
alejandrorivas-pixel wants to merge 1 commit into
BitteProtocol:mainfrom
alejandrorivas-pixel:fix-agent-sdk-esm-entrypoints
Open

Fix agent SDK ESM entrypoints#69
alejandrorivas-pixel wants to merge 1 commit into
BitteProtocol:mainfrom
alejandrorivas-pixel:fix-agent-sdk-esm-entrypoints

Conversation

@alejandrorivas-pixel

Copy link
Copy Markdown

Summary

  • add explicit .js extensions to relative agent SDK exports/imports so emitted ESM can be resolved by Node
  • point the package module field at the generated dist/esm/index.js instead of the missing dist/mjs/index.js

Why

The published package metadata advertises ESM entrypoints under dist/esm, but the generated files contain extensionless relative imports such as export * from "./validate". Installing @bitte-ai/agent-sdk@0.4.1 and importing the package in Node currently fails with ERR_MODULE_NOT_FOUND for dist/esm/validate.

Validation

  • bun run build
  • bun run lint
  • packed packages/agent-sdk locally with npm 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 test still fails in packages/agent-sdk/tests/near/near.rpc.spec.ts; I reproduced the same failure on a fresh clone of current main, so it appears unrelated to this change and tied to the live NEAR RPC/account assertions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants