dsh-plugin-standalone-session 0.0.0-stage → 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 dsh-plugin-standalone-session contributors
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
@@ -1,3 +1,144 @@
1
- # Temporary Holding Version
1
+ # dsh-plugin-standalone-session
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [![npm](https://img.shields.io/npm/v/dsh-plugin-standalone-session)](https://www.npmjs.com/package/dsh-plugin-standalone-session)
4
+ [![release](https://img.shields.io/github/v/release/LRainner/dsh-plugin-standalone-session)](https://github.com/LRainner/dsh-plugin-standalone-session/releases)
5
+
6
+ DeepSeek Harness 的独立会话:**不隶属于任何工作区**,但完整复用原生输入区。
7
+
8
+ - 插件 ID:`standalone-session`
9
+ - 中文名:`独立会话` / `Standalone Session`
10
+ - 兼容 DSH:`>=0.2.1-rc.2 <0.3.0-0`
11
+ - License:MIT
12
+
13
+ ## 功能
14
+
15
+ - 侧边栏顶部点击 **新建独立会话**,直接创建并打开会话。
16
+ - 上一次由该入口创建的空白会话会复用,避免连点产生大量空会话;管理面板空状态可强制新建。
17
+ - 侧边栏底部 **管理独立会话**:点击行打开,`⋯` 菜单重命名/删除。
18
+ - 原生输入区可用:模型选择、附件、`/` 指令、发送。
19
+ - 重启 DSH 后仍保持独立状态。
20
+ - 不替换原生新建会话、工作区浏览器、会话菜单或聊天 UI。
21
+
22
+ ## 安装
23
+
24
+ ### npm(推荐)
25
+
26
+ **Web**
27
+
28
+ ```bash
29
+ dsh plugin --profile web add dsh-plugin-standalone-session
30
+ ```
31
+
32
+ 重启 `dsh web`,硬刷新页面。
33
+
34
+ **Desktop**
35
+
36
+ 打开 **插件 / Plugins** → 安装 → 输入 `dsh-plugin-standalone-session`,然后完全退出并重启 DSH。
37
+
38
+ 桌面端的 profile 由 Electron 管理,不能用 `dsh plugin --profile desktop` 安装。
39
+
40
+ ### 本地 tarball
41
+
42
+ ```bash
43
+ npm ci
44
+ npm run build
45
+ npm pack
46
+ dsh plugin --profile web add /absolute/path/to/dsh-plugin-standalone-session-0.1.0.tgz
47
+ ```
48
+
49
+ > 不要直接安装 GitHub 源码 tarball。仓库不包含构建后的 `lib/`,pnpm 会因构建脚本策略报 `ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED`;请用 npm 包或本地 tarball。
50
+
51
+ ## 使用
52
+
53
+ - **新建**:点击侧边栏顶部 `新建独立会话`。如果上次创建的会话仍为空白,会直接复用它。
54
+ - **管理**:点击底部 `管理独立会话(n)`,或命令菜单里的 `独立会话:管理`。
55
+ - **命令**:输入 `/`,选择 `独立会话:新建` / `独立会话:管理`。
56
+ - **删除**:使用 DSH 原生归档,不是物理删除;已删除会话可在归档视图中恢复。
57
+
58
+ 管理面板点击整行打开会话;行尾 `⋯` 提供重命名和删除。删除最后一条后会停留在空状态,不会跳回新会话页。
59
+
60
+ ## 与普通会话的区别
61
+
62
+ | | 普通工作区会话 | 独立会话 |
63
+ | --- | --- | --- |
64
+ | 工作区归属 | 属于某个工作区 | 不属于任何工作区 |
65
+ | 工作区注册表 | 有记录 | 没有记录 |
66
+ | 侧边栏 | 工作区分组 | 顶层“未分组” + 独立面板 |
67
+ | 工作目录 | 工作区目录 | `~/.dsh/dsh-standalone-sessions/<sessionId>` |
68
+ | 输入区 | 原生启用 | 插件解锁同一个原生 InputBar |
69
+
70
+ ## 实现
71
+
72
+ 没有创建临时工作区,也没有 patch 原生 workspace 逻辑:
73
+
74
+ - 会话自身 `cwd` 带有独立标记;宿主 `registry.json` 记录生命周期。
75
+ - 客户端只包装 `conversation.composer.bar`:当 cwd 是独立标记且原生输入区为 disabled 时解锁。
76
+ - 不替换原生聊天、工作区选择器、会话菜单或新建按钮。
77
+
78
+ 数据目录:
79
+
80
+ ```text
81
+ ~/.dsh/dsh-standalone-sessions/
82
+ ├── registry.json
83
+ └── session-<uuid>/
84
+ ```
85
+
86
+ 删除语义:
87
+
88
+ - 空白且目录为空:归档后删除工作目录。
89
+ - 目录非空或产生过消息:保留目录,便于恢复。
90
+ - 清理失败会记录日志并重试,不阻塞归档。
91
+
92
+ ## 兼容与限制
93
+
94
+ - 只在 DSH `>=0.2.1-rc.2 <0.3.0-0` 验证。
95
+ - 独立会话仍会出现在原生“未分组”区域;插件没有替换 WorkspaceBrowser。
96
+ - 原生 hero 的 `选择工作区` chip 仍在;插件只在右侧显示 `独立会话 · 无工作区`。
97
+ - 卸载后,空白独立会话的输入区会回到原生 inert 状态;有消息的会话不受影响。
98
+ - DSH 没有物理删除会话 API,删除等于归档。
99
+ - 自定义 `DSH_HOME` 时,独立会话目录仍固定在 `~/.dsh/dsh-standalone-sessions`。
100
+
101
+ ## 开发
102
+
103
+ ```bash
104
+ npm ci
105
+ npm run check # typecheck + build + 51 个单元测试
106
+ npm test
107
+ ```
108
+
109
+ 产物:
110
+
111
+ - `lib/index.js`:宿主插件
112
+ - `lib/client.js`:客户端 Module Loader bundle
113
+ - `lib/types/**`:类型声明
114
+
115
+ ## 发布
116
+
117
+ 发布使用 [Release Please](https://github.com/googleapis/release-please-action):合并 `feat:` / `fix:` 后自动创建 release PR;合并 release PR 后自动创建 tag、GitHub Release,并通过 npm Trusted Publishing 发布和附加 tarball。
118
+
119
+ 首次使用需要在 npm 包设置中配置 Trusted Publisher:
120
+
121
+ - Repository:`LRainner/dsh-plugin-standalone-session`
122
+ - Workflow:`release.yml`
123
+
124
+ 同时确保仓库 Actions 设置允许创建 pull request。
125
+
126
+ ## 卸载
127
+
128
+ ```bash
129
+ dsh plugin --profile web remove dsh-plugin-standalone-session
130
+ ```
131
+
132
+ Desktop 在 **插件 / Plugins** 页面卸载,然后完全重启。
133
+
134
+ 卸载不会删除会话。确需清理独立会话目录时:
135
+
136
+ ```bash
137
+ rm -rf ~/.dsh/dsh-standalone-sessions
138
+ ```
139
+
140
+ 这会删除工作目录,可能包含 agent 写入的文件;会话历史仍由 DSH 管理。
141
+
142
+ ## License
143
+
144
+ MIT
@@ -0,0 +1,6 @@
1
+ # dsh-plugin-standalone-session: additive sidebar/panel entries plus a composer
2
+ # adapter. It never replaces the native New Session, workspace browser, picker,
3
+ # session menus or chat surface.
4
+ - insert:
5
+ - id: standalone-session
6
+ name: dsh-plugin-standalone-session
package/icon.svg ADDED
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64" fill="none">
2
+ <rect x="4" y="4" width="56" height="56" rx="14" fill="#1F4F8F"/>
3
+ <path d="M14 20a5 5 0 0 1 5-5h26a5 5 0 0 1 5 5v18a5 5 0 0 1-5 5H30l-9 8v-8h-2a5 5 0 0 1-5-5V20Z" fill="#fff" fill-opacity=".96"/>
4
+ <path d="M33 19.5l2.623 6.377L42 28.5l-6.377 2.623L33 37.5l-2.623-6.377L24 28.5l6.377-2.623L33 19.5Z" fill="#1F4F8F"/>
5
+ </svg>