fix: add package root entrypoint - #186
Conversation
|
Reviewed alongside #190 and #191. Keeping this PR as the fix for #185: the namespace exports expose each core module's API while avoiding collisions between names such as Updated this branch with current Validation against current
#190 and #191 are being closed as duplicates of this PR. Fresh CI remains to be checked before merging. |
|
Integration validation passed on the exact head commit Successful workflow run: 8 test files passed; 135 tests passed and 7 skipped. Checkout, build, and live tests completed with the existing security guard intact. The current PR check summary also passes validation, security scanning, and CodeQL. Merging this original PR and closing the temporary validation PR. |
Fixes #185.
The package root export points to
dist/src/index.js, but the repository did not havesrc/index.ts, sonpm run buildproduced subpath entrypoints likeruntimewhile leaving the root export missing.This adds a root entrypoint that exposes the existing public modules as namespaces (
identity,runtime,browser, andcodeInterpreter). Using namespace exports avoids collisions between shared names such asSessionInfo,DEFAULT_TIMEOUT, andWebSocketConnectionwhile making the existing root export resolve to real JS and type files.Verification:
npm run buildcompleted, butdist/src/index.jswas missing whiledist/src/runtime/index.jsexisted.npm run buildcompletes and emitsdist/src/index.js.dist/src/index.jsanddist/src/index.d.tsexist andimport('bedrock-agentcore')exposesruntime,identity,browser, andcodeInterpreter.npm test: 16 test files / 398 tests passed.Note: the local pre-commit hook ran tests and lint successfully, then stopped on an existing Prettier warning in
tests_integ/otel-no-user-content.test.ts, which this PR does not touch. I committed with--no-verifyto keep the change scoped.