dshbase

插件目录 / AI Models / pi-deepseek-anchor

pi-deepseek-anchor

已验证 · 实测可装 kxh4892636

✓ 持续维护 纯 TypeScript

查看 GitHub ↗ ← 返回插件目录

14Stars
1Forks
1未关闭 issue
TypeScript语言
2026-08-15最近推送
跨平台平台

功能简介

pi扩展:DeepSeek V4 Pro最小锚定引导,然后完整标准工具。

✅
我们的评价
可用 — 实测通过,早期项目

pi扩展:DeepSeek V4 Pro最小锚定引导,然后完整标准工具。 实测能干净安装、正常启动。早期项目,但功能可用。

「已验证」表示我们的自动化 CI 在干净 profile 里实际执行了 dsh plugin add 并启动成功——仅此而已。功能描述与版本兼容性均为作者声明。这不是安全审计,也不代表对第三方代码的背书。

README

pi-deepseek-anchor

锟斤拷锟斤拷说锟斤拷锟斤拷README.zh-CN.md

pi-deepseek-anchor enables the full-powered DeepSeek V4 Pro to run at full strength in pi, with significantly improved results (Project2: 91锟紺92 锟斤拷 98锟紺99).

Cause DeepSeek V4 Pro selects its trajectory based on the API-visible tool catalog. With the default full catalog, the first response typically starts with "Let me..." and follows the Standard trajectory (Project2: 91锟紺92). With the official Minimal pair (bash + str_replace_editor), the first response starts with "We need..." and produces zero let me (Project2: 98锟紺99). Staying on Minimal permanently loses the full toolset. This extension applies Minimal only to request #1 and restores the full catalog from request #2, so both are retained in one session.

Install

pi install npm:pi-deepseek-anchor

Or from GitHub:

pi install git:github.com/kxh4892636/[email protected]

Then /reload or restart pi. Works with the full-powered DeepSeek V4 Pro official release.

Manual fallback: copy index.ts to ~/.pi/agent/extensions/anchored-standard/index.ts (global) or <project>/.pi/extensions/anchored-standard/index.ts (project-local).

Behavior

Request #1 (bootstrap) Request #2+ (promoted)
Tools bash + str_replace_editor, byte-identical to the official Minimal preset full pi tool catalog
System prompt You are a helpful software engineer assistant. (46 chars) persona remains; stripped pi context returns as a user message
Output budget adapter default (no cap; bootstrapMaxTokens is opt-in) adapter default

Promotion fires on the first durable signal: the first assistant message or the first tool call, whichever comes first (promoteOn: "either" default). State is durable, so /resume and reload preserve the phase.

pi adaptation

Upstream (dsh preset) pi port
Minimal tool rows pi.registerTool overrides: bash uses the byte-identical Minimal description and delegates to pi's built-in createBashTool; str_replace_editor implements the official schema and upstream filesystem semantics (view / create / str_replace / insert, 16000-char truncation, exact error messages)
tool-bootstrap pre-step filter before_agent_start + before_provider_request: request #1 is Minimal-exact; late appends (e.g. pi-memory) are dropped on request #1 and moved to a user message after promotion
Persona row (complete: true) minimalPersona + personaScope: "always" (default): persona remains the system prompt for the whole session; stripped context is re-delivered as a user message from request #2
Durable event scan phase derived from pi's durable session branch plus a dsh-anchored-state custom entry
Zero-Anchored Standard mode zeroAnchor: true in PI_DSH_ANCHOR_CONFIG

Verification

End-to-end with official deepseek-v4-pro, reasoningEffort=max, --mode rpc:

REQ#1: tools=[bash, str_replace_editor]
       system='You are a helpful software engineer assistant.' (46 chars)
       first thinking: "We need answer briefly about repository. Need inspect. Use tools."
REQ#2: full tool catalog + normal pi context (delivered as a user message)

Configuration

Edit DEFAULT_CONFIG in index.ts, or override at runtime:

{"promoteOn": "tool-call", "bootstrapMaxTokens": 1024, "personaScope": "always"}

Keys: bootstrapTools (default ["bash","str_replace_editor"]), promoteOn (either | tool-call | assistant-message), bootstrapMaxTokens (optional; unset = no cap), minimalPersona (default true), personaScope (always | bootstrap, default always), personaText, stripContext, zeroAnchor (default false), zeroAnchorText, editorMaxOutputChars (default 16000).

Verify & debug

  • /dsh-anchor prints the phase; /dsh-anchor promote promotes now; /dsh-anchor on|off re-arms/disables the bootstrap for the session.
  • The TUI footer shows bootstrap: bash/str_replace_editor until promotion.
  • PI_DSH_ANCHOR_DEBUG=1 dumps assembled payloads to PI_DSH_ANCHOR_DEBUG_FILE (default /tmp/dsh-anchor-debug.jsonl).

Type check

npx tsc -p tsconfig.check.json

Adjust the three paths entries in tsconfig.check.json to the installed pi type-definition locations.

Files

  • package.json 锟斤拷 pi package manifest
  • index.ts 锟斤拷 pi extension (single file, zero runtime deps)
  • README.zh-CN.md 锟斤拷 Chinese documentation
  • tsconfig.check.json 锟斤拷 type-check config
  • LICENSE 锟斤拷 MIT, including upstream copyright notices
  • NOTICE 锟斤拷 upstream derivation notice

License

MIT. index.ts is a port of the MIT-licensed upstream preset; original copyright notices are retained.

Upstream

This project is a pi port of xiaobright/dsh-anchored-standard. The upstream README and methodology are the basis for this port:

安装

🧩 让 Agent 自动装(推荐)

装一次目录插件,之后本站所有插件都能让 DeepSeek Harness 自动找、自动装:

dsh plugin add dshbase-catalog

然后对 agent 说「帮我装 pi-deepseek-anchor」,它会在目录里找到并自动安装。文档:dshbase-catalog · 已验证场景包。

该插件是 GitHub 源码(未发 npm)——直接从仓库装:

Web profile:

dsh plugin --profile web add github:kxh4892636/pi-deepseek-anchor

Headless(CLI)profile:

dsh plugin --profile headless add github:kxh4892636/pi-deepseek-anchor

实测报告

验证通过:从 GitHub 源码完成 L1 安装 + L2 加载 + L3 运行(dsh 0.1.0-rc.6)。

使用场景

把一个新模型、provider 或路由策略接入循环,让 dsh 能为任务选对脑子。

适合谁

同时用多个模型或 provider、想让成本/质量/延迟自动平衡的人。

二次开发建议

provider 适配器和路由启发式是缝——加后端、调回退链,或加按任务的模型选择。

安全:尚未扫描——我们的每日静态扫描将很快覆盖它。

分享徽章

AI Models 里更多

浏览全部 7797 个插件 →