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

@yodaos-pkg/aix

v0.10.0

Published

Ink AIX Package Reader

Readme

@yodaos-pkg/aix

@yodaos-pkg/aix is a library for reading and managing .aix (AI eXecutable) packages in the web environment using WASM. The .aix format is an extension of the Open Agent Format (OAF), designed to package AI agents with rich UI/UX capabilities powered by Ink Mini Programs.

Installation

npm install @yodaos-pkg/aix

Quick Start

Here is a quick example of how to load an .aix package:

import { AIX } from '@yodaos-pkg/aix';

// Option 1: Load from a URL
async function fromUrl() {
  const response = await fetch('https://example.com/my-agent.aix');
  const buffer = await response.arrayBuffer();
  const aix = await AIX.From(new Uint8Array(buffer));
  console.log('App Title:', aix.getTitle());
}

// Option 2: Load from a File object (e.g., from an <input type="file">)
async function fromFile(file: File) {
  const aix = await AIX.From(file);
  console.log('App Title:', aix.getTitle());
}

Using the Package Lab

The official browser lab now lives in the docs site at /play.

If you are developing inside this repository, install dependencies in crates/aix-web first:

npm install
  1. Build the local aix-web package:
npm run build

This step builds the aix-web WebAssembly bundle and TypeScript output into dist/, which is what the docs-integrated Package Lab loads.

  1. Install the docs dependencies:
cd ../../docs
npm install
  1. Start the docs site:
npm run dev
  1. Open the local VitePress URL shown in the terminal, then navigate to /play, usually:
http://localhost:5173/aix/play
  1. Upload an .aix file in the page to inspect:
  • package title and version
  • parsed pages
  • generated OpenAI-compatible tools
  • package file list and raw file contents

This is useful for verifying whether app.json, page schemas, and getTools() output match expectations while developing or debugging an AIX package inside the official docs experience.

Pack and Optimize

The Web package includes the same in-memory packer and pure Rust resource optimizer as the native CLI:

const packed = await AIX.pack(
  [{ path: "app.json", data: new TextEncoder().encode('{"pages":[]}') }],
  { optimize: { level: 2 } },
);

const optimized = await AIX.optimize(packed.data, { level: 3 });

Both methods return the generated Uint8Array and a structured per-file report.

Use packFromSource when the input represents an unpacked application tree. It applies the same path normalization and nested .aixignore behavior as the native and npm CLIs, and can report structured progress:

const packed = await AIX.packFromSource(
  [
    { path: ".aixignore", data: new TextEncoder().encode("*.tmp\n") },
    { path: "app.json", data: new TextEncoder().encode('{"pages":[]}') },
    { path: "scratch.tmp", data: new Uint8Array() },
  ],
  {
    optimize: { level: 2 },
    onProgress(event) {
      console.log(event.type);
    },
  },
);

Use pack only when the caller has already normalized and filtered its input files and wants to invoke the low-level packer directly.

API Reference

AIX Class

The main class to interact with an AIX package.

static async From(data: Uint8Array | File): Promise<AIX>

Initializes the WASM module and creates an AIX instance from the given .aix file content. It supports both Uint8Array and the standard Web File object.

// From Uint8Array
const aix = await AIX.From(new Uint8Array(buffer));

// From File (Web API)
const aix = await AIX.From(file);

list(): AixEntry[]

Lists all files in the AIX package.

const files = aix.list();
// [{ name: "app.json", size: 123, compressed_size: 45 }, ...]

readFile(name: string): Uint8Array

Reads the raw content of a specific file from the package.

const content = aix.readFile('app.json');
const text = new TextDecoder().decode(content);

getVersion(): string | undefined

Returns the version metadata from the VERSION file in the package.

const version = aix.getVersion();

getTitle(): string | undefined

Extracts the navigation bar title from the app.json.

const title = aix.getTitle();

getPages(): PageInfo[]

Returns information about all pages defined in the package, including their paths, titles, and data schemas.

const pages = aix.getPages();
/*
[{
  name: "pages/index/index",
  title: "Home",
  data_schema: { ... }
}]
*/

getWidgets(): WidgetInfo[]

Returns widget declarations after verifying that every path resolves to an .ink entry in the package. Throws when a declared entry is missing.

const widgets = aix.getWidgets();
// [{ path: "widgets/clock/index", family: "1x1", placement: "persistent" }]

getTools(): Tool[]

Generates a list of OpenAI-compatible tool definitions based on the pages and their schemas.

const tools = aix.getTools();
/*
[{
  type: "function",
  function: {
    name: "pages_index_index",
    description: "Home",
    parameters: { ... }
  }
}]
*/

Data Types

AixEntry

interface AixEntry {
  name: string;
  size: number;
  compressed_size: number;
}

PageInfo

interface PageInfo {
  name: string;
  title?: string;
  data_schema: any;
}

WidgetInfo

interface WidgetInfo {
  path: string;
  family: string;
}

Tool

OpenAI compatible tool format.

interface Tool {
  type: string;
  function: {
    name: string;
    description?: string;
    parameters: any;
  };
}

Build

To build the library for distribution:

npm run build

The output will be generated in the dist directory, including WASM binaries and TypeScript definitions.

License

MIT