@mengyuly/dsh-ponytail 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +58 -0
- package/cordis.patch.yml +4 -0
- package/lib/index.js +2520 -0
- package/lib/invariant.js +23 -0
- package/lib/types/content.d.ts +25 -0
- package/lib/types/index.d.ts +37 -0
- package/lib/types/instructions.d.ts +24 -0
- package/lib/types/invariant.d.ts +16 -0
- package/lib/types/modes.d.ts +69 -0
- package/package.json +47 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 DietrichGebert (original ponytail)
|
|
4
|
+
Copyright (c) 2026 MengYuil (DeepSeek Harness port)
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# dsh-ponytail
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
把 [DietrichGebert/ponytail](https://github.com/DietrichGebert/ponytail)(「懒惰资深开发者」最少代码心智)移植成 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 原生插件。功能与效率与上游一致:7 级阶梯规则集每轮注入、强度切换、`/ponytail-*` 斜杠命令。
|
|
6
|
+
|
|
7
|
+
## 安装
|
|
8
|
+
|
|
9
|
+
装进某个 profile(`web` 可换成 `tui`/自定义名):
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
# 方式一:本地链接(当前 dsh 核 ≥ 0.1.x)
|
|
13
|
+
dsh plugin --profile web add link:$(pwd)
|
|
14
|
+
|
|
15
|
+
# 方式二:GitHub 直接装
|
|
16
|
+
dsh plugin --profile web add github:MengYuil/dsh-ponytail
|
|
17
|
+
|
|
18
|
+
# 方式三:Release 打包件(先下 tgz)
|
|
19
|
+
dsh plugin --profile web add file:./mengyuly-dsh-ponytail-0.1.2.tgz
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
装完重启 profile 生效(`dsh web` / `dsh tui`)。装载完成后,会话技能目录里会出现 6 个 `ponytail*` 技能,发 `/ponytail-help` 立即验证。
|
|
23
|
+
|
|
24
|
+
> `lib/index.js` 是自包含 bundle(已内联 `dsh-llm` / `dsh-skill`),运行时只依赖 `@deepseek-ai/cordis` peer(registry 有 4.0.1),所以 GitHub / tgz / npm 三种安装方式都不需要 dsh 源码树。
|
|
25
|
+
|
|
26
|
+
> 说明:`src/` 是源码、`lib/` 是预构建产物(开箱即可加载,无需编译)。源码主仓在 deepseek-harness 的 `packages/community/ponytail`,改源码后回主仓重建,再把 `lib/` 同步回本仓库即可发版。本地改 `src/` 想快速验证编译,可用 `DSH_CHECKOUT=/path/to/deepseek-harness ./scripts/build.sh`(只做类型检查)。
|
|
27
|
+
|
|
28
|
+
## 功能
|
|
29
|
+
|
|
30
|
+
- **核心模式** `/ponytail` — 每轮注入「懒惰阶梯」:能不做就不做(YAGNI)→ 代码库已有 → 标准库 → 平台原生 → 已装依赖 → 一行能解决 → 才是最少代码。
|
|
31
|
+
- `full`(默认)/ `lite` / `ultra` / `off` 四档,会话级。
|
|
32
|
+
- `/ponytail default <mode>` 持久化默认值。
|
|
33
|
+
- **一次性技能**(用哪个载哪个,不进常驻 prompt):
|
|
34
|
+
- `/ponytail-review` — 针对最近改动找过度工程,一行一条:位置 + 删什么 + 替代。
|
|
35
|
+
- `/ponytail-audit` — 全仓库过度工程审计,排序清单。
|
|
36
|
+
- `/ponytail-debt` — 收割所有 `ponytail:` 注释成债务账本。
|
|
37
|
+
- `/ponytail-gain` — 收益计分板(更少代码/更省成本/更快)。
|
|
38
|
+
- `/ponytail-help` — 参考卡。
|
|
39
|
+
- **停用**:说 `stop ponytail` 或 `normal mode`;随时 `/ponytail` 恢复。
|
|
40
|
+
- **默认值**:环境变量 `PONYTAIL_DEFAULT_MODE` > `~/.config/ponytail/config.json` 的 `{"defaultMode": "lite"}` > `full`。
|
|
41
|
+
- **子代理**:常驻段作用于当前会话自身;DSH 内置 `subagent` 工具跑的是隔离的全新子代理、不继承本 persona。`PONYTAIL_SUBAGENT_MATCHER`(匹配子代理 `agentPreset` 的正则)用于在 harness 会下发给子代理的场景里排除指定子代理;缺省全部注入。
|
|
42
|
+
|
|
43
|
+
## 效率
|
|
44
|
+
|
|
45
|
+
- 常驻注入 ≈ 1.3k tokens/请求,`off` 归零;同模式字节级稳定,KV-cache 前缀命中,切模式后才重算一次。
|
|
46
|
+
- 一次性技能 300–540 tokens 一个,零常驻开销。
|
|
47
|
+
- 实测同任务 A/B:ponytail 臂 34 行 vs 完整实现臂 272 行,均标准库、均自测通过。
|
|
48
|
+
|
|
49
|
+
## 已知限制
|
|
50
|
+
|
|
51
|
+
- 强度档位只切换阶梯表格/示例,阶梯正文恒定;lite/full/ultra 体积差异很小(行为倾向,非大小差异)。
|
|
52
|
+
- 上游 Claude 专属的 statusline 徽标无 DSH 对应物,MCP 服务器因 DSH 有一等 system-prompt 注入点而弃用。
|
|
53
|
+
- 配置文件的默认档位热更新(fs 轮询 ~1s,作用于无覆盖的会话);环境变量改动仍需重启。
|
|
54
|
+
- 发行 `lib/` 是预编译产物;改源码请回主仓重建后同步。
|
|
55
|
+
|
|
56
|
+
## 许可
|
|
57
|
+
|
|
58
|
+
MIT,© 2026 DietrichGebert(上游)+ MengYuil(移植)。详见 [LICENSE](LICENSE)。
|
package/cordis.patch.yml
ADDED