Skip to content

HDP 0.2.3: loads on Cloudflare Workers

Latest

Choose a tag to compare

@asiridalugoda asiridalugoda released this 17 Nov 19:36
d996ad4

HDP 0.2.3 makes the npm packages load in runtimes that forbid code generation from strings. It changes no API and no token behaviour; the token wire format is still HDP v0.1.

Fixed

  • The package loads on Cloudflare Workers. In 0.2.2, importing @helixar_ai/hdp compiled the token JSON Schema with Ajv at load time. Ajv compiles with new Function, so the import threw EvalError: Code generation from strings disallowed on Cloudflare Workers (workerd), in pages with a strict Content-Security-Policy, and under Node's --disallow-code-generation-from-strings. The validator is now generated at build time with Ajv's standalone code output and shipped as plain JavaScript. Schema error messages are unchanged.

Release checks

  • A new test loads the built CommonJS and ES module entry points under --disallow-code-generation-from-strings, issues and verifies a token, and checks that an invalid token is rejected. It fails on the 0.2.2 validator and passes on 0.2.3.
  • A second test fails when the committed generated validator no longer matches token.schema.json.
  • CI now builds before running tests, so the dist-level test runs on every pull request.

Dependencies

ajv and ajv-formats are no longer runtime dependencies of @helixar_ai/hdp. The one Ajv runtime helper the generated validator needs is bundled into dist/, so a fresh install no longer pulls in Ajv or its dependencies.

Packages

  • npm: @helixar_ai/hdp, @helixar_ai/hdp-mcp, @helixar_ai/hdp-autogen, hdp-validate 0.2.3.
  • PyPI: unchanged at 0.2.0.

Known issues

  • The hdp-autogen (Python) receive hook does not match the signature that current pyautogen uses.
  • The @helixar_ai/hdp tarball includes repository files outside dist/ (workflows, docs, the Gradio app), because package.json has no files list. This was also true of 0.2.2.