The same validator is available as a command-line tool, a Node.js library and a browser module without eval. Install the package from the latest GitHub release.
Command line
npm install --save-dev \
https://github.com/agenticworkflowprotocol/awp-validator/releases/download/v0.1.0/agenticworkflowprotocol-validator-0.1.0.tgz
npx awp validate --profiles core,mcp workflow.yaml
npx awp validate --output json workflow.yaml
Exit codes: 0 valid, 1 invalid, 2 usage error, 3 unreadable file.
Node.js
import { validateText, validateManifest } from '@agenticworkflowprotocol/validator';
const { documents } = validateText(yamlText, {
file: 'workflow.yaml',
profiles: ['core', 'mcp'],
});
const ok = documents.every((d) => d.valid);
// already parsed (e.g. a request body)
const result = validateManifest(manifest, { profiles: ['core'] });
Browser
import { validateText } from '@agenticworkflowprotocol/validator/browser';
// or the file awp-validator.mjs from the release
One ES module, no dependencies, works under a strict Content-Security-Policy.