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

@felores/picnode-agent

v0.6.1

Published

本地 Canvas Agent 用来连接画布网页和用户电脑上的 Codex / Claude Code。本地开发时优先连接 `http://localhost:59587`,不需要先使用线上站点。

Readme

Infinite Canvas Agent

本地 Canvas Agent 用来连接画布网页和用户电脑上的 Codex / Claude Code。本地开发时优先连接 http://localhost:59587,不需要先使用线上站点。

启动

Install and start the Picnode-owned Canvas Agent distribution:

npx -y @felores/picnode-agent

The package keeps the picnode executable and includes Picnode KIE, security, and CLI changes. The source command remains available for repository development:

bun install
bun run build
./dist/index.js

需要排查连接、线程、Codex app-server 或工具调用问题时,可开启 Debug 模式:

./dist/index.js --debug

Debug 日志会以 [DEBUG][HH:mm:ss] 等传统格式输出到终端,并按启动日期保存到 ~/.infinite-canvas/logs/canvas-agent-YYYY-MM-DD.log。终端日志带级别颜色,文件日志为纯文本;日志包含 HTTP、SSE、线程、turn、Codex app-server 和工具调用事件,token 与图片 Data URL 会自动隐藏。

本仓库开发时也可以直接运行:

cd canvas-agent
bun install
bun run build
./dist/index.js

启动后会输出本机地址和 token:

Local URL: http://127.0.0.1:17371
Connect token: xxxxxx

在画布右上角点击 Agent,填入地址和 token 后连接。

Codex app 插件会读取启动输出里的 Local URL 和 Connect token,并直接打开画布网页地址;Canvas Agent 不负责生成画布打开 URL。

Canvas Agent 默认只监听 127.0.0.1。网页第一次带正确 token 连接后,Canvas Agent 会记录该网页 Origin;之后其他 Origin 不能复用这个本地 Agent,除非用户清理 ~/.infinite-canvas/canvas-agent.json 里的 origins

Distribution

The published @felores/picnode-agent package exposes the picnode executable and is the distribution used by the portable plugin configuration.

Codex MCP

如果希望 Codex 终端能直接操作画布,需要先把 Canvas Agent 注册成 Codex MCP。

直接运行 npx -y @felores/picnode-agent 只启动本地 Agent 服务,不会安装 MCP,也不会增加 Codex 工具上下文。只有安装 Codex app 插件,或手动执行 codex mcp add 后,picnode 工具才会进入 Codex 上下文;由于工具较多,不使用时建议移除。

通过插件安装时移除插件:

codex plugin remove infinite-canvas

手动添加 MCP 时移除 MCP:

codex mcp remove picnode

Codex app 插件

仓库内提供了 Codex app 插件:plugins/infinite-canvas。在 Codex app 中添加本仓库的 marketplace 后,可以安装 Infinite Canvas 插件;插件会注册同一个 picnode MCP,并带上画布操作说明。

添加本地 marketplace 时建议使用仓库绝对路径,避免 Codex 从其他工作目录解析失败:

cd /path/to/infinite-canvas
codex plugin marketplace add "$(pwd)"
codex plugin add infinite-canvas@infinite-canvas-local

插件默认通过 npm 启动 MCP;这个命令只提供 MCP 工具,不会把 MCP 写入全局配置,也不会在退出时自动卸载:

npx -y @felores/picnode-agent mcp

使用时可以直接在 Codex 里说“打开 Infinite Canvas”,插件会启动本地 Agent,读取 Local URL 和 Connect token,然后在右侧打开 https://canvas.best/ 并自动新建、连接画布;只有明确要求使用本地项目时才会启动本地前端。

Canvas Agent 启动后,给 Codex 添加 MCP:

codex mcp add picnode -- npx -y @felores/picnode-agent mcp

本仓库开发时可以改成,实际使用建议替换为本机绝对路径:

codex mcp add picnode -- node /path/to/infinite-canvas/canvas-agent/dist/index.js mcp

Canvas Agent 源码使用 TypeScript 编写,MCP 协议层使用官方 @modelcontextprotocol/sdk,工具入参使用 zod 描述。

如果希望终端里的 Codex 不被 MCP 审批卡住,可以在 ~/.codex/config.toml 里给这个 MCP 设置自动放行:

[mcp_servers.picnode]
command = "npx"
args = ["-y", "@felores/picnode-agent", "mcp"]
default_tools_approval_mode = "approve"

可用工具:

  • canvas_get_state
  • canvas_get_selection
  • canvas_export_snapshot
  • canvas_apply_ops
  • canvas_create_text_node
  • canvas_create_image_prompt_flow

canvas_apply_ops 示例:

{
  "ops": [
    {
      "type": "add_node",
      "nodeType": "text",
      "title": "标题",
      "position": { "x": 0, "y": 0 },
      "metadata": { "content": "文本内容" }
    }
  ]
}

侧边栏 Codex

本地面板会把提示词发送给 Canvas Agent。Canvas Agent 使用官方 @openai/codex CLI 的 codex app-server --stdio 启动并复用同一个 Codex thread,启动时会注入 picnode MCP 配置并自动放行 MCP 审批,真正执行画布修改前仍由网页侧边栏二次确认。

侧边栏会展示 Codex 返回的 thread.startedturn.starteditem.*turn.completed 等结构化事件;Canvas Agent 会合并短时间内的回复、思考摘要和命令输出增量,网页使用同一条消息持续更新,并把任务进度、计划、搜索、文件修改与工具操作整理为中文过程时间线。

侧边栏上传或粘贴的图片会先发到本机 Canvas Agent,再由 Canvas Agent 临时写入本机文件并作为 app-server localImage 输入传给 Codex;前端会提示附件体积,单次请求体限制为 30MB。

Claude Code

Claude Code Adapter 代码暂时保留,但当前网页侧边栏只开放 Codex。后续开放 Claude 入口时,Canvas Agent 会调用本机 claude -p --output-format stream-json 并把流式 JSON 事件转发到侧边栏。

如果希望 Claude Code 也能操作画布,需要给 Claude Code 添加同一个 MCP。建议用 user scope,避免 Canvas Agent 从不同目录启动时找不到配置:

claude mcp add --scope user --transport stdio picnode -- npx -y @felores/picnode-agent mcp

本仓库开发时可以改成:

claude mcp add --scope user --transport stdio picnode -- node /path/to/infinite-canvas/canvas-agent/dist/index.js mcp

Canvas Agent 调用 Claude Code 时会默认带上 --allowedTools mcp__picnode__*,画布写操作仍由网页侧边栏确认。