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

@libai168/dsh-tool-figma

v0.2.0

Published

Figma design context tools for DeepSeek Harness: file metadata, node trees, rendered images, comments, and team projects

Readme

dsh-tool-figma

English | 中文

面向 DeepSeek Harness(dsh)的 Figma 设计上下文 Cordis 插件。Agent 可以查看文件元数据、裁剪后的节点树、节点渲染图、版本历史和评论,并可发布单条评论——同时令牌和重型设计数据不会进入工具输出。

安装

npm install @libai168/dsh-tool-figma

需要 peer dependency:@deepseek-ai/cordis(^4.0.1)和 @deepseek-ai/dsh-tools(^0.1.0-rc.6)。

配置

- name: 'github:LJH-snow/dsh-tool-figma'
  config:
    # baseUrl: 'https://api.figma.com/v1'
    tokenEnv: 'FIGMA_TOKEN'
    # timeoutMs: 30000

插件从 tokenEnv 指定的环境变量读取 Figma 个人访问令牌(默认 FIGMA_TOKEN)。不要把可用令牌写入源码、示例、测试或提交的配置文件。令牌在 Figma 的 Settings > Security > Personal access tokens 创建,并只授予部署所需权限(至少 File content: read;figma_post_comment 需要 Write comments)。

baseUrl 覆盖 必须是绝对的 http:// 或 https:// 根地址。只允许公网可达主机:localhost、环回、私有、链路本地、CGNAT、组播、保留/文档/基准测试网段以及全部 IANA 特殊用途地址段都会被拒绝;DNS 结果包含任一此类地址时会在发出请求前 fail closed。不允许 credentials、query、fragment 或非根路径。

工具

| 工具 | 说明 | 写操作 | |---|---|---| | figma_auth_test | 验证令牌,不回显 | 否 | | figma_get_file | 读取单个文件元数据(不含 document) | 否 | | figma_get_file_nodes | 读取最多 10 个节点的裁剪节点树 | 否 | | figma_get_images | 渲染最多 10 个节点并返回下载 URL | 否 | | figma_get_file_versions | 查看文件版本历史 | 否 | | figma_list_file_comments | 查看文件评论 | 否 | | figma_post_comment | 发布单条评论 | 是 | | figma_list_team_projects | 列出团队项目 | 否 | | figma_list_project_files | 列出项目内文件 | 否 |

安全契约

  • 令牌在插件启动时从环境变量读取,不进入工具返回值或渲染文本。
  • figma_get_file 只返回元数据;document 树、组件、样式和缩略图数据一律不转发。
  • 节点树只保留 id、name、type、childCount、children,深度默认 2、上限 5,总节点预算 300;fills、样式等其余属性全部丢弃。
  • 列表上限 50 条(单次节点 ID 最多 10 个);版本描述截断 500 字符、评论消息截断 1000 字符。
  • 只有 figma_post_comment 是写操作(标记 kind: 'edit');不提供删除、文件修改或团队管理工具。
  • 调用方取消信号会传递给 fetch,默认请求超时 30 秒。
  • API 错误会规范化为 { ok: false, reason } 或 { found: false, reason }。

API 范围

当前版本使用经官方 figma/rest-api-spec OpenAPI 文档核对的端点:/me、/files/{key}、/files/{key}/nodes、/images/{key}、/files/{key}/versions、/files/{key}/comments(GET/POST)、/teams/{id}/projects、/projects/{id}/files。Webhook、变量、dev resources、库分析和文件修改类接口有意未包含。

开发

npm install
npm run typecheck
npm test
npm run build
npm pack --dry-run

许可证

MIT