Skip to content

Remove re-export indirection in toolAgent/index.ts #185

@bhouston

Description

@bhouston

Remove re-export indirection in toolAgent/index.ts

Problem

The toolAgent module currently uses an index.ts file that simply re-exports functionality from other files in the same directory. This adds unnecessary indirection and complexity to the codebase. Re-exports within a package make the code harder to follow and can obscure the actual source of functions and types.

Current structure in /packages/agent/src/core/toolAgent/index.ts:

export { toolAgent } from './toolAgentCore.js';
export * from './config.js';
export * from './messageUtils.js';
export * from './toolExecutor.js';
export * from './tokenTracking.js';
export * from './types.js';

Proposed Solution

Remove the index.ts file and update all imports to reference the source files directly. This will:

  1. Make the code more maintainable by removing a layer of indirection
  2. Improve clarity by making it obvious where types/functions are defined
  3. Simplify the codebase structure

Affected Files

  • /packages/agent/src/core/toolAgent/index.ts (to be removed)
  • /packages/agent/src/index.ts (update imports)
  • /packages/agent/src/tools/interaction/subAgent.ts (update imports)
  • Any other files that import from this index.ts

Implementation Notes

This is a breaking change for any external consumers that directly import from this path, but the fix is straightforward - updating import paths to point to the source files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions