npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@web-axag/compiler

v1.1.1

Published

Build-time AXAG extraction: manifests and WebMCP tools from HTML, JSX, Vue and Angular sources

Readme

@web-axag/compiler

Build-time AXAG extraction. Reads axag annotations from HTML, JSX/TSX, Vue SFCs and Angular templates, and writes the Semantic Manifest and the tools an agent runtime registers.

One implementation runs everywhere: the bundler plugin, axag-cli generate and your own scripts all call the same compile(), so the manifest is identical whichever produces it.

npm install -D @web-axag/compiler

Bundler plugin

Built on unplugin, so it works with Vite, Rollup, webpack, Rspack and esbuild.

import { defineConfig } from 'vite';
import axag from '@web-axag/compiler/vite';

export default defineConfig({
  plugins: [axag()],
});
const axag = require('@web-axag/compiler/webpack').default;
module.exports = { plugins: [axag()] };

The build then contains:

| File | Contents | |------|----------| | .well-known/axag-manifest.json | The Semantic Manifest, at the location agents look for | | axag-tools.webmcp.json | The same actions as WebMCP tool definitions |

and the app can import the tools directly:

import { tools, manifest, dynamicActions } from 'virtual:axag/tools';

In dev, Vite serves both files from memory and recompiles when an annotated file changes.

Options

| Option | Default | Description | |--------|---------|-------------| | root | the bundler's root | Directory globs resolve from | | include | ['**/*.{html,htm,jsx,tsx,vue}'] | Files to read | | exclude | node_modules, dist, build, .git, .next | Files to skip | | harvest | true | Add parameters from form controls | | angular | [] | Extra globs to read as Angular templates; *.component.html always is | | manifestFileName | .well-known/axag-manifest.json | Manifest location in the output | | toolsFileName | axag-tools.webmcp.json | WebMCP tools location; false to skip | | failOnError | true | Fail the build on error diagnostics | | onCompile | — | Called after every compile, including rebuilds |

Specs in components

axag can take an action spec instead of a macro string. The compiler reads it when it is a module-level const or a defineAction({...}) call, in that file or one it imports:

import { defineAction } from '@web-axag/core';

const deactivateUser = defineAction({
  intent: 'user.deactivate',
  actionType: 'write',
  riskLevel: 'critical',
  confirmationRequired: true,
  requiredParameters: [{ name: 'user_id', type: 'string', format: 'uuid' }],
  handler: async ({ user_id }) => api.deactivate(user_id),
});

<button axag={deactivateUser}>Deactivate</button>

Anything the compiler can't read — a prop, a value built at runtime — is listed in the manifest's dynamic_actions so runtimes know the manifest isn't the whole story, and axag-lint reports it as AXAG-LINT-033.

API

import { compile } from '@web-axag/compiler';

const { manifest, registry, webmcpTools, diagnostics, files } = await compile({ root: 'src' });

compile() also takes resolveBindings, which axag-cli uses to attach Zod and OpenAPI parameters.

Framework parsers

@vue/compiler-sfc and @angular/compiler are optional peer dependencies, imported only when a .vue file or an Angular template is read. Neither ships in your bundle: everything here runs at build time.