agents icon indicating copy to clipboard operation
agents copied to clipboard

export prompt components from agents-sdk

Open amikofalvy opened this issue 2 months ago • 2 comments

Summary

Fixed 10 failing CLI tests by updating package.json files to point to compiled JavaScript instead of TypeScript source files.

Root Cause

Node.js cannot import TypeScript files directly. When the CLI tests spawned Node.js processes, imports of @inkeep/agents-sdk and @inkeep/agents-core would fail with ERR_UNKNOWN_FILE_EXTENSION because package.json pointed to src/index.ts instead of dist/index.js.

Changes

  • packages/agents-sdk/package.json: Set main to dist/index.js, added types field and proper exports configuration
  • packages/agents-core/package.json: Set main to dist/index.js, updated all exports to point to compiled output with type definitions
  • Both clean-package.config.json files: Emptied replace objects since package.json now has publish-ready configuration
  • Test fix: Added mock for node:module to fix type definitions test timeout

Results

✅ All 273 CLI tests now pass (previously 10 failing) ✅ Workspace dependencies work correctly (Node.js imports compiled JS) ✅ Published packages will work the same way (no clean-package transformation needed) ✅ Type definitions still work perfectly (.d.ts files are in dist/)

This follows standard TypeScript monorepo patterns where package.json always points to compiled output.

Test Plan

  • [x] CLI tests pass locally
  • [x] Type definitions test passes individually
  • [ ] Full test suite passes in CI

🤖 Generated with Claude Code

amikofalvy avatar Oct 15 '25 23:10 amikofalvy

⚠️ No Changeset found

Latest commit: 66329f7c47d212de43c9359633d98e93ab3418f9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

changeset-bot[bot] avatar Oct 15 '25 23:10 changeset-bot[bot]

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
agents-docs Ready Ready Preview Comment Oct 15, 2025 11:45pm
agents-manage-api Ready Ready Preview Comment Oct 15, 2025 11:45pm
agents-manage-ui Ready Ready Preview Comment Oct 15, 2025 11:45pm
agents-run-api Ready Ready Preview Comment Oct 15, 2025 11:45pm

vercel[bot] avatar Oct 15 '25 23:10 vercel[bot]