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

@eistatistik/tour-agent

v0.4.0

Published

Floating widget package for TourAgent with built-in chat-style UI

Readme

@xtatistix/tour-agent

Full TourAgent package with a floating widget UI.

This package mounts a fixed widget on the page, similar to support/chat widgets such as tawk.to. Users interact with the agent through the built-in floating UI.

If you want to use your own UI and only reuse the core runtime, install @xtatistix/tour-agent-core instead.

Install

npm install @xtatistix/tour-agent

Next.js Quick Start

Use the package only in client components.

'use client';

import { useEffect } from 'react';
import { init, destroy } from '@xtatistix/tour-agent';

export function TourAgentBootstrap() {
  useEffect(() => {
    init({
      apiKey: process.env.NEXT_PUBLIC_OPENAI_API_KEY,
      tours: [
        {
          id: 'invite_user',
          label: 'Invite User',
          steps: [
            {
              elementQuery: "[data-tour-id='invite-user']",
              tooltipText: 'Open the invite flow from here.',
            },
          ],
        },
      ],
      healing: {
        enabled: true,
        useCache: true,
        useLocalAI: true,
        useLLM: true,
      },
      localAI: {
        model: 'Xenova/all-MiniLM-L6-v2',
        threshold: 0.25,
      },
      session: {
        storage: 'sessionStorage',
        resumeOnInit: true,
        followNavigation: true,
      },
    });

    return () => destroy();
  }, []);

  return null;
}

DOM Annotations

TourAgent works best when the host app adds stable annotations:

<button
  data-tour-id="invite-user"
  data-tour-hint="Invite a new teammate into the workspace"
>
  Invite user
</button>
  • data-tour-id: stable target identifier
  • data-tour-hint: semantic description used by self-healing

Recommended data-tour-id style:

  • semantic, stable, and human-readable
  • avoid generated ids and positional names
  • prefer a surface/feature/role style

Examples:

  • sidebar-reports-nav
  • workspace-team-members-tab
  • team-members-invite-email-input

Runtime Model

  • Preset tours run from in-memory definitions supplied by the consumer.
  • Free-text intent mode calls the configured LLM directly from the browser in the current release.
  • Active tours persist in browser storage until they complete or are closed.
  • Cross-page route following is opt-in with session.followNavigation: true.
  • The built-in widget panel can update this preference at runtime without persisting unrelated session options.
  • Self-healing uses a 4-step pipeline:
    • direct selector match
    • in-memory healing cache
    • local semantic matching with @xenova/transformers
    • LLM fallback

API Surface

init(config)
destroy()
startPreset(tourId)
startPrompt(text)
resumeActiveTour()
getActiveSession()
clearActiveTourSession()
setSessionConfig({ followNavigation: true })
resetSessionConfig()
setTours(tours)
addTour(tour)
getTours()
getLLMConfig()
getRuntimeConfig()
getSessionConfig()
getHealingCache()
clearHealingCache()

Browser Bundle

For script-tag usage:

<script src="https://cdn.jsdelivr.net/npm/@xtatistix/tour-agent/dist/tour-agent.js"></script>
<script>
  TourAgent.init({ apiKey: 'sk-...' });
</script>

Notes

  • This is the widget package.
  • For custom UI integrations, use @xtatistix/tour-agent-core.
  • Production proxying, hosted API access, and credential hardening are planned and tracked in ROADMAP.md.