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 🙏

© 2025 – Pkg Stats / Ryan Hefner

aia-input-assist

v1.1.1

Published

Drop-in AI writing assistant for any text input or textarea.

Readme

AIA Input Assist

Drop a friendly AI co-writer next to any <input> or <textarea> with a single call.

AIA Input Assist is a lightweight widget that anchors to focused text fields and offers common AI actions such as rephrase, translate, shorten, and more. It is framework-agnostic, works in plain browser environments, and exposes a tiny API so you can plug in your own AI provider.

Features

  • ⚡️ Zero-config install – API.init() attaches the widget globally.
  • 🧠 Provider-agnostic – bring your own AI backend (OpenAI proxy, internal API, etc.).
  • ♿️ Keyboard/ARIA friendly – keeps focus management intact for accessible forms.
  • 🧩 Works with every framework – React/Vue/Svelte/vanilla because it hooks straight into the DOM.
  • 🧪 Included mock provider for local development.

Installation

npm install aia-input-assist
# or
yarn add aia-input-assist

Quick start

import AIA, { API, providers } from "aia-input-assist";

// Optional: supply your own provider
API.init({
  provider: providers.openaiProxy(
    "https://your-api-proxy.example.com/query",
    process.env.OPENAI_PROXY_KEY!
  ),
});

// Alternatively, call later via the global helper
window.AIA?.("configure", { theme: "dark" });

As soon as API.init() runs, focusing any text field on the page displays the Assist button. Choosing an action runs the configured provider and writes the output back into the field with a smooth “AI typing” animation.

Custom providers

Implement the Provider interface to route actions to your own service:

import type { Provider, ActionId } from "aia-input-assist";

const myProvider: Provider = {
  async run(action: ActionId, text: string, params) {
    const response = await fetch("/api/assist", {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({ action, text, params }),
    });

    if (!response.ok) throw new Error("Assist request failed.");
    const { result } = await response.json();
    return result ?? text;
  },
};

API.init({ provider: myProvider });

Configuration

API.init({
  position: "right", // left | right | top | bottom
  theme: "auto",      // auto switches with OS theme
  actions: ["rephrase", "translate"], // limit visible options
  provider: providers.simple(),       // quick mock provider
});

You can call API.configure later to update these values on the fly. See src/lib/core.ts for documented options.

Examples

  • examples/react – small React playground powered by Vite. Run with:

    npm run dev:example

    and open the provided URL.

Feel free to contribute additional framework examples!

Building locally

npm install
npm run build

This outputs:

  • dist/aia-input-assist.esm.js – modern module build.
  • dist/aia-input-assist.umd.js – unminified UMD build.
  • dist/aia-input-assist.umd.min.js – minified bundle for CDN usage.
  • Type definitions alongside the bundles.

Roadmap

  • [ ] Multi-step provider pipelines.
  • [ ] Plug-and-play CSS themes.
  • [ ] Optional history panel.

Have an idea? Open an issue or start a discussion.

Contributing

  1. Fork and clone the repo.
  2. Install dependencies with npm install.
  3. Use npm run dev:example to hack on the React playground while editing the library.
  4. Submit a pull request with a clear description of your changes.

Please make sure your PR keeps TypeScript strict mode happy and adds tests or docs when it makes sense.

License

MIT © AIA Labs. See LICENSE for details.