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

omp-mode-switch

v1.6.0

Published

OMP plugin: switch between ask / auto / plan permission modes with Tab key

Readme

omp-mode-switch

npm version License: MIT

一个 OMP 插件,让你在运行中切换三种权限模式。按 Tab 键循环切换,或使用 /mode <ask|auto|plan> 命令。


安装

omp plugin install omp-mode-switch

重启 OMP(或新建会话)即可生效。无需额外操作。

验证

重启后按 Tab 键,编辑器底部会出现模式指示器(ASK/AUTO/PLAN)。启动时应看到:

✓ Mode Switch loaded
  Tab: ASK → AUTO → PLAN → ASK
  /mode <ask|auto|plan>

使用方法

模式

| 模式 | 行为 | |--------|------| | ask | 每个工具调用都需确认(默认) | | auto | 自动批准所有工具调用 | | plan | 只读工具 + .md 文件写入,危险 bash 命令被拦截 |

切换

| 操作 | 效果 | |---------------|------| | Tab | 循环:ask → auto → plan → ask | | /mode ask | 切换到确认模式 | | /mode auto | 切换到自动模式 | | /mode plan | 切换到计划模式 |

状态指示

当前模式以彩色指示器显示在编辑器底部:

  • ASK(黄色)
  • AUTO(绿色)
  • PLAN(蓝青色)

工作流程示例

  1. 探索 — 用 plan 模式安全阅读代码
  2. 规划 — 在 plan 模式下编写 .md 规划文档
  3. 执行 — 切换到 auto 执行修改
  4. 审查 — 切换到 ask 对关键操作逐次确认

每次新会话自动重置为 ask 模式。

工作原理

  • 通过 pi.registerShortcut() 注册 Tab 快捷键
  • 通过 pi.registerCommand() 注册 /mode 命令
  • 拦截 tool_call 事件,在 plan 模式下阻止破坏性工具
  • plan 模式下通过 pi.setActiveTools() 限制可用工具
  • 通过 ctx.ui.setWidget() 显示彩色状态指示
  • package.jsonomp.extensions 中声明,安装时 OMP 自动加载

许可证

MIT