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

@ventostack/ai

v0.1.1

Published

AI 集成:LLM 接入、RAG、Tool Registry、权限沙箱。

Downloads

103

Readme

@ventostack/ai

AI 集成:LLM 接入、RAG、Tool Registry、权限沙箱。

模块定位

AI 能力层,依赖 core、auth、observability。提供 AI 工具注册、审批流集成和沙箱隔离执行。

核心能力

  • 多 Provider、多 Model 注册和动态路由
  • OpenAI-compatible、Anthropic 和 Google Provider
  • 对话、Agent Loop、流式输出和上下文压缩
  • RAG、知识库、文档加载和租户隔离查询
  • Tool Registry、风险策略和人工审批
  • Skill、Prompt Template、Memory 和会话存储
  • 进程/Docker 沙箱、调用限流和 Token 预算

安全特性

沙箱安全默认

createSandbox(permissions) 的所有权限默认关闭:

| 权限 | 默认值 | 说明 | |------|--------|------| | allowedTools | [] | 空白名单 = 拒绝所有工具 | | allowFileRead | false | 禁止文件读取 | | allowFileWrite | false | 禁止文件写入 | | allowNetworkAccess | false | 禁止网络访问 | | maxExecutionTime | 60_000 (60s) | 超时自动终止 | | maxMemory | 50MB | 内存增量超限告警 |

const sandbox = createSandbox({
  allowedTools: ["read_database"],  // 必须显式列出
  allowedHosts: ["api.example.com"], // 开启网络时必须提供
  workingDirectory: "/workspace",   // 开启文件访问时必须提供
});

工具白名单强制

  • allowedTools 为空或 undefined 时,canExecute() 返回 false
  • 必须显式配置白名单才能执行任何工具
  • 未注册的工具名称自动拒绝

网络访问控制

  • allowNetworkAccess 默认 false
  • 开启时必须提供 allowedHosts 列表,空列表等同于禁止
  • 仅允许 http/https 协议

文件路径限制

  • 开启文件访问时必须提供 workingDirectory
  • 使用 resolve() + 前缀校验防止路径遍历
  • 仅允许 workingDirectory 及其子目录内的路径

超时与内存监控

  • wrapExecution() 使用 Promise.race 实现超时控制
  • 执行前后对比 process.memoryUsage(),增量超限时输出警告
  • Worker 级别的 resourceLimits 强制隔离需在 Tool Registry 集成

编码约束

  • 所有 Tool 输入必须做 Schema 校验
  • 敏感操作必须经过审批流,禁止 AI 自批准
  • 每次 Tool 调用必须有审计记录