Skip to content

Documented import path 'smithers-orchestrator/agents/cli' fails (missing subpath export) #84

@enitrat

Description

@enitrat

Bug

The CLI Agents docs instruct users to import via:

import { ClaudeCodeAgent, CodexAgent, GeminiAgent } from "smithers-orchestrator/agents/cli";

This fails at resolution time:

ERR_PACKAGE_PATH_NOT_EXPORTED: Package subpath './agents/cli' is not defined
by "exports" in .../node_modules/smithers-orchestrator/package.json

Root cause

The exports map in package.json does not include "./agents/cli". When a package declares an exports field, Node.js (and Bun/bundlers) use it as an allowlist — any subpath not explicitly listed is blocked, even if the file physically exists on disk.

The classes exist in src/agents/cli.ts and are re-exported from the root (import { ClaudeCodeAgent } from "smithers-orchestrator" works), but the deep path documented on the site is broken.

Current exports map:

{
  ".": "./src/index.ts",
  "./jsx-runtime": "./src/jsx-runtime.ts",
  "./jsx-dev-runtime": "./src/jsx-runtime.ts",
  "./tools": "./src/tools/index.ts",
  "./server": "./src/server/index.ts",
  "./pi-plugin": "./src/pi-plugin/index.ts",
  "./mdx-plugin": "./src/mdx-plugin.ts",
  "./dom/renderer": "./src/dom/renderer.ts"
}

No "./agents/cli" entry.

Minimal Reproducible Example

package.json

{
  "name": "smithers-mre",
  "private": true,
  "type": "module",
  "dependencies": {
    "smithers-orchestrator": "latest"
  }
}

index.ts

// This import fails — the documented path is not in the exports map
import { ClaudeCodeAgent } from "smithers-orchestrator/agents/cli";

console.log(ClaudeCodeAgent);

Reproduce:

npm install
npx tsx index.ts   # or: bun run index.ts

Expected: import resolves successfully
Actual:

ERR_PACKAGE_PATH_NOT_EXPORTED: Package subpath './agents/cli' is not defined
by "exports" in .../node_modules/smithers-orchestrator/package.json

Workaround: import from root instead:

import { ClaudeCodeAgent } from "smithers-orchestrator";

Related

PR #73 addresses this by adding "./agents/cli": "./src/agents/cli.ts" to the exports map.

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