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

@inupedia/spotlight-client

v0.9.1

Published

Build-described browser Client Tools and HTTP helpers for Inupedia Spotlight

Downloads

3,770

Readme

@inupedia/spotlight-client

Spotlight 的浏览器 Tool SDK。业务项目只注册 Tools / Resource Providers / Skills,然后调用 thread.run();Tool 名称、说明、JSON Schema、manifest digest、Capability Session、SSE 重连和 Tool Result 回传都由 SDK 处理。

import { defineClientTool } from "@inupedia/spotlight-client";

/** 按名称全屏播放指定监控视频。 */
export const playVideoFullscreen = defineClientTool(
  async ({ name }: { name: string }): Promise<void> => {
    await videoService.playFullscreen(name);
  },
);

const client = createSpotlightAppClient({
  serverUrl: "/spotlight-api",
  projectId: "my-project",
  frontendBuildId: import.meta.env.VITE_BUILD_SHA,
  tools: [playVideoFullscreen],
  skills: [videoMonitoringSkill],
});

const thread = client.thread();
const result = await thread.run("看看泸定取水口");
console.log(result.finalResponse);

Vite 项目可启用构建插件自动推导 Tool 元数据:

import { spotlightClientTools } from "@inupedia/spotlight-client/vite";

spotlightClientTools({
  projectId: "my-project",
  frontendBuildId: process.env.GIT_SHA,
});

非 Vite 项目直接使用显式 defineTool({ name, description, schema, handler }),不需要迁移构建系统。摄像头、资产等大型动态目录使用 defineResourceProvider 注册一次 search/get/action;SDK 会生成延迟加载的资源 Tool,并在浏览器侧把用户名称或别名解析成稳定 ID。

生产构建会输出 spotlight-client-manifest.json。首次初始化后 Server 保存不可变 Capability Snapshot,后续 Turn 不再重复上传整份 Tools / Skills。

完整接入、显式 Schema 和生产部署见 Client Tool 接入指南;大型动态目录见 Resource Provider 接入指南

Node-only 的 Skill 脚本执行器仍从 @inupedia/spotlight-client/node 导入。主入口不包含 Node API。