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

@uservane/agent-core

v0.1.0

Published

Framework-agnostic headless agent controller for UserVane capture

Readme

@uservane/agent-core

Framework-agnostic headless core for UserVane agent-native capture.

This package holds the controller, correlation seam, anonymous keys, types, and the server-only mintFeedbackToken helper. Framework adapters (@uservane/vercel-ai, @uservane/openai-agents) re-export it and stay thin.

Install

pnpm add @uservane/agent-core

Client (headless)

import { AgentController } from "@uservane/agent-core";

const controller = new AgentController();
controller.init({ key: "uv_pk_live_...", surveySlug: "post-task" });
controller.identify({ userId: "u_123" });

// After the server mints a bound token and you thread it down:
controller.bind({ surveyId, showToken, sessionId });

// At true task resolution:
controller.resolveTask({ outcome: "refunded" });

// Off-platform / async resolution: close the task without an in-session ask.
controller.resolveTask({ defer: true, outcome: "refund_pending" });
// later, when confirmed: mintDeferredAskLink on the server and deliver the URL.

Agent tool (request_user_feedback)

Off by default. Issuer must mint with allowModelRequested: true (bakes amr into the show-token). The model cannot self-enable. Captures are stored as identity_kind=model-requested and are headline-excluded. Never fires while a task is open.

import { handleRequestUserFeedback } from "@uservane/agent-core";
// or adapter wrappers:
// createRequestUserFeedbackTool(controller) from @uservane/vercel-ai
// createRequestUserFeedbackTool(controller) from @uservane/openai-agents

const result = handleRequestUserFeedback(controller);
// { ok: true, status: "feedback_requested", ... } | { ok: false, status: "task_open"|"not_enabled"|... }

Server (secret key)

import { mintFeedbackToken, mintDeferredAskLink } from "@uservane/agent-core/server";

const { tokens } = await mintFeedbackToken({
  secretKey: process.env.USERVANE_SECRET_KEY!, // uv_sk_... - NEVER ship to the browser
  respondentId: userId,
  sessionId, // same id you use for Langfuse session / agent groupId
  surveyId: "surv_post_task",
  // Optional: enable the model-requested agent tool for this token (self-selection;
  // those captures are headline-excluded).
  // allowModelRequested: true,
});

// Out-of-band ask after async outcome (e.g. refund days later).
// Last-mile contract (your channel): one ask, correct outcome, no double-send.
// UserVane does not send email/SMS; enforcement ends where your channel begins.
const deferred = await mintDeferredAskLink({
  secretKey: process.env.USERVANE_SECRET_KEY!,
  respondentId: userId,
  surveyId: "surv_post_task",
  sessionId,
});
// Two modes:
//  - deferred.url: a hosted ask link for your channel (email). STANDALONE capture,
//    NOT correlated to the agent session.
//  - deferred.showToken + deferred.sessionId: the SESSION-LINKED path. Thread them to
//    the user's next in-app session and controller.bind({ surveyId, showToken, sessionId })
//    so the deferred capture links and round-trips a Langfuse session score.
// (A session-linked ask via the emailed URL is a planned follow-up.)

What this is not

  • Not a React UI (see @uservane/agent-react).
  • Not a framework adapter (see @uservane/vercel-ai / @uservane/openai-agents).
  • Not an email/SMS sender (deferAsk reuses your channel).
  • Observation-level auto-read of AI SDK / OTel trace ids is deferred.