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-pi-anchored-standard

v0.14.1

Published

Anchored tool catalog for omp and pi: first request exposes a task-routed bootstrap catalog (default deepseek-v4-pro, routerMode standard/spec), a capped output budget, and the DSH minimal/route persona; full catalog or resident set + normal budget after

Readme

omp-pi-anchored-standard

omp(Oh My Pi)和 pi(pi-coding-agent)使用的 "anchored standard" 插件。核心思路:把目标模型的第一个请求锚定到最小工具目录 + DSH 人设,在会话记录到第一个持久提升信号后恢复 resident 工具集(默认,避免上游实测的 post-promotion 轨迹回退;显式 promotedTools: [] 可恢复完整工具目录)与正常预算。

默认零配置可用:未配置 anchoredTools 时自动锚定 deepseek-v4-pro(纯 anchored-standard)与 deepseek-v4-flash(任务感知路由 Flash 最优档),两套配置分别存放在 modelConfigs,不再共用同一套。实测稳定复现 We need 风格;上游参考 dsh-anchored-standarddsh-routing-suite

这是 prompt 条件化实验补丁,不是正确性保证;底层评测是单一私人评测,不是普适结论。插件无网络请求、无遥测。

为什么存在

DeepSeek V4 Pro 对 API 可见的工具目录高度敏感。Project2 评测(DeepSeek V4 Pro,reasoningEffort=max):

| Preset | Ability (run1/run2) | let me 计数 | 工具目录 | | --------------------- | ------------------: | ------------: | --------------- | | Standard | 91 | 208 | 完整(25 个) | | PTC | 92 | 194 | run_code | | Minimal | 99 / 96 | 0 / 0 | 2 个 | | Anchored Standard | 98 / 99 | 1 / 0 | 先 2 个,后完整 |

宽工具目录对首请求有害(高 let me、计划退化),但永久停在 Minimal 会丢掉 Standard 的工具集。因此采用两阶段:

  1. 第一个模型请求 → 只暴露首轮核心工具(bootstrapMode: "two-tool",默认),或零工具 + 固定 anchor 回合(bootstrapMode: "zero")。
  2. 第一个持久提升信号之后(按 promoteOn)→ 默认恢复上游实测的 post-promotion resident 工具集(shell + 常用文件工具),避免 25 个工具一次性灌回导致轨迹回退;显式配置 promotedTools: [] 可恢复完整目录(能力无损失)。

工作原理

第一请求                          持久提升信号后                 compaction 后
────────────────────             ────────────────────          ────────────────────
two-tool: shell + read           resident 默认 / 完整目录(显式[])  bootstrap 工具 + compactionTools
zero:     空工具 + anchor 回合    resident 默认 / 完整目录(显式[])  空 / shell + compactionTools
  • 阶段从持久会话条目推导(getBranch() / buildContextEntries()),/resume/reload 自动保留。
  • 每个锚定阶段只变一次(一次 request-prefix cache 断层)。
  • compaction 后作为「第二个首请求」重新收窄,直到新的持久提升信号出现。
  • 提升决策按会话 id 在进程内记忆;session_compact 后重置该会话的 memo(对齐上游 compaction-epoch.mjs)。
  • 失败的 tool call 也算持久信号 → 提升。

安装

当前版本:[email protected]

omp

omp plugin install omp-pi-anchored-standard

或从仓库安装:

omp plugin install github:Aurzex/omp-pi-anchored-standard

没有 bun 时手动拷贝:

mkdir -p ~/.omp/agent/extensions
cp -r /path/to/omp-pi-anchored-standard ~/.omp/agent/extensions/omp-pi-anchored-standard

pi

pi install omp-pi-anchored-standard

或加入 ~/.pi/agent/settings.jsonpackages

{ "packages": ["git:github.com/Aurzex/[email protected]"] }

版本锁:git 安装可用 @v0.14.1(pi)/ #v0.14.1(omp);npm 安装默认 latest0.14.1)。

配置

配置统一放在宿主设置里的 anchoredTools 顶层键。项目配置深合并覆盖全局:嵌套对象递归合并、数组整体替换(不拼接)、项目优先。

| 配置项 | 类型 / 默认值 | 说明 | | -------------------------- | ------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | | enabled | boolean / true | 总开关 | | models | string[] / ["deepseek-v4-pro", "deepseek-v4-flash"] | 目标模型 glob;含 / 只匹配 provider/modelId,裸名两种都匹配;[] 不锚定任何模型 | | modelConfigs | Record<string, RawConfig> / 内置 pro+flash 档 | 按模型 glob 分别存放的配置覆盖;缺省时零配置启用内置两档,显式 models 后回退为单一共享配置 | | bootstrapMode | "two-tool" \| "zero" / "two-tool" | 首轮工具面模式 | | bootstrapTools | string[] / ["bash", "read"] | two-tool 模式首轮工具;bash/pwsh 按平台 shell 归一化 | | promoteOn | "tool-call" \| "assistant-message" \| "either" / "either" | 持久提升信号 | | minimalSystemPrompt | boolean / true | 系统提示改写为 DSH minimal 人设(永久生效) | | bootstrapMaxTokens | number \| undefined / 不封顶 | 可选首请求输出预算封顶;仅 pi 生效 | | taskRouting | boolean / false | 任务感知路由,仅 two-tool 模式 | | routerMode | "standard" \| "spec" / "standard" | taskRouting: true 时生效;standard=RL 接口还原,spec=深度思考优先 | | suppressedContextSources | string[] / ["skill-catalog", "agent-instructions"] | 首请求剥离的自动注入上下文;[] 关闭剥离 | | compactionTools | string[] / [] | compaction 后、重新提升前的工作集 | | promotedTools | string[] / ["bash", "read", "edit", "glob", "grep"] | 提升后 resident 工具集(默认,对齐上游 post-promotion);[] = 恢复完整目录 | | includeSubagents | boolean / false | true 时子代理也走 bootstrap/anchor 阶段;omp 生效 | | anchorText | string / This round is a test. ... | zero 模式 anchor 文本 | | notify | boolean / true | 提升时一次性 TUI 通知 |

omp 示例

全局 ~/.omp/agent/config.yml 或项目 <项目>/.omp/config.yml

anchoredTools:
    enabled: true
    models:
        - deepseek-v4-pro
        - deepseek-v4-flash
    modelConfigs:
        deepseek-v4-pro:
            bootstrapTools: [bash, read]
            promoteOn: either
            promotedTools: [bash, read, edit, glob, grep]
        deepseek-v4-flash:
            taskRouting: true
            routerMode: spec
            promoteOn: tool-call
            promotedTools: []
    bootstrapMode: two-tool
    bootstrapTools:
        - bash
        - read
    notify: true

改完重启 omp。

pi 示例

全局 ~/.pi/agent/settings.json + 可信项目的 .pi/settings.json

{
	"anchoredTools": {
		"enabled": true,
		"models": ["deepseek-v4-pro", "deepseek-v4-flash"],
		"modelConfigs": {
			"deepseek-v4-pro": {
				"bootstrapTools": ["bash", "read"],
				"promoteOn": "either",
				"promotedTools": ["bash", "read", "edit", "glob", "grep"],
			},
			"deepseek-v4-flash": {
				"taskRouting": true,
				"routerMode": "spec",
				"promoteOn": "tool-call",
				"promotedTools": [],
			},
		},
		"bootstrapMode": "two-tool",
		"bootstrapTools": ["bash", "read"],
		"notify": true,
	},
}

行为细节

modelConfigs

零配置时内置两套独立默认档(分别对应上游实测最优):

| 模型 | 默认档 | | ------------------- | -------------------------------------------------------------------------------------------------- | | deepseek-v4-pro | 纯 anchored-standard:taskRouting: falsepromoteOn: either、resident 集 | | deepseek-v4-flash | 路由套件 Flash 档:taskRouting: truerouterMode: specpromoteOn: tool-call、提升后完整目录 |

  • 键是模型 glob(匹配规则与 models 相同),值是 anchoredTools 允许的任意键覆盖。
  • 显式配置 modelConfigs 时,每个模型先继承共享顶层配置、再由自身档覆盖(deepMerge)。
  • 显式给出 models(数组)但未给 modelConfigs 时,回到旧的「所有目标模型共用一套顶层配置」行为,不启用内置档。

promoteOn

  • tool-call:第一个持久 tool call 后提升。
  • assistant-message:第一个持久 assistant 消息后提升。
  • either(默认):两者先到者,纯文本首答也会在下一轮提升。
  • zero 模式固定使用 assistant-message(anchor 回复),忽略 promoteOn

bootstrapTools

默认 ["bash", "read"],对应 modeltest 98/99 分 anchored-standard 快照的 shell + readbash/pwsh 会按目录里实际存在的平台 shell 归一化(pwsh 优先)。若目录存在 str_replace_editor,可显式配置 ["bash", "str_replace_editor"] 复刻上游 Minimal 精确 schema。

taskRouting + routerMode

taskRouting: true 后,routerMode 决定首轮行为:

  • standard(默认):RL 接口还原。系统只保留 DSH minimal 人设,工具面为 shell + str_replace_editor;目录缺 str_replace_editor 时回退到 bootstrapTools
  • spec:旧版深度思考优先。按任务分类选择 persona 与工具面:
    • react(新建/开发)→ doer persona + read/write/edit
    • spec(修复/维护)→ minimal persona + read/edit/glob/grep
    • weak(模糊/无关键词)→ 模型自分类 persona + read/write/edit
    • Flash 模型一律强制 weak(w7 + 静态深度思考/决策闭环锚)。

suppressedContextSources

  • 首请求剥离自动注入的 AGENTS.md / skill-catalog / workspace 摘要。
  • 消息带 source.kind 时按来源精确过滤;omp/pi 消息无 source.kind 时重建为 [system, last user]
  • 含 assistant/toolResult 的多轮历史不重建。
  • 显式配置 [] 关闭剥离。

bootstrapMaxTokens

  • 默认不封顶。上游 issue #11 实测 Minimal 工具 schema 在适配器默认 maxTokens(256000)下即可锚定 We need 轨迹。
  • 配置后才封顶,提升后剥离注入的上限。
  • 仅 pi 生效。omp 无原生 max-token setter,且 before_provider_request 返回值被 openai-completions 传输层丢弃,故 omp 只校验该配置。

promotedTools

  • 默认 ["bash", "read", "edit", "glob", "grep"]:提升后保留 shell + 常用文件工具,对齐上游 post-promotion resident 行为,避免完整目录一次性灌回导致的轨迹回退。
  • 显式 []:提升后恢复完整目录(保留原插件“能力无损失”的选项)。
  • 非空自定义:提升后只保留指定工具;bash/pwsh 按平台 shell 归一化;缺失时 fail-safe 保持完整目录。

includeSubagents

  • 默认 false:子代理始终完整目录。
  • true:omp 子代理(session_init 条目)也走 bootstrap/anchor 阶段。
  • pi 无 session_init,该选项主要对 omp 生效。

zero 模式

  • 首请求工具集置空,并把最后一个 user 消息内容替换为 anchorText
  • anchor 回复落库后提升。
  • 与上游差异:上游会把真实消息自动推迟到下一轮;本插件无法安全推迟持久化消息,因此 anchor 轮结束后需要用户继续一句,真实消息在后续轮次用完整目录/resident 集回答。
  • compaction 后不再注入 anchor;配置 compactionTools 则暴露平台 shell + 工作集,否则保持零工具直到新的 assistant 消息。

验证

会话里运行:

/anchored-tools

报告当前模型、是否命中目标、模式、任务路由、routerMode、提升触发器、当前阶段(bootstrap / promoted (full catalog) / promoted (resident catalog) / not-targeted / disabled)以及轨迹指纹(we / let's / let me)。

首次锚定与系统提示改写会打日志:

[anchored-tools] anchoring first request for deepseek/deepseek-v4-pro: 2/25 tools (bash, read)                                       # two-tool (default)
[anchored-tools] anchoring first request for deepseek/deepseek-v4-pro: 5/25 tools (read, edit, glob, grep, bash) [task-routing spec]   # two-tool
[anchored-tools] anchoring first request for deepseek/deepseek-v4-pro: 4/25 tools (read, write, edit, bash) [task-routing react]      # two-tool
[anchored-tools] anchoring first request for deepseek/deepseek-v4-flash: 0 tools (zero-tool anchor)                                  # zero
[anchored-tools] deepseek/deepseek-v4-pro: system prompt → route persona (react)                                                     # taskRouting

开发

npm install
npm run typecheck   # tsc --noEmit
npm test            # node --test(原生 TS,无需 bun;bun 环境同样可跑 node:test)

目录结构

src/
  core.ts   # 共享纯逻辑:promotion / bootstrap / router / prompt / config
  omp.ts    # omp 入口:setActiveTools + context 注入 anchor + systemPrompt
  pi.ts     # pi 入口:before_provider_request + buildContextEntries
test/
  core.test.ts   # node:test 单测(143 例)

更新记录

0.14.1

  • 性能:filterTools 单遍提取工具名并直接过滤,避免对同一 catalog 重复调用 toolName
  • 性能:toolNames 改为单遍收集;countMatches 改用 String.prototype.match 计数。
  • 性能:trajectory 指纹计数合并为单次正则扫描(let me / we / let's)。

0.14.0

  • 默认同时锚定 deepseek-v4-prodeepseek-v4-flash,两模型各自使用独立内置档(modelConfigs),不再共用同一套配置。
  • Pro 档:纯 anchored-standard(taskRouting: falsepromoteOn: either、resident 集)。
  • Flash 档:对齐 dsh-routing-suite / v4-flash-godmode-opencode-go(taskRouting: truerouterMode: specpromoteOn: tool-call、提升后完整目录)。
  • 显式 models 数组但未给 modelConfigs 时保持旧的单一共享配置行为;文档与测试同步更新。

0.13.0

  • 对齐上游 dsh-anchored-standard 最新 post-promotion resident 行为:promotedTools 默认从 [](完整目录)改为 ["bash", "read", "edit", "glob", "grep"](shell + 常用文件工具)。
  • 显式 promotedTools: [] 仍恢复完整目录,保留原插件选项;缺失工具时继续 fail-safe 保持完整目录。
  • 文档与测试同步更新。

0.12.0

  • 性能:新增 omp/pi 配置文件按 mtime/size 缓存,避免每次 hook 重复读盘解析。
  • 性能:关闭 taskRouting 时不再扫描会话/消息做任务分类;glob 正则缓存改为逐条淘汰而不是整表清空。
  • 交互:pi 的 /anchored-tools 现在与 omp 一致显示实际生效的 bootstrap 工具集及来源(router / configured)。
  • 逻辑:stripContextMessages 改为单次遍历并提前返回,保持原语义。

0.11.1

  • 重写并优化 README:更清晰的结构、完整配置表、安装/验证/限制说明。
  • 无功能变更。

0.11.0

  • 对齐 dsh-router-standard v0.2.0/v0.2.1:
    • 新增 routerModestandard 默认 / spec)。
    • standard:RL 接口还原,首轮系统只保留 DSH minimal 人设,工具面为 shell + str_replace_editor
    • spec:旧版任务分类 persona + 读/写/编辑工具面。
  • omp/pi 双入口的 taskRouting 均支持 routerMode/anchored-tools 显示当前 routerMode
  • 文档与测试同步更新(136 例)。

0.10.0

  • 对齐上游 dsh-anchored-standard 最新版:promoteOn 默认改为 either
  • 新增 promotedTools:提升后可切换到上游 resident 工具集,默认 [] 仍恢复完整目录。
  • 新增 includeSubagents:默认 false 豁免子代理;true 后 omp 子代理也走 bootstrap/anchor 阶段。
  • omp/pi 双入口同步支持上述配置;/anchored-tools 增加 promoted (resident catalog)promoted tools 展示。

0.9.0

  • 默认对齐 modeltest 98/99 分 anchored-standard 高分开局。
  • 支持 omp/pi 双宿主、zero 模式、任务路由、上下文剥离、compaction epoch。

已知限制

  • omp 用 setActiveTools 收窄活动工具集;pi 用 before_provider_request payload 过滤。
  • omp 的 before_provider_request payload 替换对 openai-completions 传输无效,因此 omp 入口不依赖它。
  • bootstrapMode: "zero" 的 anchor 轮结束后需要用户继续一句,真实消息不自动推迟。
  • pi 无 session_init,子代理豁免(includeSubagents: false)仅 omp 能识别。
  • bootstrapMaxTokens 默认不封顶且仅 pi 生效。
  • models 默认 ["deepseek-v4-pro", "deepseek-v4-flash"];显式配置 [] 可关闭锚定。零配置下两模型各自使用 modelConfigs 内置档,显式 models 数组则回到单一共享配置。

参考实现

本插件是以下上游实测 preset 的 omp/pi 移植:

| 路径 | Flash | Pro | | ----------- | ------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | | 官方 API | dsh-routing-suite(dsh-router-standard) | dsh-anchored-standard | | opencode-go | v4-flash-godmode-opencode-go | myDshPresets |

采纳要点:

  • bootstrapTools 默认 ["bash", "read"],omp/pi 用宿主等价 shell + read;存在 str_replace_editor 时可显式切回 Minimal 精确 schema。
  • routerModestandard/spec)移植自 dsh-router-standard v0.2.0。
  • Flash 在 taskRouting 下强制 weak,并静态并入 w7 深度思考/决策闭环锚。
  • 平台 shell 选择 pwsh 优先。
  • compactionTools / compaction epoch 移植自 compaction-epoch.mjs
  • promotedTools 默认 resident 集,对应上游 post-promotion resident 行为;显式 [] 保留完整目录。
  • zero 模式与 suppressedContextSources 对应 zero-anchored-standard / whoami-standard。

License

MIT。概念移植自 xiaobright/dsh-anchored-standard(MIT)、yjh051108/dsh-routing-suite(MIT)、SheberDavid/v4-flash-godmode-opencode-go(MIT)与 dbydd/pi-anchored-tool-for-dspro(MIT)。与 DeepSeek / pi 项目无关联,未经其背书。