dsh-project-sources 0.0.0-stage → 0.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/CHANGELOG.md +23 -0
- package/LICENSE +21 -0
- package/NOTICE +10 -0
- package/README.md +85 -2
- package/README.zh.md +84 -0
- package/client.js +757 -0
- package/cordis.patch.yml +11 -0
- package/icon.svg +7 -0
- package/index.js +1221 -0
- package/lib/native-picker.ps1 +33 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +64 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.0 — 2026-11-05
|
|
4
|
+
|
|
5
|
+
Initial release.
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- Codex-style project sources: attach folders to a workspace, each with an
|
|
10
|
+
editable alias; the workspace root stays the session `cwd`.
|
|
11
|
+
- Sandbox re-rooting for `write` / `edit` / `pwsh` / `bash`, so every source
|
|
12
|
+
gets the session's current mode (read-only still denies, workspace-write
|
|
13
|
+
allows).
|
|
14
|
+
- Project editor: session-header button + session-creation dock entry; native
|
|
15
|
+
folder chooser on Windows (PowerShell) and macOS (osascript), falling back to
|
|
16
|
+
the Host picker and then a manual path field.
|
|
17
|
+
- Alias → absolute path mapping injected into the system prompt.
|
|
18
|
+
- Companion `@` menu group: source folders by alias or folder name, nested
|
|
19
|
+
levels by `alias/…` or absolute path.
|
|
20
|
+
- Source-folder skills: recursive discovery under `<source>/.dsh/skills`,
|
|
21
|
+
`<source>/.agents/skills` and `<source>/skills`.
|
|
22
|
+
- Sessionless `projectSources/*` remote API (`get`, `set`, `listFiles`, `pick`).
|
|
23
|
+
- Mock-runtime tests for the Host half (`test/smoke.mjs`, `test/skills.mjs`).
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 YanGuoHong
|
|
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/NOTICE
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
dsh-project-sources
|
|
2
|
+
Copyright (c) 2026 YanGuoHong
|
|
3
|
+
|
|
4
|
+
This product includes a design adapted from software developed as part of
|
|
5
|
+
dsh-multi-folder (https://github.com/AngelosZou/dsh-multi-folder),
|
|
6
|
+
Copyright (c) Yutong Zou, licensed under the MIT License.
|
|
7
|
+
|
|
8
|
+
The tool-interception and sandbox re-rooting approach in index.js follows that
|
|
9
|
+
project; the source-folder model, aliases, project editor, `@` menu group and
|
|
10
|
+
skill discovery are original to this package.
|
package/README.md
CHANGED
|
@@ -1,3 +1,86 @@
|
|
|
1
|
-
#
|
|
1
|
+
# dsh-project-sources
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[中文](README.zh.md) | **English**
|
|
4
|
+
|
|
5
|
+
> Codex-style project sources for DeepSeek Harness: one workspace, many folders, each with an alias the agent can use.
|
|
6
|
+
|
|
7
|
+
A DeepSeek Harness plugin bundle that attaches extra folders to a workspace. The session keeps the workspace as its `cwd`; every attached folder gets the **same read / write / edit / command permissions** under the session's current sandbox mode, and each one carries a short **alias** the model can refer to.
|
|
8
|
+
|
|
9
|
+
- **Project editor** — “编辑项目” dialog from the session header, or the “📁 项目源文件夹” pill on the session-creation page. Add folders, rename aliases, remove them.
|
|
10
|
+
- **Aliases in the conversation** — one system-prompt section maps every alias to its absolute path, so `@web/src/a.ts` is unambiguous to the model.
|
|
11
|
+
- **`@` menu coverage** — the shipped `@` provider is single-root; this plugin contributes a companion group that searches every source (by alias, by folder name, or by absolute path).
|
|
12
|
+
- **Source-folder skills** — `/` finds skills under `<source>/.dsh/skills`, `<source>/.agents/skills` and `<source>/skills`, recursively.
|
|
13
|
+
- **No new tools** — `read`/`glob`/`grep` already work anywhere; `write`/`edit`/`pwsh`/`bash` are intercepted and re-rooted at the matching source.
|
|
14
|
+
|
|
15
|
+
## Requirements
|
|
16
|
+
|
|
17
|
+
- DeepSeek Harness **0.2.1-rc.5 … 0.2.x** (`engines.dsh: ^0.2.1-rc.5`)
|
|
18
|
+
- Node.js ≥ 20
|
|
19
|
+
|
|
20
|
+
## Install
|
|
21
|
+
|
|
22
|
+
From the Web UI: **Settings → Plugins → Add**, then paste `dsh-project-sources`.
|
|
23
|
+
|
|
24
|
+
From the CLI:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
dsh plugin --profile <profile> add dsh-project-sources@0.1.0
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Or from a local checkout (the agent tool `plugin_manager` accepts a directory):
|
|
31
|
+
|
|
32
|
+
```text
|
|
33
|
+
plugin_manager install_bundle target: D:\work\dsh-project-sources
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Restart the Host after a source change (the Host module is imported at boot); the browser bundle reloads on a page refresh.
|
|
37
|
+
|
|
38
|
+
## Usage
|
|
39
|
+
|
|
40
|
+
| Action | Where |
|
|
41
|
+
| --- | --- |
|
|
42
|
+
| Edit the project | “项目” button in the session header |
|
|
43
|
+
| Edit before the first message | “📁 项目源文件夹” above the composer on the session-creation page |
|
|
44
|
+
| Add a folder | Click “添加文件夹” → the OS folder chooser opens |
|
|
45
|
+
| Rename | Type in the alias field of a row |
|
|
46
|
+
| Remove | `×` on the row (the workspace itself cannot be removed) |
|
|
47
|
+
|
|
48
|
+
Aliases must be letters/digits/`.`/`_`/`-`, at most 48 characters; duplicates get a `-2` suffix.
|
|
49
|
+
|
|
50
|
+
## Where it stores data
|
|
51
|
+
|
|
52
|
+
`<DSH_HOME>/storages/project-sources/<workspace-key>.json` — one record per workspace, outside every agent sandbox root. Only user-driven flows write it; the agent cannot add folders to itself.
|
|
53
|
+
|
|
54
|
+
## Platforms
|
|
55
|
+
|
|
56
|
+
| | Windows | macOS | Linux |
|
|
57
|
+
| --- | --- | --- | --- |
|
|
58
|
+
| Folder chooser | `powershell -STA` + `FolderBrowserDialog` | `osascript … choose folder` | falls back to the Host picker, then the manual path field |
|
|
59
|
+
|
|
60
|
+
The sandbox re-rooting, `@` menu and skill discovery are platform-neutral. macOS support is implemented but not yet tested on a Mac.
|
|
61
|
+
|
|
62
|
+
## Limitations
|
|
63
|
+
|
|
64
|
+
- **One writable root per command.** A shell run writes inside only the directory its `workdir` resolves to. Pass an **absolute** `workdir` inside the source; a relative one resolves against the workspace, and `git -C <source>` / `cd <source>` inside the command does not widen the root.
|
|
65
|
+
- The session `cwd` is fixed: there is no “primary folder” concept, and the workspace root stays the default working directory.
|
|
66
|
+
- Cannot run beside another plugin that intercepts the same tool pipeline (e.g. `dsh-multi-folder`).
|
|
67
|
+
- Background shell runs are supported through the jobs runtime, but a denial that happens after the call returns is only visible in `job_output`.
|
|
68
|
+
|
|
69
|
+
## Development
|
|
70
|
+
|
|
71
|
+
No build step. `npm test` runs both suites without the DSH runtime:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
node test/smoke.mjs # config store, interception, prompt, remote API
|
|
75
|
+
node test/skills.mjs # source-folder skill discovery
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Acknowledgements
|
|
79
|
+
|
|
80
|
+
The tool-interception and sandbox re-rooting approach follows
|
|
81
|
+
[dsh-multi-folder](https://github.com/AngelosZou/dsh-multi-folder) by Yutong Zou
|
|
82
|
+
(MIT). See `NOTICE`.
|
|
83
|
+
|
|
84
|
+
## License
|
|
85
|
+
|
|
86
|
+
MIT
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# dsh-project-sources
|
|
2
|
+
|
|
3
|
+
**中文** | [English](README.md)
|
|
4
|
+
|
|
5
|
+
> 给 DeepSeek Harness 的工作区附加多个文件夹:一个工作区、多个源目录,每个都有别名,模型可直接引用。
|
|
6
|
+
|
|
7
|
+
这是一个 DeepSeek Harness 插件 bundle。会话的 `cwd` 仍然是主工作区;被附加的文件夹在**当前沙箱模式下拥有与主工作区相同**的读写、编辑与命令执行权限,并且每个文件夹都有一个简短的**别名**。
|
|
8
|
+
|
|
9
|
+
- **项目编辑器**:会话头部的「项目」按钮,或新会话页输入框上方的「📁 项目源文件夹」。可添加文件夹、改别名、移除。
|
|
10
|
+
- **会话里用别名引用**:系统提示词注入「别名 → 绝对路径」映射,`@web/src/a.ts` 对模型是明确的。
|
|
11
|
+
- **`@` 菜单覆盖**:内置 `@` 是单根的,本插件贡献一个伴生分组,按别名、目录名或绝对路径搜索所有源目录。
|
|
12
|
+
- **源目录里的 skill**:`/` 能找到 `<源目录>/.dsh/skills`、`<源目录>/.agents/skills`、`<源目录>/skills` 下的技能,递归多层。
|
|
13
|
+
- **不新增任何工具**:`read`/`glob`/`grep` 本来就能跨目录;`write`/`edit`/`pwsh`/`bash` 命中源目录时被拦截,并把沙箱根重定到该目录。
|
|
14
|
+
|
|
15
|
+
## 环境要求
|
|
16
|
+
|
|
17
|
+
- DeepSeek Harness **0.2.1-rc.5 ~ 0.2.x**(`engines.dsh: ^0.2.1-rc.5`)
|
|
18
|
+
- Node.js ≥ 20
|
|
19
|
+
|
|
20
|
+
## 安装
|
|
21
|
+
|
|
22
|
+
Web 界面:**设置 → 插件 → 添加**,填 `dsh-project-sources`。
|
|
23
|
+
|
|
24
|
+
命令行:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
dsh plugin --profile <profile> add dsh-project-sources@0.1.0
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
从本地目录(Agent 工具 `plugin_manager` 可以传目录):
|
|
31
|
+
|
|
32
|
+
```text
|
|
33
|
+
plugin_manager install_bundle target: D:\work\dsh-project-sources
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
改动源码后需要重启 Host(Host 模块在启动时 import);浏览器端刷新页面即可。
|
|
37
|
+
|
|
38
|
+
## 使用
|
|
39
|
+
|
|
40
|
+
| 操作 | 位置 |
|
|
41
|
+
| --- | --- |
|
|
42
|
+
| 编辑项目 | 会话头部的「项目」按钮 |
|
|
43
|
+
| 发第一条消息前编辑 | 新会话页、输入框上方的「📁 项目源文件夹」 |
|
|
44
|
+
| 添加文件夹 | 点「添加文件夹」→ 弹出系统文件夹对话框 |
|
|
45
|
+
| 改别名 | 直接编辑该行的别名输入框 |
|
|
46
|
+
| 移除 | 该行的 `×`(工作区本身不能移除) |
|
|
47
|
+
|
|
48
|
+
别名限字母/数字/`.`/`_`/`-`,最长 48 字符;重名自动加 `-2` 后缀。
|
|
49
|
+
|
|
50
|
+
## 数据存放
|
|
51
|
+
|
|
52
|
+
`<DSH_HOME>/storages/project-sources/<workspace-key>.json`,一个工作区一个文件,放在所有 Agent 沙箱根之外。只有用户操作会写入;Agent 无法给自己加目录。
|
|
53
|
+
|
|
54
|
+
## 平台
|
|
55
|
+
|
|
56
|
+
| | Windows | macOS | Linux |
|
|
57
|
+
| --- | --- | --- | --- |
|
|
58
|
+
| 文件夹选择器 | `powershell -STA` + `FolderBrowserDialog` | `osascript … choose folder` | 退回宿主 picker,再退回手动输入 |
|
|
59
|
+
|
|
60
|
+
沙箱重定根、`@` 菜单、技能发现都与平台无关。macOS 分支已实现,但尚未在 Mac 上实测。
|
|
61
|
+
|
|
62
|
+
## 已知限制
|
|
63
|
+
|
|
64
|
+
- **一条命令只能写一个根**:shell 命令只能写入其 `workdir` 指向的目录。请传源目录的**绝对** `workdir`;相对路径会按工作区解析,命令里 `git -C <源>` / `cd <源>` 也不会扩大可写根。
|
|
65
|
+
- 会话 `cwd` 固定:没有「主文件夹」概念,工作区仍是默认工作目录。
|
|
66
|
+
- 不能与另一个拦截同一工具流水线的插件(如 `dsh-multi-folder`)同时启用。
|
|
67
|
+
- 后台命令通过 jobs 运行时支持,但调用返回之后才发生的拒绝只能在 `job_output` 里看到。
|
|
68
|
+
|
|
69
|
+
## 开发
|
|
70
|
+
|
|
71
|
+
无构建步骤。`npm test` 不需要 DSH 运行时:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
node test/smoke.mjs # 配置存储、拦截、提示词、remote API
|
|
75
|
+
node test/skills.mjs # 源目录技能发现
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## 致谢
|
|
79
|
+
|
|
80
|
+
工具拦截与沙箱重定根的思路参考了 [dsh-multi-folder](https://github.com/AngelosZou/dsh-multi-folder)(作者 Yutong Zou,MIT),详见 `NOTICE`。
|
|
81
|
+
|
|
82
|
+
## License
|
|
83
|
+
|
|
84
|
+
MIT
|