dsh-instructions-policy 0.6.0 → 0.6.1

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.
Files changed (3) hide show
  1. package/README.en.md +16 -29
  2. package/README.md +16 -29
  3. package/package.json +1 -1
package/README.en.md CHANGED
@@ -105,58 +105,45 @@ An "Instruction policy" menu appears to the left of the composer (next to the pe
105
105
 
106
106
  - DSH is installed and has been started at least once (`dsh --version` prints a version).
107
107
  - Node.js follows DSH: 0.2.2 requires ≥ 24.9, 0.2.1 requires `^22.19.0 || >=24.0.0`; defer to DSH's `engines`.
108
+ - `pnpm` is on `PATH`: `dsh plugin` forwards its arguments to pnpm in the profile directory.
108
109
  - DSH `>=0.2.1-rc.5 <1.0.0-0` (all 0.x releases are admitted; 1.0 and its prereleases need re-validation).
109
110
 
110
111
  ### Steps
111
112
 
112
- 1. Install the package into a profile (`web` is the default Web profile name):
113
+ 1. Install the plugin into a profile (`web` is the default Web profile name):
113
114
 
114
115
  ```sh
115
- # from npm
116
+ # from npm (recommended)
116
117
  dsh plugin --profile web add dsh-instructions-policy
117
- # from GitHub (replace <owner>/<repo> with the repository)
118
- dsh plugin --profile web add github:<owner>/<repo>
119
- # local development: link the repository directory
120
- dsh plugin --profile web add link:<path-to-repo>
118
+ # from GitHub (source install; see allowBuilds below for pnpm ≥10)
119
+ dsh plugin --profile web add github:Angel-Hair/dsh-instructions-policy
120
+ # local development: run this in the checkout
121
+ dsh plugin --profile web add link:.
121
122
  ```
122
123
 
123
- 2. Make the profile select this bundle. Edit `~/.dsh/profiles/web/package.json` (on Windows: `%USERPROFILE%\.dsh\profiles\web\package.json`) and add the package name to `dsh.profile.bundles`:
124
-
125
- ```json
126
- {
127
- "dsh": {
128
- "profile": {
129
- "bundles": [
130
- "@deepseek-ai/dsh-base",
131
- "@deepseek-ai/dsh-web-app",
132
- "dsh-instructions-policy"
133
- ]
134
- }
135
- }
136
- }
137
- ```
124
+ After a successful install DSH adds the dependency to `dsh.profile.bundles` automatically because the package declares `dsh.bundle.patch`; no manual `package.json` edit is needed. The Plugins page can confirm or toggle it.
138
125
 
139
- Once installed you can also enable it from the Plugins page (equivalent to writing `dsh.profile.bundles`).
126
+ A GitHub source install runs this package's `prepare` build, which pnpm ≥10 blocks for dependencies. If the first `add` fails with `ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED`, add the printed key to `allowBuilds` in `~/.dsh/profiles/web/pnpm-workspace.yaml` and rerun, or install from npm instead.
140
127
 
141
- 3. Restart `dsh web` and confirm the log line:
128
+ 2. Restart `dsh web` and confirm the log line:
142
129
 
143
130
  ```
144
131
  instructions-policy: redirecting @deepseek-ai/dsh-agent-instructions for N preset row(s)
145
132
  ```
146
133
 
147
- 4. Open any new task: the "Instruction policy" chip should appear at the left of the composer tool row; or run `/instructions show` to verify the project root and loaded files.
134
+ 3. Open any new task: the "Instruction policy" chip should appear at the left of the composer tool row; or run `/instructions show` to verify the project root and loaded files.
148
135
 
149
136
  After upgrading, restart `dsh web`; if the interface does not change, force-reload the browser with Ctrl+F5.
150
137
 
151
138
  ### Upgrade / uninstall
152
139
 
153
140
  ```sh
154
- # npm / GitHub install: upgrade
155
- dsh plugin --profile web update dsh-instructions-policy
141
+ # npm / GitHub install: upgrade to the latest version (including minor/major)
142
+ dsh plugin --profile web update --latest dsh-instructions-policy
156
143
 
157
144
  # link install: git pull in the repository, then restart dsh web
158
145
 
159
- # uninstall: remove the package name from dsh.profile.bundles first, then
146
+ # uninstall: removes the dependency and its dsh.profile.bundles entry
160
147
  dsh plugin --profile web remove dsh-instructions-policy
161
148
  ```
162
149
 
@@ -167,7 +154,7 @@ After uninstalling, the redirect disappears and DSH returns to the default instr
167
154
  <details>
168
155
  <summary>Expand the configuration reference</summary>
169
156
 
170
- Defaults live in [cordis.patch.yml](cordis.patch.yml). To change them, override the row by `id` in `~/.dsh/profiles/<profile>/cordis.patch.yml`. **DSH replaces a row's `config` wholesale, with no deep merge**, so restate every field you need:
157
+ Defaults live in [cordis.patch.yml](cordis.patch.yml). To change them, override the row by `id` in `~/.dsh/profiles/web/cordis.patch.yml` (replace `web` with your profile); **DSH replaces a row's `config` wholesale, with no deep merge**, so restate every field you need:
171
158
 
172
159
  ```yaml
173
160
  - id: instructions-policy
@@ -216,7 +203,7 @@ The plugin ships no logging of its own: it keeps zero runtime dependencies and w
216
203
  When filing an issue, include:
217
204
 
218
205
  - DSH version (`dsh --version`), plugin version (the profile `package.json` or `node_modules/dsh-instructions-policy/package.json`), and the OS.
219
- - The profile's `dsh.profile.bundles`, plus any line in `~/.dsh/profiles/<profile>/cordis.patch.yml` related to this plugin.
206
+ - The profile's `dsh.profile.bundles`, plus any line in `~/.dsh/profiles/web/cordis.patch.yml` (replace `web` with your profile) related to this plugin.
220
207
  - Every line containing `instructions-policy` in the terminal that started `dsh web` (`redirecting …`, `policy inactive`, `compose failed`, …). If the terminal is gone, redirect and reproduce:
221
208
 
222
209
  ```powershell
package/README.md CHANGED
@@ -104,58 +104,45 @@ profile 启动
104
104
 
105
105
  - 已安装并至少启动过一次 DSH(`dsh --version` 能输出版本)。
106
106
  - Node.js 版本跟随 DSH:0.2.2 起要求 ≥ 24.9,0.2.1 为 `^22.19.0 || >=24.0.0`;以 DSH 的 `engines` 为准。
107
+ - `pnpm` 在 `PATH` 上:`dsh plugin` 会把参数转发给 profile 目录里的 pnpm。
107
108
  - DSH `>=0.2.1-rc.5 <1.0.0-0`(0.x 全量放行;1.0 及其预发布需要重新验证)。
108
109
 
109
110
  ### 步骤
110
111
 
111
- 1. 把包装进 profile(`web` 是默认 Web profile 名):
112
+ 1. 把插件装进 profile(`web` 是默认 Web profile 名):
112
113
 
113
114
  ```sh
114
- # 从 npm
115
+ # 从 npm(推荐)
115
116
  dsh plugin --profile web add dsh-instructions-policy
116
- # 从 GitHub(把 <owner>/<repo> 换成仓库地址)
117
- dsh plugin --profile web add github:<owner>/<repo>
118
- # 本地开发:直接 link 仓库目录
119
- dsh plugin --profile web add link:<path-to-repo>
117
+ # 从 GitHub(源码安装;pnpm ≥10 的 allowBuilds 见下)
118
+ dsh plugin --profile web add github:Angel-Hair/dsh-instructions-policy
119
+ # 本地开发:在仓库目录执行
120
+ dsh plugin --profile web add link:.
120
121
  ```
121
122
 
122
- 2. 让 profile 选中这个 bundle。编辑 `~/.dsh/profiles/web/package.json`(Windows 为 `%USERPROFILE%\.dsh\profiles\web\package.json`),把包名加进 `dsh.profile.bundles`:
123
-
124
- ```json
125
- {
126
- "dsh": {
127
- "profile": {
128
- "bundles": [
129
- "@deepseek-ai/dsh-base",
130
- "@deepseek-ai/dsh-web-app",
131
- "dsh-instructions-policy"
132
- ]
133
- }
134
- }
135
- }
136
- ```
123
+ 安装成功后 DSH 会自动把声明了 `dsh.bundle.patch` 的依赖写入 profile 的 `dsh.profile.bundles`,不需要手工编辑 `package.json`;也可以在 Plugins 页面确认或开关。
137
124
 
138
- 装好之后也可以在 Plugins 页面里启用它(等价于写入 `dsh.profile.bundles`)。
125
+ GitHub 源码安装会触发本包的 `prepare` 构建,pnpm ≥10 默认拦截依赖构建;首次 `add` 报 `ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED` 时,把提示给出的键写进 `~/.dsh/profiles/web/pnpm-workspace.yaml` 的 `allowBuilds` 后重跑,或改用 npm 安装。
139
126
 
140
- 3. 重启 `dsh web`,确认日志出现:
127
+ 2. 重启 `dsh web`,确认日志出现:
141
128
 
142
129
  ```
143
130
  instructions-policy: redirecting @deepseek-ai/dsh-agent-instructions for N preset row(s)
144
131
  ```
145
132
 
146
- 4. 打开任意新任务,输入框工具行左侧应出现「指令策略」chip;或执行 `/instructions show` 核对项目根与已加载文件。
133
+ 3. 打开任意新任务,输入框工具行左侧应出现「指令策略」chip;或执行 `/instructions show` 核对项目根与已加载文件。
147
134
 
148
135
  升级后重启 `dsh web`;如果界面没有变化,再 Ctrl+F5 强制刷新。
149
136
 
150
137
  ### 升级 / 卸载
151
138
 
152
139
  ```sh
153
- # npm / GitHub 安装:升级到新版本
154
- dsh plugin --profile web update dsh-instructions-policy
140
+ # npm / GitHub 安装:升级到最新版本(含跨 minor / major)
141
+ dsh plugin --profile web update --latest dsh-instructions-policy
155
142
 
156
143
  # link 安装:在仓库里 git pull 后重启 dsh web 即可
157
144
 
158
- # 卸载:先从 dsh.profile.bundles 移除该包名,再执行
145
+ # 卸载:依赖和 dsh.profile.bundles 里的条目会一起移除
159
146
  dsh plugin --profile web remove dsh-instructions-policy
160
147
  ```
161
148
 
@@ -166,7 +153,7 @@ dsh plugin --profile web remove dsh-instructions-policy
166
153
  <details>
167
154
  <summary>点击展开配置说明</summary>
168
155
 
169
- 默认值见 [cordis.patch.yml](cordis.patch.yml)。要改默认值,在 `~/.dsh/profiles/<profile>/cordis.patch.yml` 里按 `id` 覆盖;**DSH 按行整行替换 `config`,不做深合并**,所以覆盖时要重述所有需要的字段:
156
+ 默认值见 [cordis.patch.yml](cordis.patch.yml)。要改默认值,在 `~/.dsh/profiles/web/cordis.patch.yml`(其他 profile 换成对应目录)里按 `id` 覆盖;**DSH 按行整行替换 `config`,不做深合并**,所以覆盖时要重述所有需要的字段:
170
157
 
171
158
  ```yaml
172
159
  - id: instructions-policy
@@ -215,7 +202,7 @@ dsh plugin --profile web remove dsh-instructions-policy
215
202
  提 issue 时请附上:
216
203
 
217
204
  - DSH 版本(`dsh --version`)、插件版本(profile 的 `package.json` 或 `node_modules/dsh-instructions-policy/package.json`)、操作系统。
218
- - profile 的 `dsh.profile.bundles`,以及 `~/.dsh/profiles/<profile>/cordis.patch.yml` 里与本插件相关的行。
205
+ - profile 的 `dsh.profile.bundles`,以及 `~/.dsh/profiles/web/cordis.patch.yml`(按实际 profile 替换 `web`)里与本插件相关的行。
219
206
  - 启动 `dsh web` 的终端输出中所有含 `instructions-policy` 的行(`redirecting …`、`policy inactive`、`compose failed` 等)。看不到终端时先重定向再复现:
220
207
 
221
208
  ```powershell
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-instructions-policy",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "Session-scoped policy for DSH workspace instructions: choose the root AGENTS.md, toggle user-global instructions, toggle subdirectory discovery.",
5
5
  "keywords": [
6
6
  "dsh",