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

agentfootprint-frontend

v0.1.0

Published

Frontend framework bindings for agentfootprint. One package, subpath per framework: /react (hooks), /vue (composables), /angular (services), /nextjs (SSE helpers). Install once, import only what you use.

Downloads

127

Readme

agentfootprint-frontend

Frontend framework bindings for agentfootprint. One package, one install — subpath per framework:

| Subpath | Status | Use | |---|---|---| | agentfootprint-frontend/react | ✅ shipped (0.1.0) | useAgentStream() hook | | agentfootprint-frontend/vue | planned | useAgentStream() composable | | agentfootprint-frontend/angular | planned | AgentStreamService signals | | agentfootprint-frontend/nextjs | planned | SSE route handler, streaming Response helper |

Peer deps are optional per subpath: install React and you only pull in React. No bundle bloat from frameworks you don't use.

Install

npm install agentfootprint-frontend agentfootprint react

React — useAgentStream()

import { useAgentStream } from 'agentfootprint-frontend/react';
import { Agent, anthropic } from 'agentfootprint';
import { useMemo } from 'react';

const agent = Agent.create({ provider: anthropic('claude-sonnet-4') })
  .system('You are a helpful assistant.')
  .streaming(true)
  .build();

export function Chat() {
  const { send, streaming, lastResult, status, error } = useAgentStream(agent);

  return (
    <div>
      {lastResult && <div className="assistant">{lastResult.content}</div>}
      {streaming && <div className="assistant">{streaming}<span className="cursor">|</span></div>}
      {status === 'error' && <div className="error">{error?.message}</div>}
      <input
        onKeyDown={(e) => e.key === 'Enter' && send(e.currentTarget.value)}
        disabled={status === 'running'}
      />
    </div>
  );
}

Returned state

| Field | Type | When it changes | |---|---|---| | streaming | string | Accumulates each token; resets to '' at turn end | | status | 'idle' \| 'running' \| 'done' \| 'paused' \| 'error' | Transitions at turn boundaries | | events | readonly AgentStreamEvent[] | All events for the current turn; cleared at next send() | | lastResult | CapturedTurn \| null | Final content + execution snapshot; persists across idle time | | pauseQuestion | string \| null | Set when the agent pauses for human input | | error | Error \| null | Captured from runner.run() throws |

Actions

| Fn | Does | |---|---| | send(message) | Start a new turn. No-op if one is already in flight. | | resume(input) | Continue a paused turn with human input. | | cancel() | Abort the in-flight turn via AbortSignal. | | reset() | Full state reset — use when switching conversations. |

Integration with exportTrace

lastResult already contains the captured narrative + snapshot + spec. To ship to a viewer / support tool:

const { lastResult } = useAgentStream(agent);

const onCopyTrace = () => {
  if (!lastResult) return;
  const trace = {
    schemaVersion: 1 as const,
    exportedAt: new Date().toISOString(),
    redacted: true,
    snapshot: lastResult.snapshot,
    narrativeEntries: lastResult.narrativeEntries,
    narrative: lastResult.narrative,
    spec: lastResult.spec,
  };
  navigator.clipboard.writeText(JSON.stringify(trace));
};

Paste into <TraceViewer /> from footprint-explainable-ui to render the full Behind-the-Scenes view.

Pause / resume pattern

const { send, resume, pauseQuestion, status } = useAgentStream(agent);

{status === 'paused' && (
  <div>
    <div>Agent is asking: {pauseQuestion}</div>
    <button onClick={() => resume({ approved: true })}>Approve</button>
    <button onClick={() => resume({ approved: false })}>Deny</button>
  </div>
)}

Typing — StreamableRunner

The hook accepts any object exposing the subset of AgentRunner / ConditionalRunner / custom runner it uses:

interface StreamableRunner {
  run(input: string, options?: { signal?; onEvent?; onToken? }): Promise<unknown>;
  resume?(input: unknown): Promise<unknown>;
  getNarrative?(): string[];
  getNarrativeEntries?(): unknown[];
  getSnapshot?(options?: { redact?: boolean }): unknown;
  getSpec?(): unknown;
}

Duck-typed on purpose — a hand-rolled runner works the same as Agent.create(...).build().

License

MIT