dsh-workspace-scratch 0.2.0 → 0.2.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 +21 -0
- package/README.md +53 -59
- package/package.json +11 -2
- package/plugin-index.json +2 -2
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 qhdhiman
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -23,9 +23,42 @@
|
|
|
23
23
|
- 注册 `scratch` 与 `memory` 两个模型工具,路径被强制限制在对应目录内,`../../` 之类越界路径直接报错。
|
|
24
24
|
- 注入一段系统提示词说明 + 一行运行时上下文(当前会话的 scratch / memory 绝对路径),让模型知道该往哪里写。
|
|
25
25
|
|
|
26
|
-
##
|
|
26
|
+
## 安装(已发布到 npm)
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
**插件已发布**:`dsh-workspace-scratch@0.2.2` → 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.2/plugin-index.json
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
然后搜索 `工作区` / `workspace` / `scratch`,点安装。
|
|
39
|
+
|
|
40
|
+
> 已实测:HTTP 200、**无重定向**(Discover 拒绝重定向)、索引通过官方
|
|
41
|
+
> `@deepseek-ai/dsh-plugin-market-index` 校验。
|
|
42
|
+
>
|
|
43
|
+
> 仓库地址:https://github.com/qhdhiman/dsh-workspace-scratch
|
|
44
|
+
>
|
|
45
|
+
> 为什么用 unpkg 而不是 GitHub raw:`raw.githubusercontent.com` 在部分网络环境
|
|
46
|
+
> (含本机实测)SSL 握手即失败,且 `cdn.jsdelivr.net` 也不可达;**unpkg 是实测可用的**。
|
|
47
|
+
> 代价是 URL 带版本号,**发新版要更新 URL**。
|
|
48
|
+
|
|
49
|
+
### 直接安装
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
dsh plugin --profile <profile> install dsh-workspace-scratch@0.2.2
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
或在对话里:
|
|
56
|
+
|
|
57
|
+
```text
|
|
58
|
+
plugin_manager install_bundle target: "dsh-workspace-scratch@0.2.2"
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## 本地开发安装
|
|
29
62
|
|
|
30
63
|
```bash
|
|
31
64
|
# 1. 装进当前 profile(desktop)。也可以直接用 GUI 的插件页安装/启用。
|
|
@@ -108,80 +141,41 @@ node --test "test/**/*.test.mjs"
|
|
|
108
141
|
|
|
109
142
|
未认证请求返回 401,跨源请求返回 403。
|
|
110
143
|
|
|
111
|
-
##
|
|
144
|
+
## 发新版(维护者)
|
|
112
145
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
```
|
|
116
|
-
你:npm 发布 → 托管 plugin-index.json → 别人:Plugins → Discover → 添加索引 URL → 搜索 → 安装
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
### 1. 生成索引(已在仓库里生成好)
|
|
146
|
+
包已发布,日常只需发新版本:
|
|
120
147
|
|
|
121
148
|
```bash
|
|
122
|
-
|
|
123
|
-
#
|
|
124
|
-
npm
|
|
125
|
-
|
|
126
|
-
--homepage https://github.com/<你>/dsh-workspace-scratch#readme
|
|
149
|
+
# 1. 改 package.json 的 version
|
|
150
|
+
# 2. 发布(prepublishOnly 会自动重建索引 + 跑全部测试)
|
|
151
|
+
npm publish
|
|
152
|
+
# 3. 更新索引 URL 里的版本号(README「安装」章节,以及告诉用户)
|
|
127
153
|
```
|
|
128
154
|
|
|
129
|
-
|
|
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
|
-
```
|
|
155
|
+
`prepublishOnly` 的顺序是 `build:index && test`,所以带过期索引或测试失败的包不会发出去。
|
|
163
156
|
|
|
164
|
-
|
|
165
|
-
|
|
157
|
+
发布需要 npm token 具备 **Bypass 2FA**;首包发布时 Packages 必须选 `All packages`
|
|
158
|
+
(包尚不存在时无法单独授权)。本机全局 registry 是 npmmirror 只读镜像,
|
|
159
|
+
所以 `publishConfig.registry` 已固定为 `registry.npmjs.org`。
|
|
166
160
|
|
|
167
|
-
###
|
|
161
|
+
### 索引与版本号
|
|
168
162
|
|
|
169
|
-
`
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
163
|
+
索引里的 `publishTimestamp` 每次重建都会更新,`version` 取自 `package.json`,
|
|
164
|
+
`engines.dsh` 取自 manifest。**索引 URL 目前带版本号**,发新版必须换 URL;
|
|
165
|
+
把 `plugin-index.json` 放进 GitHub 仓库并改用
|
|
166
|
+
`https://raw.githubusercontent.com/<你>/<repo>/main/plugin-index.json` 即可永久稳定。
|
|
173
167
|
|
|
174
168
|
### 免 npm 的替代路径:git 源
|
|
175
169
|
|
|
176
|
-
没有 npm 账号也能分发——索引支持 git
|
|
170
|
+
没有 npm 账号也能分发——索引支持 git 源,安装时固定到具体 commit:
|
|
177
171
|
|
|
178
172
|
```bash
|
|
179
173
|
node scripts/build-index.mjs --source git \
|
|
180
174
|
--git-url https://github.com/<你>/dsh-workspace-scratch \
|
|
181
|
-
--commit <40 位 commit SHA>
|
|
175
|
+
--commit <40 位 commit SHA>
|
|
182
176
|
```
|
|
183
177
|
|
|
184
|
-
对应安装参数是 `git+https://github.com/...git#<commit
|
|
178
|
+
对应安装参数是 `git+https://github.com/...git#<commit>`。git 源的包必须在仓库根,
|
|
185
179
|
或在索引里用 `path` 指明子目录。
|
|
186
180
|
|
|
187
181
|
## 工具
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-workspace-scratch",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
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",
|
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
"locale/*.json",
|
|
21
21
|
"icon.svg",
|
|
22
22
|
"README.md",
|
|
23
|
-
"plugin-index.json"
|
|
23
|
+
"plugin-index.json",
|
|
24
|
+
"LICENSE"
|
|
24
25
|
],
|
|
25
26
|
"engines": {
|
|
26
27
|
"node": ">=20.0.0",
|
|
@@ -59,5 +60,13 @@
|
|
|
59
60
|
"publishConfig": {
|
|
60
61
|
"registry": "https://registry.npmjs.org/",
|
|
61
62
|
"access": "public"
|
|
63
|
+
},
|
|
64
|
+
"repository": {
|
|
65
|
+
"type": "git",
|
|
66
|
+
"url": "git+https://github.com/qhdhiman/dsh-workspace-scratch.git"
|
|
67
|
+
},
|
|
68
|
+
"homepage": "https://github.com/qhdhiman/dsh-workspace-scratch#readme",
|
|
69
|
+
"bugs": {
|
|
70
|
+
"url": "https://github.com/qhdhiman/dsh-workspace-scratch/issues"
|
|
62
71
|
}
|
|
63
72
|
}
|