Skip to content

createAgentDeviceClient is exported but unreachable from a project that uses agent-device via npx #2581

Description

@JKobrynski

agent-device 0.21.0, Node 24.18. The README's Node client example (createAgentDeviceClient) is the API I wanted to build a two-platform visual regression loop on (callstack/react-native-paper#5115).

The package does export it (exports["."] → dist/src/index.js). But when agent-device is used the documented way, via npx agent-device …, the package lives only in the npx cache (~/.npm/_npx/<hash>/node_modules/agent-device), and import('agent-device') from a project fails with ERR_MODULE_NOT_FOUND. Reaching the typed client therefore requires adding agent-device as a (dev)dependency of the project under test, which a "try it without installing" evaluation cannot do. The fallback is spawning the CLI with --json per command and parsing stdout, which costs an npx resolution per call and loses every result type.

Suggestions: document the "use the Node client without installing" story if one exists (a global install, or a scaffold like npx agent-device init that writes a local wrapper), or say plainly in the README that the Node client requires a dependency and the CLI is the zero-install path.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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