PG playground

Edit. Compile. Inspect. All in your browser.

The real aihu-compile compiler, built to WebAssembly and running on this page. Type .aihu source on the left; every keystroke recompiles it and mounts the result — a live custom element — in the sandboxed frame on the right. No server round-trip, no install.

Start from a recipe

Every preset is a real recipe from thecookbook corpus — the same source the docs, the MCP aihu_example index, and the agent exports are generated from. Each link deep-links the playground straight to that preset.

How it works

  • The compiler is the real one. public/wasm/ is staged from the version-pinned @aihu/compiler-wasmrelease at build time. It matches the @aihu/compilerrelease that builds this documentation site.
  • The preview is sandboxed. Compiled output runs in an iframe with sandbox="allow-scripts" and noallow-same-origin, so it cannot reach this page, its storage, or its cookies. The frame's only channel back is apostMessage height handshake.
  • Your draft is the URL. Picking a preset writes?preset=<id>; editing it switches to?src=<source>, so any state you can see is a link you can share.

If the editor reports that the WASM bundle is unavailable, install dependencies with the matching@aihu/compiler-wasm release and re-runbun run prebuild.