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

pi-next-hint

v0.1.5

Published

Pi 下一句提示:中英双语、混合输入与本轮缓存。Next-message hints for Pi with Chinese/English support and per-turn caching.

Readme

pi-next-hint

中文

为 Pi 预测下一条消息,支持中文、英文和混合输入。提示显示在空输入框中;输入时隐藏,清空后恢复本轮缓存。按 Tab 或右箭头接受为可编辑草稿,提示不会自动发送。

English

Predict your next message in Pi, with Chinese, English and mixed-language support. Hints appear in the empty composer, hide while typing, and return from the current turn’s cache when cleared. Press Tab or Right Arrow to accept a hint as an editable draft. Suggestions are never sent automatically.

Benchmark / 实测摘要

中文

2026-10-15,使用 gpt-6.1-sol、high,在复杂多轮对话及写作、设计、研究、生活规划、普通聊天的合成场景中完成 136 次请求,每组 68 次。包含压力变体和名称指代补充场景;复杂及补充场景每点 3 次,通用场景每点 2 次。双方使用相同模型、推理强度和上下文,并发 4,30 秒截止,不自动重试,失败记录全部保留。

对照组是历史 Codex 提示词重放,不是 Codex App 实际输出。 Pi 组使用官方远程提示词版本 5 加 Pi JSON 格式适配。运行代码与 0.1.3 相同,后续 0.1.4、0.1.5 仅更新公开文档和发布隐私检查。

English

On October 15, 2026, we completed 136 synthetic requests, 68 per arm, covering complex multi-turn dialogue, writing, design, research, life planning, and casual chat, including stress variants and reference-resolution cases. Complex and supplementary cases were sampled three times each; general cases twice. Both arms used gpt-6.1-sol, high reasoning, identical context, concurrency four, and a 30-second deadline, with no automatic retries. All failures were retained.

The comparator is a historical Codex prompt replay, not native Codex App output. The Pi arm uses remote prediction prompt version 5 with Pi's JSON-format adapter. Runtime code matches 0.1.3; versions 0.1.4 and 0.1.5 update public documentation and release privacy checks only.

| Metric / 指标 | Pi Next Hint | Historical Codex prompt replay / 历史提示词重放 | | --- | ---: | ---: | | Requests / 请求 | 68 | 68 | | Valid hints / 合法提示 | 66 | 67 | | Request errors / 请求错误 | 2 | 1 | | Timeouts / 超时 | 0 | 0 | | Explicit null responses / 明确返回 null | 0 | 0 | | Valid-hint completion median / 合法提示完整返回中位数 | 6.96 s | 8.17 s | | Valid-hint completion P95 / 合法提示完整返回 P95 | 10.32 s | 10.94 s | | Median tokens per request with known usage / 每次已知 token 中位数 | 520 | 579 | | Reported token total / 已报告 token 合计 | 65,369 (66 requests / 次) | 70,374 (67 requests / 次) | | All rubric requirements covered, manual review / 人工评审全部要求覆盖 | 63/68 | 63/68 |

中文解读与限制

  • 双方均成功的 65 个配对样本中,Pi 组请求耗时中位数为 6.99 秒,对照组为 8.16 秒;本轮低约 14.4%。配对样本已报告 token 合计分别为 64,893 和 69,080,本轮少约 6.1%。这些是本轮样本的描述性结果,不是稳定性能保证。
  • 合法提示只表示请求成功且格式可用,不代表预测命中。合成场景没有实际下一条用户消息作为真值;人工要求覆盖由同一助手评审,非独立盲评,场景也曾用于开发迭代。其中一项 CI 要求没有在该场景可见对话中明确提出,因此覆盖分数需谨慎解释。没有证据据此宣称比 Codex App 更准。
  • 三次请求错误的 token 用量未知,不按 0 计算;表中合计仅包含已报告用量。reasoning token 已包含在 output 中,不重复相加。SDK 成本估算不是账户账单。耗时从请求开始到完整结果解析,未计终端绘制;并发、网络、上下文长度和服务状态会影响结果。0 次观察到的超时不保证以后不会超时。
  • 这里只公开汇总。完整逐次结果、原始会话和本地证据留在本地,不进入 npm 包或 Git 提交。

English interpretation and limitations

  • Across 65 paired cases where both arms succeeded, median request latency was 6.99 seconds for Pi versus 8.16 seconds for the replay, 14.4% lower in this run. Reported token totals were 64,893 versus 69,080, 6.1% lower in this run. These are descriptive sample results, not a general performance guarantee.
  • A valid hint means successful, usable output, not an accurate prediction. The synthetic cases have no observed next-user-message ground truth. Requirement coverage was judged by the same assistant, not an independent blind reviewer, on scenarios previously used during development. One CI rubric requirement was not explicitly stated in its visible conversation, so coverage scores need careful interpretation. These results do not establish higher accuracy than Codex App.
  • Token usage for three failed requests is unknown, not zero; totals cover reported usage only. Reasoning tokens are a subset of output and are not added twice. SDK cost estimates are not account billing. Latency runs from request start to complete result parsing, excluding terminal rendering. Concurrency, network, context length, and service conditions affect performance. No observed timeout does not guarantee future requests will never time out.
  • Only this aggregate summary is public. Complete per-request records, original sessions, and local evidence remain local and are excluded from npm packages and Git commits.

Install / 安装

pi install npm:[email protected]

Restart Pi or run /reload. Reload restores a matching cached hint first. With no cache, an idle session ending in an assistant reply makes one prediction attempt. Empty sessions, drafts and queued work do not trigger catch-up predictions.

重启 Pi 或运行 /reload。优先恢复已有缓存;没有缓存时,空闲且最后消息来自助手的会话会尝试预测一次。空会话、有草稿或存在排队任务时不补预测。

Usage / 使用

  • Tab / Right Arrow: accept the entire hint as a draft. Tab / 右箭头:将整句提示填入草稿。
  • Enter: send your draft; it does not accept an unconfirmed hint. Enter:发送草稿,不接受尚未确认的提示。
  • /next-hint on / /next-hint off: enable or disable. 开启或关闭。
  • /next-hint status: show configuration. 查看配置。
  • /next-hint messages 12: adjust the recent conversation range. 调整最近参考消息数。

Configuration / 配置

Global: ~/.pi/agent/extensions/next-hint.json (respects PI_CODING_AGENT_DIR). Project override: .pi/next-hint.json.

全局配置:~/.pi/agent/extensions/next-hint.json(遵循 PI_CODING_AGENT_DIR)。项目覆盖配置:.pi/next-hint.json。

{ "enabled": true, "recentMessageCount": 8, "contextCharBudget": 12000 }

Predictions use the current Pi model and a separate request with high reasoning and a 30-second deadline. No automatic retries. Requests may time out or return no suggestion. The main conversation's reasoning setting is unchanged. The prompt is Codex App remote prediction config version 5 as observed on 2026-10-14; this is an independent Pi extension, not an official OpenAI product.

预测使用当前 Pi 模型和独立请求,推理强度为 high,30 秒截止,不自动重试。请求可能超时或不返回建议。主会话推理设置不变。提示词采用 2026-10-14 观察到的 Codex App 远程预测配置版本 5;本插件独立实现,并非 OpenAI 官方产品。

Hints are cached locally for the current session, branch leaf and model identity. Editing hides a completed hint; clearing restores it without another request. A new turn, context change or explicit dismissal invalidates the hint. Only TUI mode is supported.

提示按会话、分支节点和模型身份在本地缓存。输入隐藏已完成的提示,清空后恢复,不新增请求。新轮次、上下文变化或主动取消会使提示失效。仅支持 TUI 模式。

Requirements / 环境要求

Node.js >=22.19.0; Pi >=1.2.0 <2. Native Chinese IME candidate behavior still needs manual acceptance. Local test results and raw session evidence are not included in the npm package.

Node.js >=22.19.0;Pi >=1.2.0 <2。原生中文输入法候选框行为仍需手动验收。本地测评原始数据和会话证据不包含在 npm 包中。

Try from a checkout / 从源码试用

From the package directory / 在插件目录执行:

pi -e ./src/index.ts