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

@freesail/react

v0.9.1

Published

React frontend for Freesail A2UI SDK

Readme

@freesail/react

React bindings for Freesail — connects your React app to a Freesail gateway and renders agent-driven UI surfaces.

Installation

npm install @freesail/react @freesail/standard-catalog

Quick Start

import { FreesailProvider, FreesailSurface } from '@freesail/react';
import { standardCatalogComponents, standardCatalogFunctions } from '@freesail/standard-catalog';
import standardCatalogSchema from '@freesail/standard-catalog/dist/standard-catalog.json';

function App() {
  return (
    <FreesailProvider
      gateway="http://localhost:3001"
      catalogs={[{
        namespace: 'https://your-catalog-id/catalogs/your-catalog.json',
        components: standardCatalogComponents,
        functions: standardCatalogFunctions,
        schema: standardCatalogSchema,
      }]}
    >
      <FreesailSurface surfaceId="main" />
    </FreesailProvider>
  );
}

Components

FreesailProvider

Root provider that manages the gateway connection and surface state. Must wrap all FreesailSurface components.

| Prop | Type | Required | Description | |------|------|----------|-------------| | gateway | string | Yes | Base gateway URL (e.g. http://localhost:3001) | | catalogs | CatalogDefinition[] | No | Catalogs to register with the provider | | transportOptions | object | No | Additional transport configuration | | additionalCapabilities | Record<string, unknown> | No | Extra capability key/values advertised to the agent | | onConnectionChange | (connected: boolean) => void | No | Called when connection state changes | | onError | (error: Error) => void | No | Called when a transport error occurs | | onBeforeCreateSurface | interceptor | No | Called before honouring an agent createSurface — return { allowed: false } to block | | onBeforeUpdateComponents | interceptor | No | Called before honouring an agent updateComponents — return { allowed: false } to block | | onBeforeUpdateDataModel | interceptor | No | Called before honouring an agent updateDataModel — return { allowed: false } to block | | onBeforeDeleteSurface | interceptor | No | Called before honouring an agent deleteSurface — return { allowed: false } to block |

FreesailSurface

Renders a single agent-driven surface. Subscribes to updates automatically.

| Prop | Type | Required | Description | |------|------|----------|-------------| | surfaceId | string | Yes | The surface ID to render | | className | string | No | CSS class for the container element | | loading | ReactNode | No | Shown while the surface has not yet been created by the agent | | error | ReactNode | No | Shown when the catalog is not registered | | empty | ReactNode | No | Shown when the surface exists but has no components |

Hooks

| Hook | Returns | Description | |------|---------|-------------| | useSurface(surfaceId) | Surface \| undefined | Subscribe to a surface and re-render on updates | | useSurfaceData(surfaceId, path?) | T \| undefined | Read a value from the surface data model at an optional JSON Pointer path | | useAction(surfaceId) | dispatch | Returns a function to send user actions upstream | | useConnectionStatus() | { isConnected } | Current gateway connection state | | useSurfaces() | Surface[] | All active surfaces | | useSessionId() | string \| null | Session ID assigned by the gateway after connection |

Interceptors

Each onBefore* prop lets you validate or block agent operations before they are applied. Return { allowed: false, message: '...' } to block — the message is sent back to the agent as an error. Return { allowed: true, message: '...' } to allow and also notify the agent with a validation message.

<FreesailProvider
  gateway="http://localhost:3001"
  catalogs={[...]}
  onBeforeCreateSurface={(_surfaceId, _catalogId, _sendDataModel, surfaceManager) => {
    if (surfaceManager.getAllSurfaces().length >= 3) {
      return { allowed: false, message: 'Surface limit reached. Please remove a surface first.' };
    }
    return { allowed: true, message: '' };
  }}
  onBeforeUpdateComponents={(surfaceId, components, surfaceManager) => {
    if (components.length > 50) {
      return { allowed: false, message: 'Too many components' };
    }
    return { allowed: true, message: '' };
  }}
>
  ...
</FreesailProvider>

License

MIT — see LICENSE