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

@aigentive/wire-react

v1.1.0

Published

Wire — JSX facade. Author diagrams as React components; compile to canonical Wire JSON.

Downloads

76

Readme

@aigentive/wire-react

JSX facade for Wire diagrams. Author diagrams as React components, compile to canonical Wire JSON.

Install

npm install @aigentive/wire-react react react-dom

Import the package stylesheet once in your app entry:

import "@aigentive/wire-react/styles.css";

<Flow> renders as inline SVG by default. <WireCanvas> provides the native interactive canvas; no separate canvas-engine package is required and no utility-class source scan is required.

Use

import {
  Flow,
  TriggerNode,
  AINode,
  ConditionNode,
  ActionNode,
  Note
} from "@aigentive/wire-react";

export function Example() {
  return (
    <Flow layout="LR">
      <TriggerNode id="webhook" title="Webhook fires" />
      <AINode id="classify" title="Classify intent" from="webhook" model="gpt-4.1" />
      <ConditionNode
        id="route"
        title="Route request"
        from="classify"
        branches={["sales", "support", "other"]}
      />
      <ActionNode id="notify-sales" title="Notify sales" from="route.sales" tone="success" />
      <ActionNode id="open-ticket" title="Open ticket" from="route.support" tone="warning" />
      <Note id="risk-note" title="Routing risk" attachedTo="classify">
        Check confidence before routing.
      </Note>
    </Flow>
  );
}

Components

| Component | Wire kind | |---|---| | <TriggerNode> | trigger | | <ActionNode> | action | | <AINode> | ai (props: model, prompt, tools) | | <ToolNode> | tool (ref) | | <ConditionNode> | condition (branches: string[] required) | | <HumanNode> | human | | <MemoryNode> | memory | | <RetrievalNode> | retrieval | | <GuardrailNode> | guardrail | | <EndNode> | end | | <Note> | note (body or children, attachedTo) | | <Group> | group (children become group members; parent auto-set) |

All components accept the common base props: id, title, description, tone, from, attachedTo, parent, data, position, size.

<Flow> modes

  • mode="svg" (default) — server-renderable inline SVG. Works in any React tree (server components, RSC, plain SPA, static export).
  • mode="json" — invisible. Use with onCompile to capture the JSON.
<Flow mode="json" onCompile={(d) => console.log(JSON.stringify(d, null, 2))}>
  <TriggerNode id="t" title="Tick" />
</Flow>

Native pan/zoom canvas

For interactive canvases, compile JSX to a Wire diagram and render it through the built-in provider and canvas.

"use client";
import "@aigentive/wire-react/styles.css";
import {
  Flow,
  TriggerNode,
  AINode,
  useWireDiagram,
  WireProvider,
  WireCanvas
} from "@aigentive/wire-react";

export function MyDiagram() {
  const diagram = useWireDiagram(
    <Flow layout="LR">
      <TriggerNode id="t" title="Tick" />
      <AINode id="plan" title="Plan" from="t" model="gpt-4.1" />
    </Flow>
  );
  return (
    <div className="h-[600px]">
      <WireProvider diagram={diagram}>
        <WireCanvas mode="edit" />
      </WireProvider>
    </div>
  );
}

LLM-friendly editor extensions

Most apps should extend the built-in canvas with Wire-level props and keep WireDiagram plus reducer actions as the app contract:

import {
  WireWorkspace,
  type WireOptionCatalog
} from "@aigentive/wire-react";
import "@aigentive/wire-react/styles.css";

const options: WireOptionCatalog = {
  ai: [
    { key: "model", storage: "node", type: "select", options: ["gpt-4.1", "gpt-4.1-mini"] },
    { key: "temperature", type: "number", min: 0, max: 2, step: 0.1 }
  ]
};

export function AgentEditor({ diagram, onChange }) {
  return (
    <WireWorkspace
      diagram={diagram}
      onChange={onChange}
      optionCatalog={options}
      title="Agent workflow"
      subtitle={`${diagram.nodes.length} nodes`}
    />
  );
}

Option values are serializable Wire data. Runtime render callbacks are React-only and are never stored in canonical JSON.

Cards, node lists, and canvas clicks emit Wire events such as node.inspect and edge.click. WireInspector can follow selection or receive explicit nodeId and edgeId values, and WireOptionPanel can follow selection or receive a controlled nodeId. This keeps card rendering decoupled from sidebars.

Production component patterns

Controlled editor with the packaged shell:

import "@aigentive/wire-react/styles.css";
import { useState } from "react";
import { WireWorkspace, type WireDiagram } from "@aigentive/wire-react";

export function ProductEditor({ initial }: { initial: WireDiagram }) {
  const [diagram, setDiagram] = useState(initial);
  return <WireWorkspace diagram={diagram} onChange={setDiagram} fitView />;
}

Custom shell with current components:

import "@aigentive/wire-react/styles.css";
import {
  WireCanvas,
  WireInspector,
  WirePalette,
  WireProvider,
  WireToolbar,
  WireValidationPanel
} from "@aigentive/wire-react";

export function CustomEditor({ diagram, onChange }) {
  return (
    <WireProvider diagram={diagram} onChange={onChange}>
      <WireToolbar />
      <WirePalette />
      <WireCanvas mode="edit" fitView keyboardA11y />
      <WireInspector />
      <WireValidationPanel />
    </WireProvider>
  );
}

Read-only viewer:

import "@aigentive/wire-react/styles.css";
import { WireViewer } from "@aigentive/wire-react";

export function Preview({ diagram }) {
  return <WireViewer diagram={diagram} fitView colorMode="system" />;
}

Theming and design-system integration use current props: colorMode, unstyled, className, classNames, style, and CSS variables. Keyboard navigation, search, connection picking, fit selection, and large-diagram mode are owned by WireCanvas; disable package keyboard handling only with keyboardA11y={false} when your host shell fully replaces it.

See the root docs for the full component prop surface: docs/REACT_COMPONENTS.md. The playground routes /docs and /samples/agent-chain showcase the reusable component system, docs, and full app sample.

Manual compilation

import { compile } from "@aigentive/wire-react";
const diagram = compile(<Flow>...</Flow>);

License

Apache-2.0