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-v4-jspace

v1.0.0

Published

DeepSeek V4 Minimal Anchor + J-Space runtime integration for Pi

Readme

pi-v4-jspace

面向 Pi Coding Agent 的 DeepSeek V4 Minimal Anchor + J-Space 运行时集成插件——一个包,两项能力:

  1. Anchored Standard 引导(移植自 pi-dsh-minimal):第一次 provider request 被重写为 DeepSeek Harness 官方 minimal 表面(You are a helpful software engineer assistant. + 持久 bash + str_replace_editor),第一次真实 Tool Call 后提升回完整 Pi 表面。
  2. J-Space Cognition Suite V3.6(原样 vendored 自上游,未做任何修改):每个 compaction epoch 通过 steer 消息自动激活一次;fast / full / loop 的 Gate 由 J-Space 自己运行。

非 DeepSeek V4 模型完全不受影响。

安装

pi install npm:pi-v4-jspace      # 或
pi install git:github.com/<owner>/pi-v4-jspace

然后 /reload(或重启 pi)。无需其他安装步骤:pi-dsh-minimal 适配器与 J-Space Skill 都随包自带。

工作原理

用户任务
   │
   ▼
请求 #1 ── payload 重写 ──► system: "You are a helpful software engineer assistant."
   │                        tools: bash, str_replace_editor
   ▼
第一次真实 Tool Call
   │
   ▼
Promote ──► 恢复完整 Pi 工具 + 项目上下文 + AGENTS.md + Skill 目录
   │
   ▼
steer: /skill:j-space Continue the current task from the existing conversation state.
   │    Do not restart work that is already complete.
   ▼
请求 #2 ── 完整 Pi 表面 + J-Space SKILL.md 展开
   │
   ▼
J-Space 自行运行 Gate(fast / full / loop)并继续原任务

关键行为:

  • Bootstrap 是 payload 级重写——在 before_provider_request 重写已组装的 provider payload,而不是 setActiveTools(["bash"])。无法识别 payload 结构时原样透传(fail open)。
  • Promote 以 tool-call 为准(v1.0 固定):首轮纯文字不会提升。
  • 每个 compaction epoch 只激活一次 J-Space——并行多工具调用只激活一次;compaction 后重新锚定,下一次激活使用 long-gap recovery 语义。
  • 会话状态持久化(custom entries):reload / resume / fork 不会重复激活 J-Space。
  • Thinking 级别在模型选中时设置一次 max;你手动调低后状态栏会警告、/v4j doctor 会报告——不与用户反复争夺。

命令

| 命令 | 用途 | | --- | --- | | /v4j | 状态摘要 | | /v4j status | 详细状态 | | /v4j on / /v4j off | 启用 / 完全关闭(恢复原始工具;历史内容保留) | | /v4j reanchor | 重置当前 Runtime Epoch(不动会话内容) | | /v4j doctor | 诊断清单(含可选的 J-Space verify_suite.py) | | /v4j dump on / /v4j dump off | 开关 provider request 调试转储 |

状态栏依次显示 v4j anchoredv4j promoted • jspace pendingv4j promoted • jspace;compaction 后为 v4j re-anchoring • resume,激活失败为 v4j degraded

配置

~/.pi/agent/pi-v4-jspace.json(所有字段均可省略):

{
  "enabled": true,
  "modelPatterns": ["deepseek-v4-pro", "deepseek-v4-flash"],
  "thinking": "max",
  "setThinkingOnModelSelect": true,
  "promotion": "tool-call",
  "jspace": {
    "enabled": true,
    "activateAfterPromotion": true,
    "resumeAfterCompaction": true
  },
  "statusLine": true,
  "debugDump": false
}

v1.0 中 promotion 仅支持 "tool-call";字段保留是为后续兼容。

调试转储

默认关闭。用 /v4j dump on 开启(写入 ~/.pi/agent/pi-v4-jspace-dump.jsonl),或设置环境变量 PI_V4_JSPACE_DUMP=/path/file.jsonl

调试转储可能包含敏感的项目或对话内容。

开发

npm install
npm run typecheck   # tsc -p tsconfig.json
npm test            # vitest run

许可证

MIT。内置组件:J-Space Cognition Suite V3.6(Apache-2.0,原样未改,见 skills/j-space/UPSTREAM-LICENSE)与 pi-dsh-minimal(MIT)。精确源码 commit 见 THIRD_PARTY_NOTICES.mdvendor-meta/