dsh-hiss-plugins 1.0.0 → 1.1.0

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/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # dsh-hiss-plugins
2
2
 
3
- 一个 DeepSeek Harness **bundle 插件**,把四个功能装在一个包里:**colgrep**(语义代码检索)、**codegraph**(代码图 MCP)、**project-mcp**(项目 `.mcp.json`)、**git-bash**(Windows 上的 Git Bash shell)。四个功能各占一条顶层行,可以在 **Plugins 页**里单独开关;包还带一个管理标签,就挂在那个页面上。
3
+ 一个 DeepSeek Harness **bundle 插件**,把六个功能装在一个包里:**colgrep**(语义代码检索)、**codegraph**(代码图 MCP)、**project-mcp**(项目 `.mcp.json`)、**git-bash**(Windows 上的 Git Bash shell)、**superpowers**(superpowers 技能常驻引导)、**ponytail**(ponytail 采纳提示与 `/ponytail` 等级切换)。六个功能各占一条顶层行,可以在 **Plugins 页**里单独开关;包还带一个管理标签,就挂在那个页面上。
4
4
 
5
5
  安装后对 `web`、`headless` 等任意 profile 的**所有 preset、所有会话**生效。
6
6
 
7
- ## 五条行与四个开关
7
+ ## 七条行与六个开关
8
8
 
9
- `cordis.patch.yml` 只做一件事:`insert` 五条**顶层行**。宿主用 `name`(模块说明符)解析模块,用 `id` 记住开关状态。
9
+ `cordis.patch.yml` 只做一件事:`insert` 七条**顶层行**。宿主用 `name`(模块说明符)解析模块,用 `id` 记住开关状态。
10
10
 
11
11
  | 行 id | 模块 | 作用 | 默认 |
12
12
  |---|---|---|---|
@@ -15,8 +15,10 @@
15
15
  | `dsh-hiss-plugins-codegraph` | `dsh-hiss-plugins/codegraph` | 经 MCP 注册 `mcp__codegraph__*` 工具 + 使用引导 | 开 |
16
16
  | `dsh-hiss-plugins-project-mcp` | `dsh-hiss-plugins/project-mcp` | 读会话项目根的 `.mcp.json`,把其中的 MCP server 挂进该 agent 自己的 scope | 开 |
17
17
  | `dsh-hiss-plugins-gitbash` | `dsh-hiss-plugins/gitbash` | Windows 上接入 Git Bash:提供 `ctx.shell` + 宿主 `bash` 工具 | 非 Windows 关 |
18
+ | `dsh-hiss-plugins-superpowers` | `dsh-hiss-plugins/superpowers` | superpowers 技能常驻引导:任何回复前先检查有没有适用的技能,有就先加载(技能集本身由 DSH 原生发现) | 开 |
19
+ | `dsh-hiss-plugins-ponytail` | `dsh-hiss-plugins/ponytail` | ponytail 采纳提示(随等级变化)+ 宿主 `/ponytail` 等级命令 | 开 |
18
20
 
19
- **四条功能行就是 Plugins 页里那四个开关。** 载体行不在标签的开关列表里 —— 它是空的 host 半,但只有它在,浏览器半才会被送进页面;关掉它,管理标签本身就没了。
21
+ **六条功能行就是 Plugins 页里那六个开关。** 载体行不在标签的开关列表里 —— 它是空的 host 半,但只有它在,浏览器半才会被送进页面;关掉它,管理标签本身就没了。
20
22
 
21
23
  为什么必须是顶层行:插件管理器只为「组合后的 patch 里存在同 `id`、同 `name`,且挂载后父 entry 就是 profile 的 `include`」的行持久化开关。包在 `cordis:group` 里的子行在 `listPlugins()` 里被判为 `unaddressable`,**永远不会有开关**。所以这里没有组:git-bash 行把 realm 隔离写在自己身上(见下)。
22
24
 
@@ -28,7 +30,7 @@
28
30
  - 宿主把 `{ id: <行 id>, disabled: <bool> }` 覆盖写进 **profile 自己的** `cordis.patch.yml`(保留注释、原子写)—— 只影响这个 profile,不动包内的 `cordis.patch.yml`,所以升级/重装不会丢开关。
29
31
  - **带 HMR 的 profile 立即生效**(远程结果 `application: "applied"`);**没有 HMR 的 profile 返回 `application: "restart-required"`(`restartReason: "no-hmr"`),重启 dsh 才生效**。
30
32
  - 行不可开关时,`listPlugins()` 会给出 `readOnlyReason`:`unaddressable`(不是顶层行 / 名字对不上)或 `management-required`(插件管理器自己的行或受保护模块)。
31
- - 关掉一条功能行只是让那条行不激活:另外三条行不受影响,管理标签仍在(载体行开着)。
33
+ - 关掉一条功能行只是让那条行不激活:另外五条行不受影响,管理标签仍在(载体行开着)。
32
34
 
33
35
  ## 安装 / 卸载
34
36
 
@@ -37,7 +39,7 @@ dsh plugin --profile web add dsh-hiss-plugins
37
39
  # 或从本仓 checkout:dsh plugin --profile web add link:./dsh-hiss-plugins
38
40
  ```
39
41
 
40
- 把 `web` 换成你的 profile 名(例如 `headless`),然后**重启 dsh**。`dsh plugin` 会把本包装进 profile 的 `node_modules`;因为 `package.json` 声明了 `dsh.bundle.patch`,profile 的 bundle 列表会自动追加 `dsh-hiss-plugins`,重启后五条行一起激活。
42
+ 把 `web` 换成你的 profile 名(例如 `headless`),然后**重启 dsh**。`dsh plugin` 会把本包装进 profile 的 `node_modules`;因为 `package.json` 声明了 `dsh.bundle.patch`,profile 的 bundle 列表会自动追加 `dsh-hiss-plugins`,重启后七条行一起激活。
41
43
 
42
44
  ```powershell
43
45
  dsh plugin --profile web remove dsh-hiss-plugins
@@ -47,7 +49,7 @@ dsh plugin --profile web remove dsh-hiss-plugins
47
49
 
48
50
  ## 管理标签(浏览器半)
49
51
 
50
- Plugins 页(侧边栏 **插件**)里多出一个 `dsh-hiss-plugins` 标签,列出上面四条功能行与它们的开关。
52
+ Plugins 页(侧边栏 **插件**)里多出一个 `dsh-hiss-plugins` 标签,列出上面六条功能行与它们的开关。
51
53
 
52
54
  - 浏览器半是 **`lib/client.js`** —— 手写的 lazy-CJS bundle,没有构建步骤:`window.__ModuleLoader__.load({ id: "dsh-hiss-plugins", factory })` 只注册工厂,模块体(slot 注册、locale 字典)在首次被 require 时执行。`id` 必须逐字等于包名(客户端图里的行 id 就是包名)。
53
55
  - `package.json` 里 `dsh.client.platform = "web"`、`exports["./client"]` 指向 `lib/client.js`;客户端模块系统按 Loader 行扫描,**只有本包有行挂载,这个文件才会被送进浏览器**。
@@ -266,6 +268,44 @@ colgrep command:"init" / command:"status" / command:"clear"
266
268
  - **只解析常规 Git for Windows 布局** —— 便携版/自定义布局请显式设 `DSH_GIT_BASH`。
267
269
  - **依赖宿主包内部接缝** —— 执行器继承 `dsh-bash-sandbox` 的 `confine(command, policy)`。DSH 升级若改动该形状,插件会失效(`test/gitbash/` 里的接线断言会在契约变化时暴露)。
268
270
 
271
+ ## 功能:superpowers(常驻引导)
272
+
273
+ 把 superpowers 技能集的**常驻引导**接回来:只注册一个全局提示词段 `superpowers:adoption`(`order: 5`,排在人格前缀之后、各策略与工具段之前)。段文本是上游 bootstrap 原文,外层包着 `<EXTREMELY_IMPORTANT>`;技能从插件里移出来后有两处必须改,也写在这里 —— 技能改用裸名寻址、技能集没装时忽略本段:
274
+
275
+ - **任何回复或动作之前**先检查有没有适用的 superpowers 技能,有就先调 `skill` 工具加载;
276
+ - 过程类技能(`brainstorming`、`systematic-debugging`)先于实现类技能;
277
+ - 技能用**裸 kebab-case 名**寻址(`brainstorming`、`writing-plans`、`test-driven-development`、`verification-before-completion`),不是上游的 `superpowers:<name>` 形式;
278
+ - 技能目录里没有任何 superpowers 技能时,忽略这一段;
279
+ - 完整指令在 `using-superpowers` 技能里,用 `skill` 工具加载。
280
+
281
+ 没有技能 provider,没有命令。系统提示词每回合重新组装,所以这条常驻指令在上下文压缩之后依然在。
282
+
283
+ **技能本身由 DSH 原生发现**:它们就在被扫描的技能根里(`dsh-skill-filesystem` 的 `user-agents` 根,默认共享根 `~/.agents/skills`,rank 500),本插件不安装、不内置、不搬运任何技能文件。上游把「回答前先查技能」这条指令放进会话启动钩子,而 DSH 不读插件的 hook 文件 —— 缺的只有这条**常驻指令**,这也正是这个功能行存在的理由。
284
+
285
+ 前置要求:superpowers 技能集装在一个 DSH 会扫描的技能根里(本机惯例是共享根 `~/.agents/skills`)。
286
+
287
+ 验证:重启后给一个会命中 superpowers 技能的任务,看模型是否先调 `skill` 再动手。技能集没装时这段引导按它自己的判据被忽略,不影响其它行。
288
+
289
+ ## 功能:ponytail(采纳提示与 /ponytail 等级切换)
290
+
291
+ 把 ponytail 技能集的**等级状态**接回来:一个全局提示词段 `ponytail:adoption`(`order: 5`)加一个宿主命令 `/ponytail`。
292
+
293
+ - **提示词段随等级变化**:等级为 `off` 时文本是空串(等于不注入);否则是采纳提示(任何编码任务 —— 写、改、重构、修、评审、选依赖 —— 先用 `skill` 工具加载 `ponytail` 技能并按它执行)再加当前等级。当前等级写进文本里,所以重启后默认等级重新生效时这段话仍然是真的。
294
+ - **`/ponytail` 命令**(本插件注册的宿主命令,跟同名的 `ponytail` 技能是两回事):参数取 `lite` / `full` / `ultra` / `off`,不带参数等于 `full`。
295
+ - `lite` / `full` / `ultra`:把该 agent 的等级设为这一档,**并立刻把渲染好的 `ponytail` SKILL.md 正文作为一条持久 user 消息交给模型**(下一步就读到),返回 `Ponytail mode set to <level>.`;
296
+ - `off`:关掉该 agent 的等级,并注入一条「忽略 ponytail 指令」的消息,返回 `Ponytail off.`(不需要技能在场);
297
+ - 其它输入:返回用法错误 `Usage: /ponytail [lite|full|ultra|off]`,**不改任何状态**;
298
+ - `ponytail` 技能缺失或读不出来:返回错误,**不改任何状态** —— 等级不能设在一个模型执行不了的技能上。
299
+ - **默认等级**按上游的顺序解析:`PONYTAIL_DEFAULT_MODE` 环境变量 → `%APPDATA%\ponytail\config.json`(非 Windows:`$XDG_CONFIG_HOME` 或 `~/.config` 下的 `ponytail/config.json`)里的 `defaultMode` → `full`。配置缺失、读不了、坏 JSON、值非法都不是错误,直接往下走。
300
+ - **等级状态在进程内、按 agent 分开(WeakMap),不落盘**:`/ponytail` 的设定在 dsh 重启后回到默认等级;要持久就写环境变量或配置文件。
301
+ - 输入框里敲 `/` 会出现**两条 `ponytail`**:宿主命令(本插件注册,用来切等级)和 `ponytail` 技能(DSH 原生发现,用来加载技能正文);`/ponytail-review` 这类手势本来就由 `dsh-tool-skill` 原生处理。
302
+
303
+ **技能本身由 DSH 原生发现**:`ponytail`、`ponytail-review` 等技能就在被扫描的技能根里(默认共享根 `~/.agents/skills`,rank 500),本插件不安装、不内置任何技能,也不为每个技能注册命令。缺的只有等级 —— 一个让技能持续在线的常驻提示,和一个改变它施加力度的开关。
304
+
305
+ 前置要求:`ponytail` 技能装在一个 DSH 会扫描的技能根里(本机惯例是共享根 `~/.agents/skills`)。
306
+
307
+ 验证:`/ponytail ultra` 后给一个编码任务,模型应加载 `ponytail` 技能并按 ultra 档执行;`/ponytail off` 后该提示词段变空。
308
+
269
309
  ## 开发与测试
270
310
 
271
311
  ```powershell
@@ -276,25 +316,27 @@ pnpm test # 在包目录内也可:node --test-isolation=none --test
276
316
  结构:
277
317
 
278
318
  ```text
279
- package.json 五条行的 bundle 声明(dsh.bundle.patch)+ 浏览器半声明(dsh.client)+ exports/files
280
- cordis.patch.yml 五条顶层行(载体 + 四个功能)
319
+ package.json 七条行的 bundle 声明(dsh.bundle.patch)+ 浏览器半声明(dsh.client)+ exports/files
320
+ cordis.patch.yml 七条顶层行(载体 + 六个功能)
281
321
  lib/index.js 载体行:空 host 半
282
322
  lib/client.js 浏览器半:Plugins 页管理标签(手写 lazy-CJS,无构建步骤)
283
323
  lib/colgrep/ colgrep 工具
284
324
  lib/codegraph/ codegraph MCP 桥 + 引导
285
325
  lib/project-mcp/ lib/config.js 纯逻辑(无宿主依赖)+ lib/index.js 接线
286
326
  lib/gitbash/ lib/resolve.js 纯逻辑 + lib/gitbash-executor.js 执行器 + lib/index.js 组合根
327
+ lib/superpowers/ 常驻引导提示词段(只注册 systemPrompt 段,不导入宿主包)
328
+ lib/ponytail/ lib/mode.js 纯逻辑(等级解析与默认值)+ lib/index.js 提示词段与 /ponytail 命令
287
329
  locale/*.json 管理标签的文案字典
288
- test/ node:test:<feature>/ 四个目录 + manifest / patch / client 三个契约测试
330
+ test/ node:test:<feature>/ 六个目录 + manifest / patch / client 三个契约测试
289
331
  ```
290
332
 
291
- `lib/project-mcp/config.js` 与 `lib/gitbash/resolve.js` 刻意不导入任何宿主包,所以解析与映射分支可以在没有 dsh 安装的环境里完整跑测试;宿主接缝由各功能的 `index.js` 承担。浏览器半用 fake `window.__ModuleLoader__` + fake `ctx` 测注册与远程调用,不启动浏览器。测试全部离线,不联网、不依赖 `colgrep`/`codegraph` CLI。
333
+ `lib/project-mcp/config.js`、`lib/gitbash/resolve.js` 与 `lib/ponytail/mode.js` 刻意不导入任何宿主包,所以解析与映射分支可以在没有 dsh 安装的环境里完整跑测试;宿主接缝由各功能的 `index.js` 承担。浏览器半用 fake `window.__ModuleLoader__` + fake `ctx` 测注册与远程调用,不启动浏览器。测试全部离线,不联网、不依赖 `colgrep`/`codegraph` CLI。
292
334
 
293
335
  ## 发布(给维护者)
294
336
 
295
337
  ```powershell
296
- git tag dsh-hiss-plugins@1.0.0 # 必须与本目录 package.json 的 version 逐字一致
297
- git push origin dsh-hiss-plugins@1.0.0
338
+ git tag dsh-hiss-plugins@1.1.0 # 必须与本目录 package.json 的 version 逐字一致
339
+ git push origin dsh-hiss-plugins@1.1.0
298
340
  ```
299
341
 
300
342
  CI(`.github/workflows/publish.yml`,Windows runner)解析 tag、跑全量测试,再用 **npm trusted publishing(OIDC,无需任何 token)** 发布;包内 `prepublishOnly` 会再跑一次 `npm test`。手工发布:`npm publish`(`publishConfig.access` 已设为 public),发版前先 `node ../scripts/smoke-profile.mjs` 走一遍真实安装 + 真启动。发布新版本前记得递增 `package.json` 的 `version`。
@@ -303,4 +345,4 @@ CI(`.github/workflows/publish.yml`,Windows runner)解析 tag、跑全量
303
345
 
304
346
  MIT,见 [LICENSE](LICENSE)。本包只调用外部的 `colgrep` 与 `codegraph` CLI(未内置它们的源码),通过 MCP 连接 CodeGraph、通过宿主 MCP 桥读取 `.mcp.json`;上游项目与许可分别见 [lightonai/next-plaid](https://github.com/lightonai/next-plaid)、[colbymchenry/codegraph](https://github.com/colbymchenry/codegraph)。沙箱行为、拒绝方言与升级流程均来自 DSH 自身(`@deepseek-ai/dsh-shell` / `dsh-bash-sandbox` / `dsh-sandbox-*`),git-bash 功能只提供执行器接线与 Git Bash 解析。
305
347
 
306
- > `@deepseek-ai/dsh-tools`、`@deepseek-ai/dsh-mcp-client`、`@deepseek-ai/dsh-bash-sandbox`、`@deepseek-ai/dsh-tool-bash` 由**正在运行的 dsh 安装**提供,本包只在 `peerDependencies` 里声明(`devDependencies` 供本仓安装与测试)。**不要**把它们写进 `dependencies` —— 那会让 pnpm 往 profile 里塞一份自己的副本,遮蔽安装目录里的同名包,两代混装会让整棵插件树启动失败。升级 dsh 后先跑 `node ../scripts/smoke-profile.mjs` 再发版。
348
+ > `@deepseek-ai/dsh-tools`、`@deepseek-ai/dsh-mcp-client`、`@deepseek-ai/dsh-bash-sandbox`、`@deepseek-ai/dsh-tool-bash`、`@deepseek-ai/dsh-llm`、`@deepseek-ai/dsh-skill` 由**正在运行的 dsh 安装**提供,本包只在 `peerDependencies` 里声明(`devDependencies` 供本仓安装与测试)。**不要**把它们写进 `dependencies` —— 那会让 pnpm 往 profile 里塞一份自己的副本,遮蔽安装目录里的同名包,两代混装会让整棵插件树启动失败。升级 dsh 后先跑 `node ../scripts/smoke-profile.mjs` 再发版。
package/cordis.patch.yml CHANGED
@@ -1,10 +1,10 @@
1
- # dsh-hiss-plugins bundle patch: one package, five top-level rows.
1
+ # dsh-hiss-plugins bundle patch: one package, seven top-level rows.
2
2
  #
3
3
  # The carrier row (`dsh-hiss-plugins`) is an empty host half: it exists so the package
4
4
  # holds a Loader row, which is what the client module system serves the browser half
5
5
  # (`lib/client.js`, the Plugins-page management tab) for.
6
6
  #
7
- # The four feature rows are deliberate TOP-LEVEL rows, never a `cordis:group` with
7
+ # The six feature rows are deliberate TOP-LEVEL rows, never a `cordis:group` with
8
8
  # children: the plugin manager can only persist enablement for an entry whose parent
9
9
  # tree is the profile's include and that it can address by row id (see
10
10
  # `dsh-plugin-manager`'s `listPlugins()`), so a nested row can never be switched from
@@ -31,3 +31,9 @@
31
31
  isolate:
32
32
  shell: true
33
33
  settings: true
34
+
35
+ - id: dsh-hiss-plugins-superpowers
36
+ name: 'dsh-hiss-plugins/superpowers'
37
+
38
+ - id: dsh-hiss-plugins-ponytail
39
+ name: 'dsh-hiss-plugins/ponytail'
package/lib/client.js CHANGED
@@ -32,6 +32,8 @@ window.__ModuleLoader__.load({
32
32
  { key: "codegraph", moduleName: `${PACKAGE_ID}/codegraph`, description: "featureCodegraphDescription" },
33
33
  { key: "project-mcp", moduleName: `${PACKAGE_ID}/project-mcp`, description: "featureProjectMcpDescription" },
34
34
  { key: "gitbash", moduleName: `${PACKAGE_ID}/gitbash`, description: "featureGitbashDescription" },
35
+ { key: "superpowers", moduleName: `${PACKAGE_ID}/superpowers`, description: "featureSuperpowersDescription" },
36
+ { key: "ponytail", moduleName: `${PACKAGE_ID}/ponytail`, description: "featurePonytailDescription" },
35
37
  ];
36
38
  /** The same features keyed by the name a card shows. */
37
39
  const FEATURE_BY_KEY = new Map(FEATURES.map((feature) => [feature.key, feature]));
@@ -71,6 +73,8 @@ window.__ModuleLoader__.load({
71
73
  featureCodegraphDescription: "代码图 MCP 工具",
72
74
  featureProjectMcpDescription: "按会话挂载项目 .mcp.json",
73
75
  featureGitbashDescription: "Windows 上的 Git Bash shell",
76
+ featureSuperpowersDescription: "superpowers 技能常驻引导(任何回复前先检查并加载技能)",
77
+ featurePonytailDescription: "ponytail 采纳提示与 /ponytail 等级切换",
74
78
  };
75
79
  /** English dictionary checked against the Chinese key set. */
76
80
  const en = {
@@ -90,6 +94,8 @@ window.__ModuleLoader__.load({
90
94
  featureCodegraphDescription: "CodeGraph MCP tools",
91
95
  featureProjectMcpDescription: "mounts the project's .mcp.json per session",
92
96
  featureGitbashDescription: "Git Bash shell on Windows",
97
+ featureSuperpowersDescription: "always-on superpowers skill mandate",
98
+ featurePonytailDescription: "ponytail adoption hint and /ponytail level switching",
93
99
  };
94
100
 
95
101
  /** Read one thrown value as text. */
@@ -0,0 +1,125 @@
1
+ /**
2
+ * The ponytail adoption layer: the mode-aware prompt section and the `/ponytail`
3
+ * level switch.
4
+ *
5
+ * This restores the half of the deleted `@hilariouhiss/dsh-ponytail` plugin that DSH
6
+ * cannot supply natively. The six ponytail skills are discovered from a scanned root
7
+ * (`~/.agents/skills` by default) and `/ponytail-review` and friends already work
8
+ * through the harness's own user-invocation path, so this row vendors nothing and
9
+ * registers no skill provider and no per-skill commands. What is missing without it
10
+ * is the *level*: an always-on hint that keeps the skill in play, and a switch that
11
+ * changes how hard it applies.
12
+ *
13
+ * @module dsh-hiss-plugins/ponytail
14
+ */
15
+ import { createUserMessage } from "@deepseek-ai/dsh-llm";
16
+ import { renderSkillContent } from "@deepseek-ai/dsh-skill";
17
+ import { currentMode, parseLevel, resolveDefaultMode, setMode } from "./mode.js";
18
+
19
+ export const name = "ponytail";
20
+ export const inject = ["commands", "skills", "systemPrompt", "workingDirectory"];
21
+
22
+ /** The skill this layer adopts. */
23
+ const SKILL = "ponytail";
24
+
25
+ /** The adoption hint, unchanged from the plugin this replaces. */
26
+ export const HINT_TEXT = [
27
+ "Ponytail lazy-mode is available for coding work. ",
28
+ "Before any coding task — writing, editing, refactoring, fixing, reviewing, or choosing libraries/dependencies — ",
29
+ "load the `ponytail` skill with the `skill` tool (unless already loaded) and follow it: ",
30
+ "the simplest solution that works, reuse what already exists, standard library and platform features before new dependencies, ",
31
+ "fewest files, shortest working diff. ",
32
+ "Switch intensity with /ponytail lite|full|ultra; turn off with /ponytail off or by saying \"stop ponytail\".",
33
+ ].join("");
34
+
35
+ /**
36
+ * The section text for one assembly scope.
37
+ *
38
+ * The level is part of the hint so the text stays true after a restart, when the
39
+ * per-agent override is gone and the default is back in force.
40
+ *
41
+ * @param {object | undefined} scope the assembling agent, when there is one.
42
+ * @param {"off" | "lite" | "full" | "ultra"} fallback the resolved default level.
43
+ * @returns {string} the hint, or `''` when ponytail is off.
44
+ */
45
+ export function hintFor(scope, fallback) {
46
+ const level = currentMode(scope, fallback);
47
+ return level === "off" ? "" : `${HINT_TEXT} Current level: ${level}.`;
48
+ }
49
+
50
+ /**
51
+ * Register the global adoption section and the `/ponytail` command.
52
+ *
53
+ * @param {import("@deepseek-ai/cordis").Context} ctx - host context carrying
54
+ * `systemPrompt`, `commands`, `skills`, and `workingDirectory`.
55
+ */
56
+ export function apply(ctx) {
57
+ const defaultMode = resolveDefaultMode();
58
+ ctx.systemPrompt.section({
59
+ name: "ponytail:adoption",
60
+ order: 5,
61
+ text: (context) => hintFor(context.scope, defaultMode),
62
+ });
63
+ ctx.commands.register({
64
+ name: SKILL,
65
+ description: "switch ponytail lazy-mode intensity (lite|full|ultra|off)",
66
+ input: { hint: "[lite|full|ultra|off]" },
67
+ handler: (invocation) => runPonytail(ctx, invocation),
68
+ });
69
+ }
70
+
71
+ /**
72
+ * Execute one `/ponytail` invocation.
73
+ *
74
+ * The skill loads *before* the level changes: a level the model cannot act on is
75
+ * worse than no level at all, so a missing or unreadable skill leaves the state
76
+ * untouched.
77
+ *
78
+ * @param {object} ctx host context.
79
+ * @param {object} invocation the command invocation.
80
+ * @returns {Promise<{ kind: "success" | "error", text: string }>} the command result.
81
+ */
82
+ async function runPonytail(ctx, invocation) {
83
+ const level = parseLevel(invocation.rawInput);
84
+ if (level === undefined) {
85
+ return { kind: "error", text: "Usage: /ponytail [lite|full|ultra|off]" };
86
+ }
87
+ if (level === "off") {
88
+ setMode(invocation.agent, "off");
89
+ followup(invocation, "Ponytail off — revert to normal mode. Ignore the ponytail instructions until it is turned back on with /ponytail.");
90
+ return { kind: "success", text: "Ponytail off." };
91
+ }
92
+ let skill;
93
+ try {
94
+ skill = await ctx.skills.get(SKILL, {
95
+ cwd: await ctx.workingDirectory.ensure(invocation.agent, invocation.signal),
96
+ signal: invocation.signal,
97
+ scope: invocation.agent,
98
+ });
99
+ } catch (error) {
100
+ return { kind: "error", text: `Could not load the "${SKILL}" skill: ${error instanceof Error ? error.message : String(error)}` };
101
+ }
102
+ if (skill === undefined) {
103
+ return {
104
+ kind: "error",
105
+ text: `The "${SKILL}" skill is not available. Install it into a skills root DSH scans (for example the shared ~/.agents/skills root) and retry.`,
106
+ };
107
+ }
108
+ setMode(invocation.agent, level);
109
+ followup(invocation, `${renderSkillContent(skill)}\n\nPonytail level: ${level}. Apply the ${level} column of the Intensity table from now on.`);
110
+ return { kind: "success", text: `Ponytail mode set to ${level}.` };
111
+ }
112
+
113
+ /**
114
+ * Hand the model a durable user message through the same seam `/goal` uses, so the
115
+ * instructions are read on the very next step.
116
+ *
117
+ * @param {object} invocation the command invocation.
118
+ * @param {string} text the message text.
119
+ */
120
+ function followup(invocation, text) {
121
+ invocation.agent.followup(createUserMessage({
122
+ content: [{ type: "text", text }],
123
+ source: { kind: "skill-invocation", name: SKILL, form: "instructions" },
124
+ }));
125
+ }
@@ -0,0 +1,113 @@
1
+ /**
2
+ * Ponytail level logic: the level grammar, the default-level resolution, and the
3
+ * per-agent override table.
4
+ *
5
+ * Deliberately free of host imports, so every branch here runs under this repo's own
6
+ * `node --test` without a DSH context (the same split `lib/gitbash/resolve.js` and
7
+ * `lib/project-mcp/config.js` use).
8
+ *
9
+ * @module dsh-hiss-plugins/ponytail/mode
10
+ */
11
+ import { readFileSync } from "node:fs";
12
+ import { homedir } from "node:os";
13
+ import { join } from "node:path";
14
+
15
+ /** The levels the upstream skill documents, plus `off`. */
16
+ export const LEVELS = new Set(["lite", "full", "ultra", "off"]);
17
+
18
+ /**
19
+ * Per-agent level overrides.
20
+ *
21
+ * In-process and keyed by the agent object, exactly like the plugin this replaces:
22
+ * the level is a property of the running session, while the *default* is the
23
+ * durable value and comes from the environment or the upstream config file.
24
+ */
25
+ const modes = new WeakMap();
26
+
27
+ /**
28
+ * The level currently in force for one agent.
29
+ *
30
+ * @param {object | undefined} agent the agent (an assembly scope) or nothing.
31
+ * @param {"off" | "lite" | "full" | "ultra"} fallback the resolved default level.
32
+ * @returns {"off" | "lite" | "full" | "ultra"} the override, or the fallback.
33
+ */
34
+ export function currentMode(agent, fallback) {
35
+ return modes.get(agent) ?? fallback;
36
+ }
37
+
38
+ /**
39
+ * Record one agent's level override.
40
+ *
41
+ * @param {object} agent the agent whose level changes.
42
+ * @param {"off" | "lite" | "full" | "ultra"} level the new level.
43
+ */
44
+ export function setMode(agent, level) {
45
+ modes.set(agent, level);
46
+ }
47
+
48
+ /**
49
+ * Parse the `/ponytail` argument.
50
+ *
51
+ * @param {string} rawInput the exact text following the command name.
52
+ * @returns {"off" | "lite" | "full" | "ultra" | undefined} the level, a bare
53
+ * invocation meaning `full`, or `undefined` for anything the grammar rejects.
54
+ */
55
+ export function parseLevel(rawInput) {
56
+ if (typeof rawInput !== "string") return undefined;
57
+ const input = rawInput.trim().toLowerCase();
58
+ if (input.length === 0) return "full";
59
+ return LEVELS.has(input) ? input : undefined;
60
+ }
61
+
62
+ /**
63
+ * Normalize one candidate level from an environment variable or config file.
64
+ *
65
+ * @param {unknown} value the raw candidate.
66
+ * @returns {"off" | "lite" | "full" | "ultra" | undefined} the level, or nothing.
67
+ */
68
+ export function normalizeMode(value) {
69
+ if (typeof value !== "string") return undefined;
70
+ const mode = value.trim().toLowerCase();
71
+ return LEVELS.has(mode) ? mode : undefined;
72
+ }
73
+
74
+ /**
75
+ * The upstream-compatible config path: `%APPDATA%\ponytail\config.json` on Windows,
76
+ * `$XDG_CONFIG_HOME/ponytail/config.json` (default `~/.config`) elsewhere.
77
+ *
78
+ * @param {Record<string, string | undefined>} [env] environment to read.
79
+ * @returns {string} absolute path to the config file.
80
+ */
81
+ export function defaultConfigPath(env = process.env) {
82
+ if (process.platform === "win32" && typeof env.APPDATA === "string" && env.APPDATA !== "") {
83
+ return join(env.APPDATA, "ponytail", "config.json");
84
+ }
85
+ const xdg = typeof env.XDG_CONFIG_HOME === "string" && env.XDG_CONFIG_HOME !== ""
86
+ ? env.XDG_CONFIG_HOME
87
+ : join(homedir(), ".config");
88
+ return join(xdg, "ponytail", "config.json");
89
+ }
90
+
91
+ /**
92
+ * Resolve the default level the way upstream does: `PONYTAIL_DEFAULT_MODE` first,
93
+ * then the config file's `defaultMode`, then `full`. An unreadable, missing, or
94
+ * malformed config file is not an error — it just falls through.
95
+ *
96
+ * @param {Record<string, string | undefined>} [env] environment to read.
97
+ * @param {string} [configPath] config file to read.
98
+ * @returns {"off" | "lite" | "full" | "ultra"} the resolved default.
99
+ */
100
+ export function resolveDefaultMode(env = process.env, configPath = defaultConfigPath(env)) {
101
+ const fromEnv = normalizeMode(env.PONYTAIL_DEFAULT_MODE);
102
+ if (fromEnv !== undefined) return fromEnv;
103
+ try {
104
+ const parsed = JSON.parse(readFileSync(configPath, "utf8"));
105
+ if (parsed !== null && typeof parsed === "object") {
106
+ const fromFile = normalizeMode(parsed.defaultMode);
107
+ if (fromFile !== undefined) return fromFile;
108
+ }
109
+ } catch {
110
+ // Missing, unreadable, or malformed config: fall through to the default.
111
+ }
112
+ return "full";
113
+ }
@@ -0,0 +1,59 @@
1
+ /**
2
+ * The superpowers adoption layer: one always-on system-prompt section.
3
+ *
4
+ * This restores the half of the deleted `@hilariouhiss/dsh-superpowers` plugin that
5
+ * DSH cannot supply natively. The skills themselves are ordinary skills discovered
6
+ * from a scanned root (`~/.agents/skills` by default), so this row vendors nothing
7
+ * and registers no skill provider. What is missing without it is the *mandate*:
8
+ * upstream delivers "check for an applicable skill before you answer" through a
9
+ * SessionStart hook, and a harness that does not read plugin hook files — DSH does
10
+ * not — has no other way to keep that instruction in front of the model.
11
+ *
12
+ * The section re-assembles every turn, so the mandate survives compaction, while
13
+ * the full instructions stay in the `using-superpowers` skill and load on demand.
14
+ *
15
+ * @module dsh-hiss-plugins/superpowers
16
+ */
17
+ export const name = "superpowers";
18
+ export const inject = ["systemPrompt"];
19
+
20
+ /**
21
+ * The prior plugin's mandate, verbatim, plus the two facts that changed when the
22
+ * skills moved out of the plugin: DSH addresses skills by their bare name, and the
23
+ * section has to stay honest when the collection is not installed after all.
24
+ */
25
+ const MANDATE = [
26
+ "Before ANY response or action, check whether a superpowers skill applies and, if so, invoke it with the `skill` tool first.",
27
+ "Process skills (brainstorming, systematic-debugging) come before implementation skills.",
28
+ "Load the current SKILL.md via the `skill` tool; never follow a skill from memory alone.",
29
+ ].join(" ");
30
+
31
+ /** The complete section text. Exported so the text itself is testable. */
32
+ export const BOOTSTRAP = [
33
+ "<EXTREMELY_IMPORTANT>",
34
+ "You have superpowers.",
35
+ "",
36
+ MANDATE,
37
+ "",
38
+ "Superpowers skills are ordinary DSH skills: address them by their bare kebab-case name (`brainstorming`, `writing-plans`, `test-driven-development`, `verification-before-completion`), not the upstream `superpowers:<name>` form.",
39
+ "If the skill catalog lists no superpowers skills, ignore this section — the collection is not installed.",
40
+ "For the full instructions, load the `using-superpowers` skill with the `skill` tool.",
41
+ "</EXTREMELY_IMPORTANT>",
42
+ ].join("\n");
43
+
44
+ /**
45
+ * Register the global adoption section.
46
+ *
47
+ * `order: 5` places it after the deployment persona prefix (order 0) and before
48
+ * every policy and tool section (`PLAN_POLICY` is 500): an instruction to check for
49
+ * a skill before doing anything else is only useful ahead of the rest.
50
+ *
51
+ * @param {import("@deepseek-ai/cordis").Context} ctx - host context carrying `systemPrompt`.
52
+ */
53
+ export function apply(ctx) {
54
+ ctx.systemPrompt.section({
55
+ name: "superpowers:adoption",
56
+ order: 5,
57
+ text: BOOTSTRAP,
58
+ });
59
+ }
package/locale/en.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "meta": {
3
3
  "title": "dsh-hiss-plugins",
4
- "description": "One DeepSeek Harness bundle carrying four switchable plugins — colgrep, codegraph, project-mcp and git-bash — managed from a tab in the Plugins page."
4
+ "description": "One DeepSeek Harness bundle carrying six switchable plugins — colgrep, codegraph, project-mcp, git-bash, superpowers and ponytail — managed from a tab in the Plugins page."
5
5
  },
6
6
  "loading": "Reading plugins…",
7
7
  "error": "Plugins are unavailable: {error}",
@@ -18,5 +18,7 @@
18
18
  "featureColgrepDescription": "semantic code search tool",
19
19
  "featureCodegraphDescription": "CodeGraph MCP tools",
20
20
  "featureProjectMcpDescription": "mounts the project's .mcp.json per session",
21
- "featureGitbashDescription": "Git Bash shell on Windows"
21
+ "featureGitbashDescription": "Git Bash shell on Windows",
22
+ "featureSuperpowersDescription": "always-on superpowers skill mandate",
23
+ "featurePonytailDescription": "ponytail adoption hint and /ponytail level switching"
22
24
  }
package/locale/zh.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "meta": {
3
3
  "title": "dsh-hiss-plugins",
4
- "description": "一个 DeepSeek Harness 组合包,携带 colgrep、codegraph、project-mcp、git-bash 四个可独立开关的插件,并在插件页提供管理标签。"
4
+ "description": "一个 DeepSeek Harness 组合包,携带 colgrep、codegraph、project-mcp、git-bash、superpowers、ponytail 六个可独立开关的插件,并在插件页提供管理标签。"
5
5
  },
6
6
  "loading": "正在读取插件…",
7
7
  "error": "暂时无法读取插件:{error}",
@@ -18,5 +18,7 @@
18
18
  "featureColgrepDescription": "语义代码检索工具",
19
19
  "featureCodegraphDescription": "代码图 MCP 工具",
20
20
  "featureProjectMcpDescription": "按会话挂载项目 .mcp.json",
21
- "featureGitbashDescription": "Windows 上的 Git Bash shell"
21
+ "featureGitbashDescription": "Windows 上的 Git Bash shell",
22
+ "featureSuperpowersDescription": "superpowers 技能常驻引导(任何回复前先检查并加载技能)",
23
+ "featurePonytailDescription": "ponytail 采纳提示与 /ponytail 等级切换"
22
24
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-hiss-plugins",
3
- "version": "1.0.0",
4
- "description": "dsh-hiss-plugins — one DeepSeek Harness bundle carrying four independently switchable plugins (colgrep, codegraph, project-mcp, git-bash) plus a management tab in the Plugins page.",
3
+ "version": "1.1.0",
4
+ "description": "dsh-hiss-plugins — one DeepSeek Harness bundle carrying six independently switchable plugins (colgrep, codegraph, project-mcp, git-bash, superpowers, ponytail) plus a management tab in the Plugins page.",
5
5
  "keywords": [
6
6
  "dsh",
7
7
  "deepseek-harness",
@@ -10,7 +10,9 @@
10
10
  "codegraph",
11
11
  "mcp",
12
12
  "git-bash",
13
- "semantic-search"
13
+ "semantic-search",
14
+ "superpowers",
15
+ "ponytail"
14
16
  ],
15
17
  "license": "MIT",
16
18
  "author": {
@@ -33,6 +35,8 @@
33
35
  "./codegraph": "./lib/codegraph/index.js",
34
36
  "./project-mcp": "./lib/project-mcp/index.js",
35
37
  "./gitbash": "./lib/gitbash/index.js",
38
+ "./superpowers": "./lib/superpowers/index.js",
39
+ "./ponytail": "./lib/ponytail/index.js",
36
40
  "./client": "./lib/client.js",
37
41
  "./locale/*.json": "./locale/*.json",
38
42
  "./package.json": "./package.json"
@@ -46,13 +50,17 @@
46
50
  ],
47
51
  "peerDependencies": {
48
52
  "@deepseek-ai/dsh-bash-sandbox": "^0.2.1-alpha.4",
53
+ "@deepseek-ai/dsh-llm": "^0.2.1-alpha.4",
49
54
  "@deepseek-ai/dsh-mcp-client": "^0.2.1-alpha.4",
55
+ "@deepseek-ai/dsh-skill": "^0.2.1-alpha.4",
50
56
  "@deepseek-ai/dsh-tool-bash": "^0.2.1-alpha.4",
51
57
  "@deepseek-ai/dsh-tools": "^0.2.1-alpha.4"
52
58
  },
53
59
  "devDependencies": {
54
60
  "@deepseek-ai/dsh-bash-sandbox": "0.2.1-alpha.4",
61
+ "@deepseek-ai/dsh-llm": "0.2.1-alpha.4",
55
62
  "@deepseek-ai/dsh-mcp-client": "0.2.1-alpha.4",
63
+ "@deepseek-ai/dsh-skill": "0.2.1-alpha.4",
56
64
  "@deepseek-ai/dsh-tool-bash": "0.2.1-alpha.4",
57
65
  "@deepseek-ai/dsh-tools": "0.2.1-alpha.4"
58
66
  },