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

agent-bridge-chatgpt

v1.0.10

Published

agent-bridge 的 ChatGPT Codex CDP 插件。

Readme

ChatGPT(Codex)插件

插件通过 SSH 本地转发和 CDP,向远程 Windows 上已登录的 ChatGPT 桌面端发送消息并读取回复。插件不会保存 ChatGPT 账号或密码。

远程桌面准备

在远程 Windows 的已登录桌面会话中,先正常退出 ChatGPT,再打开 PowerShell 执行以下脚本。脚本每次启动都会按安装版本排序并定位当前的 ChatGPT.exe,因此 Windows Store 更新后不需要修改版本目录:

$ErrorActionPreference = 'Stop'
$candidates = foreach ($package in (Get-AppxPackage | Where-Object { $_.Name -like 'OpenAI.Codex*' })) {
  $appDir = Join-Path $package.InstallLocation 'app'
  $executable = Join-Path $appDir 'ChatGPT.exe'
  if (-not (Test-Path -LiteralPath $executable)) {
    $executable = Get-ChildItem -LiteralPath $appDir -Filter 'ChatGPT*.exe' -File -ErrorAction SilentlyContinue |
      Select-Object -First 1 -ExpandProperty FullName
  }
  if ($executable) {
    [pscustomobject]@{ Version = [version]$package.Version; Executable = $executable }
  }
}
$candidate = $candidates | Sort-Object Version -Descending | Select-Object -First 1
if (-not $candidate) { throw '未找到已安装的 ChatGPT/Codex' }
Start-Process -FilePath $candidate.Executable -ArgumentList '--remote-debugging-port=9230'

如需开机或登录后自动恢复,请让 Windows 计划任务的操作指向这个脚本(powershell.exe -NoProfile -ExecutionPolicy Bypass -File <脚本路径>),不要把操作直接写成带版本号的 WindowsApps 路径。这样任务下次运行时会自动使用更新后的安装目录。

启动后在桌面端确认账号仍处于登录状态。CDP 端口由 SSH 隧道访问,不需要开放到局域网。

插件配置

在 Agent Bridge 的 chatgpt 插件配置中填写:

{
  "sshHost": "100.98.44.120",
  "sshUser": "m2lih",
  "sshKeyPath": "/本机/SSH/私钥路径",
  "remoteCdpPort": 9230,
  "localCdpPort": 9230
}

插件启动时会建立 SSH 转发,并连接本机 127.0.0.1:9230。不配置 SSH 时,可直接连接本机已开启 CDP 的 ChatGPT 页面。

文件、图片和视频附件

请求中的附件通过桌面端原生临时文件接口写入,再作为粘贴附件加入输入框。普通文件和视频使用 file,PNG、JPEG、WebP 图片使用 image;插件不调用图片或视频生成接口。单条消息最多 8 个附件,单个不超过 32 MiB,总计不超过 64 MiB。

插件每轮会附加中文回传约定,要求模型将需要返回的文件副本写入本轮随机临时目录,并在最终回复提供文件链接。Linux/macOS 目录形如 /tmp/agent-bridge-chatgpt-<随机标识>/,Windows 目录为 $env:TEMP\agent-bridge-chatgpt-<随机标识>\。目录必须位于当前会话对应主机;模型需要具备该主机上的文件读写能力。正文可以为空,附件仍会随结构化回复回传。

输出仅读取本轮助手消息中的本地附件链接,并校验会话、随机目录、创建时间和大小。历史消息、跨会话链接、目录外路径、普通正文中出现的路径和远端 URL 都不会被读取;默认的 sandbox:/mnt/data/... 也不属于本轮回传目录。文件名和内容作为附件返回,视频按文件传输。传输能力不代表模型能理解所有附件格式,或当前模型主机具备文件复制权限。

上传失败会清理本轮记录的附件按钮与原生临时文件,已有附件草稿会阻止发送。成功发送后的输入临时文件也会释放;模型创建的输出目录由对应主机按自己的临时文件策略管理。原生接口或页面结构变化会使附件操作明确失败,需要重新验证兼容性。

最近任务与继续会话

插件会在自己的数据目录保存最多 20 条最近 ChatGPT 会话索引(不保存账号、密码或页面 HTML)。Channel 查询以下内容时优先读取本地缓存,缓存过期后才同步一次远程侧栏:

  • 最近任务
  • 列出最近会话
  • 有哪些已保存的 ChatGPT 任务

可以使用 切换会话:任务标题 或 继续处理任务标题 切换到已有会话。切换成功后,同一 Channel 的后续消息会继续发送到该会话;标题重复时插件会返回候选列表,避免误切换。发送“刷新最近任务”可以强制同步侧栏。

缓存默认有效期为 10 分钟,可跨插件重启恢复,并按远程连接隔离。列表覆盖当前已加载的侧栏项目,不代表全部历史会话,也无法推断远程所有任务的精确更新时间。需要其他项目时,先在桌面侧栏展开后刷新列表。

切换会话:任务标题 只切换;切换会话:任务标题;检查进度 会切换并发送后半句;继续处理任务标题 会切换并向该会话发送这条继续指令。也可用列表中的完整会话 ID 指定目标。远程消息、会话切换和 /new 遇到输入框残留时,先将原文、页面地址和时间追加到插件数据目录的 draft-recovery.jsonl,再通过编辑器原生删除操作清理。备份失败、内容发生变化或正在生成回复时不清理、不切换;备份文件包含原始草稿,应按本机用户数据保管。

索引文件为插件数据目录下的 chatgpt-sessions.json,记录最近使用时间和最多 500 字符的最近消息/回复片段。它用于检索会话,不自动生成 Skill;远程暂时不可用时仍可查询已有缓存。

原生历史读取

ChatGPT 原生历史 provider 仅枚举当前页面已加载的侧栏条目,并只读取与活动会话身份一致的正文。每页最多返回 50 个会话或 100 条正文;当前活动会话之外的条目仅可列出,不支持读取。页面虚拟化或未加载的历史无法恢复,因此正文完整性始终标记为不完整;助手消息只采集带消息身份标记的正文,推理、工具、草稿和未完成回复不纳入结果。读取期间若 CDP 断开、会话身份变化、生成仍在继续或正文超过 60,000 字符,会明确拒绝读取,不切换会话或发送消息。