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

kairo-agents

v0.1.0

Published

Widget de chat para el navegador con menús guiados, multimedia y transporte HTTP pluggable

Readme

kairo-agents

Widget de chat para el navegador con soporte de menús guiados, migas de navegación, multimedia y transporte HTTP configurable. Integración nativa con la plataforma Kairo y compatible con cualquier backend propio.


Instalación

npm install kairo-agents

Importar estilos

Agrega el CSS del widget en tu entrada principal (o en tu HTML):

import "kairo-agents/styles.css";
<!-- o directamente en HTML -->
<link rel="stylesheet" href="node_modules/kairo-agents/dist/kairo-agents.css" />

Uso básico — backend propio

import { createChatWidget, createHttpTransport } from "kairo-agents";
import "kairo-agents/styles.css";

const transport = createHttpTransport({
  url: "https://tu-servidor.com/chat",
});

const { chat, open, close, destroy } = createChatWidget(
  document.getElementById("chat-container"),
  {
    transport,
    title: "Asistente",
    placeholder: "Escribe un mensaje…",
    placement: "bottom-right", // "bottom-left" | "top-left" | "top-right" | "inline"
    colorScheme: "auto",       // "light" | "dark" | "auto"
  }
);

// Abrir o cerrar el widget programáticamente
open();
close();

// Limpiar cuando no se necesite más
destroy();

Uso con la plataforma Kairo

import { KairoChat } from "kairo-agents";
import "kairo-agents/styles.css";

const kairo = new KairoChat({
  baseUrl: "https://api.kairo.com",
  widgetToken: "TU_TOKEN",
  container: document.getElementById("chat-container"),
});

kairo.init();

Con token de validación

import { createChatWidgetWithToken } from "kairo-agents";
import "kairo-agents/styles.css";

createChatWidgetWithToken(document.getElementById("chat-container"), {
  validateUrl: "https://tu-servidor.com/validate-token",
  token: "TOKEN_DEL_USUARIO",
  title: "Soporte",
});

Transporte HTTP — opciones

import { createHttpTransport } from "kairo-agents";

const transport = createHttpTransport({
  url: "https://tu-servidor.com/chat",

  // Cabeceras adicionales (ej. autenticación)
  headers: {
    Authorization: "Bearer TOKEN",
  },

  // Tiempo máximo de espera por respuesta (ms)
  timeout: 30_000,
});

Personalización visual

createChatWidget(container, {
  transport,
  colorScheme: "light",
  theme: {
    primaryColor: "#4F46E5",
    backgroundColor: "#ffffff",
    textColor: "#111827",
    borderRadius: "12px",
  },
  // Avatar del asistente
  assistantAvatarLetter: "K",
  // o imagen:
  // assistantAvatarUrl: "https://cdn.ejemplo.com/avatar.png",

  // Botón flotante personalizado
  launcherImageUrl: "https://cdn.ejemplo.com/logo.png",
  launcherMessage: "¿En qué te puedo ayudar?",
});

Menús guiados (SDK v2)

import { createChatWidget, createKairoApiTransport } from "kairo-agents";

const transport = createKairoApiTransport({
  baseUrl: "https://api.kairo.com",
  widgetToken: "TU_TOKEN",
});

createChatWidget(container, {
  transport,
  title: "Asistente",
});

API — exports principales

| Export | Tipo | Descripción | |--------|------|-------------| | createChatWidget | función | Monta el widget en un HTMLElement | | createHttpTransport | función | Transporte HTTP genérico | | createKairoApiTransport | función | Transporte oficial Kairo (init + nodos + chat) | | KairoChat | clase | Integración completa con la plataforma Kairo | | AgentsChat | clase | Cliente de chat de bajo nivel (sin UI) | | createChatWidgetWithToken | función | Widget con validación de token previa | | wrapTransportWithBootstrapCache | función | Precarga la respuesta inicial del asistente | | buildSdkV2Tree | función | Construye el árbol de menús desde nodos SDK v2 |

Tipos exportados

ChatWidgetOptions · ChatWidgetTheme · ChatWidgetColorScheme · ChatWidgetPlacement · ChatWidgetFaqItem · ChatWidgetProductItem · AgentsChatOptions · ChatTransport · ChatMessage · KairoChatOptions · KairoApiClientConfig


Requisitos

  • Navegador moderno con soporte de ES2020 (Chrome 80+, Firefox 74+, Safari 13.1+, Edge 80+)
  • Node.js 18+ para el entorno de build de tu proyecto