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

@libregrid/ai-client

v1.3.5

Published

Safe browser AI orchestration for AG Grid Community — part of LibreGrid

Readme

@libregrid/ai-client

Connect a grid to a server that turns natural-language commands into proposed grid state changes. The browser client captures the schema and state, validates responses, detects stale proposals, and lets your application control when to apply them.

Documentation and examples

Install

npm install "ag-grid-community@^36.2.0" @libregrid/ai-client @libregrid/ai-toolkit

Requires ag-grid-community >=36.1.0 <37. Register AiToolkitModule so the client can inspect the grid's live schema. The client itself is a function API and has no module to register.

Usage

This browser example expects a protocol-compatible endpoint at /v1/grid-command. Add the controls to your page:

<button id="suggest">Suggest sort order</button>
<button id="apply" disabled>Apply proposal</button>
<pre id="proposal" aria-live="polite"></pre>
<div id="grid" style="height: 400px"></div>
import { AllCommunityModule, ModuleRegistry, createGrid } from 'ag-grid-community';
import { AiToolkitModule } from '@libregrid/ai-toolkit';
import { createGridAssistant, type GridCommandProposal } from '@libregrid/ai-client';

ModuleRegistry.registerModules([AllCommunityModule, AiToolkitModule]);

const api = createGrid(document.querySelector<HTMLElement>('#grid')!, {
  columnDefs: [{ field: 'product' }, { field: 'sales' }],
  rowData: [
    { product: 'Notebook', sales: 120 },
    { product: 'Pen', sales: 80 },
  ],
});
const assistant = createGridAssistant({ api, endpoint: '/v1/grid-command' });
const suggest = document.querySelector<HTMLButtonElement>('#suggest')!;
const apply = document.querySelector<HTMLButtonElement>('#apply')!;
const output = document.querySelector<HTMLElement>('#proposal')!;
let proposal: GridCommandProposal | undefined;

suggest.addEventListener('click', async () => {
  suggest.disabled = true;
  apply.disabled = true;
  proposal = undefined;
  try {
    proposal = await assistant.run('Sort sales from highest to lowest');
    output.textContent = JSON.stringify(proposal.changes, null, 2);
    apply.disabled = false;
  } catch (error) {
    output.textContent = error instanceof Error ? error.message : 'Request failed';
  } finally {
    suggest.disabled = false;
  }
});

apply.addEventListener('click', () => {
  try {
    proposal?.apply();
    output.textContent = 'Proposal applied';
  } catch (error) {
    output.textContent = error instanceof Error ? error.message : 'Apply failed';
  } finally {
    proposal = undefined;
    apply.disabled = true;
  }
});

run() returns a proposal without changing the grid. apply() rejects stale proposals if relevant grid state has changed. For applications that deliberately apply immediately after validation, execute(command) combines both steps.

Server integration

The default HTTP transport uses same-origin credentials. Keep provider keys on the server. Use the headers option only for your application's endpoint authentication, or inject a GridCommandTransport for tests or another transport.

Implement the endpoint from @libregrid/ai-protocol or deploy @libregrid/ai-gateway. The schema, grid state, command, and supplied context are sent to that endpoint; review what your application shares with the configured provider. Browser validation does not replace server authorization.

Angular

Register AiToolkitModule with provideLibreGrid, create the assistant from the API received in gridReady, and bind proposal state to your component UI. See the Angular setup and the AI Toolkit examples.

License

MIT — see LICENSE and NOTICE. LibreGrid is an independent project and is not affiliated with, endorsed by, or sponsored by AG Grid Ltd.