dsh-workspace-scratch 0.2.0 → 0.2.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.
package/README.md CHANGED
@@ -23,9 +23,37 @@
23
23
  - 注册 `scratch` 与 `memory` 两个模型工具,路径被强制限制在对应目录内,`../../` 之类越界路径直接报错。
24
24
  - 注入一段系统提示词说明 + 一行运行时上下文(当前会话的 scratch / memory 绝对路径),让模型知道该往哪里写。
25
25
 
26
- ## 安装
26
+ ## 安装(已发布到 npm)
27
27
 
28
- 插件源码放在 `~/.dsh/plugins/dsh-workspace-scratch`(在工作区之外,因此不会污染工作区)。
28
+ **插件已发布**:`dsh-workspace-scratch@0.2.1` → https://www.npmjs.com/package/dsh-workspace-scratch
29
+
30
+ ### 通过官方 Discover 安装
31
+
32
+ 在 DSH 里 **Plugins → Discover** 添加这个索引地址:
33
+
34
+ ```
35
+ https://unpkg.com/dsh-workspace-scratch@0.2.1/plugin-index.json
36
+ ```
37
+
38
+ 然后搜索 `工作区` / `workspace` / `scratch`,点安装。
39
+
40
+ > 该地址已实测返回 200 且无重定向(Discover 拒绝重定向),索引也通过官方
41
+ > `@deepseek-ai/dsh-plugin-market-index` 校验。带版本号意味着**每次发新版要换 URL**;
42
+ > 建好 GitHub 仓库后可改用 `raw.githubusercontent.com` 的稳定地址。
43
+
44
+ ### 直接安装
45
+
46
+ ```bash
47
+ dsh plugin --profile <profile> install dsh-workspace-scratch@0.2.1
48
+ ```
49
+
50
+ 或在对话里:
51
+
52
+ ```text
53
+ plugin_manager install_bundle target: "dsh-workspace-scratch@0.2.1"
54
+ ```
55
+
56
+ ## 本地开发安装
29
57
 
30
58
  ```bash
31
59
  # 1. 装进当前 profile(desktop)。也可以直接用 GUI 的插件页安装/启用。
@@ -108,80 +136,41 @@ node --test "test/**/*.test.mjs"
108
136
 
109
137
  未认证请求返回 401,跨源请求返回 403。
110
138
 
111
- ## 发布与他人安装(官方 Discover / 插件市场)
139
+ ## 发新版(维护者)
112
140
 
113
- 别人不需要拿到源码目录,也不需要知道 `~/.dsh/plugins`。走官方的 **插件市场索引**:
114
-
115
- ```
116
- 你:npm 发布 → 托管 plugin-index.json → 别人:Plugins → Discover → 添加索引 URL → 搜索 → 安装
117
- ```
118
-
119
- ### 1. 生成索引(已在仓库里生成好)
141
+ 包已发布,日常只需发新版本:
120
142
 
121
143
  ```bash
122
- npm run build:index -- --author qhdhiman
123
- # 想带仓库/主页链接(Discover 详情页更好看):
124
- npm run build:index -- --author qhdhiman \
125
- --repository https://github.com/<你>/dsh-workspace-scratch \
126
- --homepage https://github.com/<你>/dsh-workspace-scratch#readme
144
+ # 1. 改 package.json 的 version
145
+ # 2. 发布(prepublishOnly 会自动重建索引 + 跑全部测试)
146
+ npm publish
147
+ # 3. 更新索引 URL 里的版本号(README「安装」章节,以及告诉用户)
127
148
  ```
128
149
 
129
- 脚本会用官方 `@deepseek-ai/dsh-plugin-market-index` 校验输出,格式不对当场报错;
130
- 图标以 `data:` 内联进索引(≤32 KiB),因此索引是自包含的,不依赖额外请求。
131
-
132
- ### 2. 发布到 npm
133
-
134
- ```bash
135
- npm login # 需要你自己的 npm 账号;包名 dsh-workspace-scratch 目前未被占用
136
- npm run build:index -- --author qhdhiman # 发布前重新生成,让 publishTimestamp 接近真实时间
137
- npm publish --access public
138
- ```
139
-
140
- ### 3. 托管索引(关键:Discover **拒绝重定向**)
141
-
142
- 索引必须有一个直接返回 200 的 URL。两种选择:
143
-
144
- | 方式 | URL 形态 | 特点 |
145
- |---|---|---|
146
- | GitHub raw(推荐) | `https://raw.githubusercontent.com/<你>/<repo>/main/plugin-index.json` | 地址**稳定**,发新版不用改 |
147
- | unpkg(免建仓库) | `https://unpkg.com/dsh-workspace-scratch@0.2.0/plugin-index.json` | 只要发布到 npm 就有;但带版本号,每次发版要换 URL |
148
-
149
- > 不要用 `https://unpkg.com/dsh-workspace-scratch/plugin-index.json`(不带版本)——它会 302 重定向,
150
- > 而插件市场明确拒绝重定向,必须配置最终 URL。
151
-
152
- ### 4. 别人怎么装
153
-
154
- 1. **Plugins → Discover**(设置里的「发现」标签)
155
- 2. 添加索引 URL(上面的 raw 或 unpkg 地址)
156
- 3. 搜索 `workspace` / `工作区` / `scratch` → 点安装
157
-
158
- 或者直接用工具链装,等价于 Discover 背后的动作:
159
-
160
- ```text
161
- plugin_manager install_bundle target: "dsh-workspace-scratch@0.2.0"
162
- ```
150
+ `prepublishOnly` 的顺序是 `build:index && test`,所以带过期索引或测试失败的包不会发出去。
163
151
 
164
- 安装后 `dsh.profile.bundles` 会加上该包,重启 profile 生效;之后的设置页、工具、`.dsh` 目录
165
- 行为与本地 `link:` 安装完全一致。
152
+ 发布需要 npm token 具备 **Bypass 2FA**;首包发布时 Packages 必须选 `All packages`
153
+ (包尚不存在时无法单独授权)。本机全局 registry 是 npmmirror 只读镜像,
154
+ 所以 `publishConfig.registry` 已固定为 `registry.npmjs.org`。
166
155
 
167
- ### 索引里描述了什么
156
+ ### 索引与版本号
168
157
 
169
- `plugin-index.json` 是一份 `format: 1` 文档,含:包名、中英标题与描述、内联图标、作者、
170
- 分类 `workspace`、关键词、以及每个版本对应的 `source`(npm 或 git)、`publishTimestamp`
171
- 和 `engines.dsh`。`engines.dsh` 为 `>=0.2.0-0 <1.0.0-0`,DSH 会据此在客户端计算兼容性,
172
- 不兼容的版本会显示为不可安装而不是装完崩溃。
158
+ 索引里的 `publishTimestamp` 每次重建都会更新,`version` 取自 `package.json`,
159
+ `engines.dsh` 取自 manifest。**索引 URL 目前带版本号**,发新版必须换 URL;
160
+ 把 `plugin-index.json` 放进 GitHub 仓库并改用
161
+ `https://raw.githubusercontent.com/<你>/<repo>/main/plugin-index.json` 即可永久稳定。
173
162
 
174
163
  ### 免 npm 的替代路径:git 源
175
164
 
176
- 没有 npm 账号也能分发——索引支持 git 源,安装时被固定到具体 commit:
165
+ 没有 npm 账号也能分发——索引支持 git 源,安装时固定到具体 commit:
177
166
 
178
167
  ```bash
179
168
  node scripts/build-index.mjs --source git \
180
169
  --git-url https://github.com/<你>/dsh-workspace-scratch \
181
- --commit <40 位 commit SHA> --author qhdhiman
170
+ --commit <40 位 commit SHA>
182
171
  ```
183
172
 
184
- 对应安装参数是 `git+https://github.com/...git#<commit>`。注意:git 源的包必须在仓库根,
173
+ 对应安装参数是 `git+https://github.com/...git#<commit>`。git 源的包必须在仓库根,
185
174
  或在索引里用 `path` 指明子目录。
186
175
 
187
176
  ## 工具
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-workspace-scratch",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Keep a DeepSeek Harness workspace clean: every session gets a hidden .dsh directory for its scratch files and durable memory notes, plus scratch/memory tools, prompt guidance and a Settings page.",
5
5
  "type": "module",
6
6
  "icon": "./icon.svg",
package/plugin-index.json CHANGED
@@ -49,8 +49,8 @@
49
49
  },
50
50
  "versions": [
51
51
  {
52
- "version": "0.2.0",
53
- "publishTimestamp": 1795577921,
52
+ "version": "0.2.1",
53
+ "publishTimestamp": 1795578491,
54
54
  "source": {
55
55
  "type": "npm"
56
56
  },