dsh-sensitive-guard 0.3.1 → 0.3.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/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # 变更记录
2
2
 
3
+ ## 0.3.2
4
+
5
+ - `exports` 增加 `./package.json`,修掉 `require('dsh-sensitive-guard/package.json')` 报 `ERR_PACKAGE_PATH_NOT_EXPORTED`。
6
+ - README 安装章节按 npm 发版更新:给出从 npm 装的版本号写法,`link:` 降为本地开发用。
7
+
3
8
  ## 0.3.1
4
9
 
5
10
  - 设置页不再只显示「载入失败」:被拒时展示说明卡,含当前访问地址、数据目录路径,以及**按来源算好的** `allowCidrs` 配置(IPv4 取 /24,IPv6 取 /64),可直接照抄。
package/README.md CHANGED
@@ -38,16 +38,14 @@ DSH 插件分 host 端和客户端两半,这个插件两半都占:host 端
38
38
 
39
39
  要求 dsh 0.2.0 以上、Node 18 以上。Windows 11 和 Ubuntu 22.04 都实测过,macOS 没测。
40
40
 
41
- 两种装法,选一个。
41
+ 三种装法,按场景选。
42
42
 
43
- **让 dsh 自己装。** 把仓库放到本机任意目录,在会话里说「安装这个目录下的插件:/绝对/路径」,它走 `install_bundle`。
44
-
45
- **手动加依赖。** 编辑 `~/.dsh/profiles/<profile>/package.json`:
43
+ **从 npm 装**(给使用者)。编辑 `~/.dsh/profiles/<profile>/package.json`:
46
44
 
47
45
  ```json
48
46
  {
49
47
  "dependencies": {
50
- "dsh-sensitive-guard": "link:/absolute/path/to/sensitive-guard"
48
+ "dsh-sensitive-guard": "0.3.2"
51
49
  },
52
50
  "dsh": {
53
51
  "profile": {
@@ -57,7 +55,11 @@ DSH 插件分 host 端和客户端两半,这个插件两半都占:host 端
57
55
  }
58
56
  ```
59
57
 
60
- `bundles` 里保留原有条目,只追加这一项。然后在同目录跑 `pnpm install`,重启 dsh。`link:` 不拷贝文件,改代码立刻生效,但 host 端的改动还是要重启进程。
58
+ `bundles` 里保留原有条目,只追加这一项。然后在同目录跑 `pnpm install`,重启 dsh。
59
+
60
+ **让 dsh 自己装**(不想手改文件的场合)。在会话里说「安装这个目录下的插件:/绝对/路径」,它走 `install_bundle`。
61
+
62
+ **本地改代码用 link**。把版本号换成 `"link:/absolute/path/to/sensitive-guard"`,源码改动立刻生效,但 host 端的改动还是要重启进程。
61
63
 
62
64
  ## 确认装好了
63
65
 
package/index.js CHANGED
@@ -34,7 +34,7 @@ import path from 'node:path';
34
34
  const VAULT_ROUTE = '/guard/vault';
35
35
  const REVEAL_ROUTE = '/guard/reveal';
36
36
  const SETTINGS_ROUTE = '/guard/settings';
37
- const PLUGIN_VERSION = '0.3.1';
37
+ const PLUGIN_VERSION = '0.3.2';
38
38
 
39
39
  /** Stable placeholder form: <SG_ + 12 hex chars of sha256(plaintext) + >. */
40
40
  const PH_EXACT = /^<SG_[0-9a-f]{12}>$/;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-sensitive-guard",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "敏感保护:进入模型上下文前把密钥/令牌/密码替换为 <SG_> 占位符,明文加密存本地保管库;设置页与对话内提供小锁点击还原,工具可将明文导出为 0600 文件供命令执行时使用。",
5
5
  "license": "MIT",
6
6
  "author": "wangxinyu",
@@ -21,6 +21,7 @@
21
21
  "exports": {
22
22
  ".": "./index.js",
23
23
  "./client": "./client.js",
24
+ "./package.json": "./package.json",
24
25
  "./locale/*.json": "./locale/*.json",
25
26
  "./icon": "./icon.svg"
26
27
  },