Skip to content

yaml is in devDependencies but imported at runtime #5

Description

@nimser

What happened?

yaml is declared in devDependencies in package.json:56, but the YAML pack loader (src/infrastructure/yaml-pack-loader.ts:2) imports parse from yaml at runtime.

When agent-guardrails is installed as a dependency in a downstream project, devDependencies are not installed. Any consumer who calls loadYamlRulePack / loadAllRulePacks will hit Cannot find module 'yaml' at runtime.

There is no dependencies field in package.json at all.

What did you expect to happen?

yaml should be in dependencies (or peerDependencies) so that consumers who use the YAML loader get it installed automatically.

Steps to reproduce

  1. Install the package in a downstream project: npm install agent-guardrails
  2. Call loadYamlRulePack(...) from the public API
  3. Observe Error: Cannot find module 'yaml'

Relevant log output

Error: Cannot find module 'yaml'
    at .../node_modules/agent-guardrails/dist/infrastructure/yaml-pack-loader.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions