Skip to content

fix: add package root entrypoint - #186

Merged
jariy17 merged 2 commits into
aws:mainfrom
xianzuyang9-blip:codex/add-root-package-entry
Sep 22, 2026
Merged

jariy17 merged 2 commits into
aws:mainfrom
xianzuyang9-blip:codex/add-root-package-entry

Conversation

@xianzuyang9-blip

Copy link
Copy Markdown
Contributor

Fixes #185.

The package root export points to dist/src/index.js, but the repository did not have src/index.ts, so npm run build produced subpath entrypoints like runtime while leaving the root export missing.

This adds a root entrypoint that exposes the existing public modules as namespaces (identity, runtime, browser, and codeInterpreter). Using namespace exports avoids collisions between shared names such as SessionInfo, DEFAULT_TIMEOUT, and WebSocketConnection while making the existing root export resolve to real JS and type files.

Verification:

  • Before the change: npm run build completed, but dist/src/index.js was missing while dist/src/runtime/index.js existed.
  • After the change: npm run build completes and emits dist/src/index.js.
  • Packed and installed the package into a clean consumer; verified dist/src/index.js and dist/src/index.d.ts exist and import('bedrock-agentcore') exposes runtime, identity, browser, and codeInterpreter.
  • 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-verify to keep the change scoped.

@xianzuyang9-blip
xianzuyang9-blip requested a review from a team June 9, 2026 02:39
@github-actions github-actions Bot added the size/xs PR size: XS label Sep 22, 2026
@jariy17

jariy17 commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

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 SessionInfo, DEFAULT_TIMEOUT, and WebSocketConnection. The other two approaches also fix the missing entrypoint, but are alternative public API shapes rather than additional fixes needed here.

Updated this branch with current main and verified the resulting change still only adds src/index.ts.

Validation against current main plus this patch:

  • Reproduced ERR_MODULE_NOT_FOUND on the unpatched package.
  • Built and packed the patched package, installed the tarball into a clean consumer without optional peers, and verified the root JavaScript/declaration files and namespace exports.
  • Compiled a NodeNext TypeScript consumer using runtime.RequestContext through the package root.
  • All 767 unit tests, lint, source/test type checks, and formatting of src/index.ts passed.
  • Repository-wide formatting flags the unchanged .github/workflows/release.yml on main.

#190 and #191 are being closed as duplicates of this PR. Fresh CI remains to be checked before merging.

@jariy17

jariy17 commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Integration validation passed on the exact head commit 40100201a1b1bda98517080259f8a3410a10e6fe using temporary same-repository draft #266.

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.

@jariy17
jariy17 merged commit 81b03f8 into aws:main Sep 22, 2026
37 of 39 checks passed

This branch had an error being deployed

1 failed and 1 active deployments
auto-approve — 40100201 Deployed Sep 22, 2026 by jariy17 via Integration Tests #535
manual-approval — 40100201 Deployed Sep 22, 2026 by jariy17 via Integration Tests #534
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/xs PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

package root export points to missing dist/src/index.js

2 participants