dsh-x-core 0.1.22 → 0.1.23
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/assets/dsh-preview.png +0 -0
- package/assets/dsh.ico +0 -0
- package/assets/icon.ico +0 -0
- package/assets/tray.ico +0 -0
- package/assets/tray.png +0 -0
- package/core-npm.js +201 -183
- package/desktop-plugins.js +86 -0
- package/desktop.js +200 -0
- package/native-notify.js +74 -0
- package/package.json +1 -1
- package/packs/dsh-x-workbench/README.md +61 -0
- package/packs/dsh-x-workbench/dspack.json +4 -0
- package/packs/dsh-x-workbench/home/skills/agent-browser/LICENSE-APACHE-2.0.txt +202 -0
- package/packs/dsh-x-workbench/home/skills/agent-browser/NOTICE.md +6 -0
- package/packs/dsh-x-workbench/home/skills/agent-browser/SKILL.md +697 -0
- package/packs/dsh-x-workbench/home/skills/agent-browser/references/authentication.md +313 -0
- package/packs/dsh-x-workbench/home/skills/agent-browser/references/commands.md +300 -0
- package/packs/dsh-x-workbench/home/skills/agent-browser/references/profiling.md +120 -0
- package/packs/dsh-x-workbench/home/skills/agent-browser/references/proxy-support.md +194 -0
- package/packs/dsh-x-workbench/home/skills/agent-browser/references/session-management.md +201 -0
- package/packs/dsh-x-workbench/home/skills/agent-browser/references/snapshot-refs.md +229 -0
- package/packs/dsh-x-workbench/home/skills/agent-browser/references/video-recording.md +173 -0
- package/packs/dsh-x-workbench/home/skills/agent-browser/templates/authenticated-session.sh +105 -0
- package/packs/dsh-x-workbench/home/skills/agent-browser/templates/capture-workflow.sh +69 -0
- package/packs/dsh-x-workbench/home/skills/agent-browser/templates/form-automation.sh +62 -0
- package/packs/dsh-x-workbench/home/skills/electron/LICENSE-APACHE-2.0.txt +202 -0
- package/packs/dsh-x-workbench/home/skills/electron/NOTICE.md +6 -0
- package/packs/dsh-x-workbench/home/skills/electron/SKILL.md +243 -0
- package/packs/dsh-x-workbench/manifest.json +35 -0
- package/perf/patch-hooks.mjs +14 -1
- package/perf/plugin-profile.mjs +204 -0
- package/perf/register.mjs +4 -0
- package/platform.js +1 -1
- package/public/booting.html +475 -0
- package/public/favicon.ico +0 -0
- package/public/favicon.png +0 -0
- package/public/icon.png +0 -0
- package/public/index.html +9277 -8176
- package/public/internal-tabs.js +45 -41
- package/public/launcher.css +285 -98
- package/public/mascot.js +1 -1
- package/public/theme.css +33 -6
- package/public/water.js +1 -1
- package/registry.js +38 -3
- package/server.js +1058 -118
- package/settings.js +78 -1
package/desktop.js
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 插件桌面 API(/api/desktop/*)的请求校验。
|
|
3
|
+
*
|
|
4
|
+
* 插件跑在 dsh 子进程里,拿不到 Electron;能力走本机 HTTP:插件 → 管理服务 → 外壳的
|
|
5
|
+
* host.desktop(见 shell/main.mjs)。这个文件只决定「什么请求能过去、长度上限多少」,
|
|
6
|
+
* 真正执行 Notification / dialog / clipboard 的代码在外壳里。
|
|
7
|
+
*
|
|
8
|
+
* 不许 import Electron,也不许 import shell/:核心和外壳是分开更新的两层,核心目录
|
|
9
|
+
* (resources/core 或用户目录 core/current)里没有 shell/,外壳目录里也没有核心模块。
|
|
10
|
+
* 外壳侧另有 shell/desktop.mjs 做它自己的门控(通知开关、节流、Electron 对话框选项)。
|
|
11
|
+
*/
|
|
12
|
+
import { isAbsolute } from 'node:path'
|
|
13
|
+
|
|
14
|
+
/** 协议版本:插件可以按 GET /api/desktop 的 api 字段决定用哪套接口。 */
|
|
15
|
+
export const DESKTOP_API_VERSION = 1
|
|
16
|
+
|
|
17
|
+
/** 外壳能做的事。没有 Electron 外壳时 GET 会返回空数组。 */
|
|
18
|
+
export const DESKTOP_CAPABILITIES = Object.freeze(['notify', 'open', 'reveal', 'clipboard', 'dialog'])
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* 请求上限。通知是给人看的,不是日志通道;剪贴板也不该被拿来做文件传输。
|
|
22
|
+
* 数字写在这里而不是外壳里:校验发生在核心,外壳按拿到的干净数据执行。
|
|
23
|
+
*/
|
|
24
|
+
export const DESKTOP_LIMITS = Object.freeze({
|
|
25
|
+
title: 120,
|
|
26
|
+
body: 800,
|
|
27
|
+
url: 2048,
|
|
28
|
+
text: 100_000,
|
|
29
|
+
path: 4096,
|
|
30
|
+
filters: 8,
|
|
31
|
+
extensions: 10,
|
|
32
|
+
filterName: 60,
|
|
33
|
+
buttons: 4,
|
|
34
|
+
button: 40,
|
|
35
|
+
message: 500,
|
|
36
|
+
detail: 2000,
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
/** 单行文本:控制字符变空格,连续空白压成一个,别让标题把通知撑成两行。 */
|
|
40
|
+
function oneLine(value, max) {
|
|
41
|
+
return String(value ?? '')
|
|
42
|
+
.replace(/[\u0000-\u001f\u007f]+/g, ' ')
|
|
43
|
+
.replace(/\s+/g, ' ')
|
|
44
|
+
.trim()
|
|
45
|
+
.slice(0, max)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** 多行文本:保留换行与制表,掉其余控制字符(通知正文可以有多段)。 */
|
|
49
|
+
function multiLine(value, max) {
|
|
50
|
+
return String(value ?? '')
|
|
51
|
+
.replace(/\r\n?/g, '\n')
|
|
52
|
+
.replace(/[\u0000-\u0008\u000b\u000c\u000e-\u001f\u007f]/g, '')
|
|
53
|
+
.trim()
|
|
54
|
+
.slice(0, max)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** 路径文本:只去控制字符和首尾空白,不压空格——路径里的空格是内容,不是格式。 */
|
|
58
|
+
function pathText(value, max = DESKTOP_LIMITS.path) {
|
|
59
|
+
return String(value ?? '')
|
|
60
|
+
.replace(/[\u0000-\u001f\u007f]/g, '')
|
|
61
|
+
.trim()
|
|
62
|
+
.slice(0, max)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** 只认 http(s):`file:` / `javascript:` / `data:` 都不能进系统浏览器或标签页。 */
|
|
66
|
+
function httpUrl(value) {
|
|
67
|
+
const text = String(value ?? '').trim()
|
|
68
|
+
if (!text || text.length > DESKTOP_LIMITS.url) return ''
|
|
69
|
+
try {
|
|
70
|
+
const url = new URL(text)
|
|
71
|
+
return url.protocol === 'http:' || url.protocol === 'https:' ? url.href : ''
|
|
72
|
+
} catch {
|
|
73
|
+
return ''
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** Electron 对话框的筛选器:扩展名不带点、只留字母数字和 `*`(全部文件)。 */
|
|
78
|
+
function fileFilters(value) {
|
|
79
|
+
if (!Array.isArray(value)) return []
|
|
80
|
+
const filters = []
|
|
81
|
+
for (const item of value.slice(0, DESKTOP_LIMITS.filters)) {
|
|
82
|
+
if (!item || typeof item !== 'object') continue
|
|
83
|
+
const extensions = (Array.isArray(item.extensions) ? item.extensions : [])
|
|
84
|
+
.slice(0, DESKTOP_LIMITS.extensions)
|
|
85
|
+
.map((ext) => String(ext ?? '').trim().replace(/^\./, '').toLowerCase())
|
|
86
|
+
.filter((ext) => /^[a-z0-9*]+$/.test(ext))
|
|
87
|
+
if (!extensions.length) continue
|
|
88
|
+
filters.push({ name: oneLine(item.name, DESKTOP_LIMITS.filterName) || extensions.join('、'), extensions })
|
|
89
|
+
}
|
|
90
|
+
return filters
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** 按钮/默认项的下标:越界或非整数就退回给定的默认值。 */
|
|
94
|
+
function boundedIndex(value, length, fallback) {
|
|
95
|
+
const index = Number(value)
|
|
96
|
+
return Number.isInteger(index) && index >= 0 && index < length ? index : fallback
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function parseNotify(input) {
|
|
100
|
+
const title = oneLine(input.title, DESKTOP_LIMITS.title)
|
|
101
|
+
const body = multiLine(input.body, DESKTOP_LIMITS.body)
|
|
102
|
+
if (!title && !body) throw new Error('通知要有标题或内容')
|
|
103
|
+
const rawUrl = String(input.url ?? '').trim()
|
|
104
|
+
const url = rawUrl ? httpUrl(rawUrl) : ''
|
|
105
|
+
if (rawUrl && !url) throw new Error('通知的点击地址必须是 http(s) 链接')
|
|
106
|
+
return {
|
|
107
|
+
action: 'notify',
|
|
108
|
+
title: title || 'DSH-X',
|
|
109
|
+
body,
|
|
110
|
+
// 插件只能把通知关小声,不能打开用户关掉的提示音;最终静音与否由外壳按设置决定。
|
|
111
|
+
silent: input.silent === true,
|
|
112
|
+
url,
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function parseOpen(input) {
|
|
117
|
+
const url = httpUrl(input.url)
|
|
118
|
+
if (!url) throw new Error('只能打开 http(s) 链接')
|
|
119
|
+
return { action: 'open', url }
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function parseReveal(input) {
|
|
123
|
+
const path = pathText(input.path)
|
|
124
|
+
if (!path) throw new Error('要给一个路径')
|
|
125
|
+
if (!isAbsolute(path)) throw new Error('路径必须是绝对路径')
|
|
126
|
+
return { action: 'reveal', path }
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function parseClipboard(input) {
|
|
130
|
+
if (typeof input.text !== 'string') throw new Error('text 必须是字符串')
|
|
131
|
+
if (input.text.length > DESKTOP_LIMITS.text) throw new Error(`剪贴板内容超过 ${DESKTOP_LIMITS.text} 个字符`)
|
|
132
|
+
return { action: 'clipboard', text: input.text }
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
const MESSAGE_TYPES = new Set(['none', 'info', 'warning', 'error', 'question'])
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* 文件/消息对话框。三种 kind 共用一条路由:插件的用法只有「选 / 存 / 问」三种,
|
|
139
|
+
* 拆成三条只会让客户端多写两个分支。
|
|
140
|
+
*/
|
|
141
|
+
function parseDialog(input) {
|
|
142
|
+
const kind = String(input.kind ?? '')
|
|
143
|
+
if (kind !== 'open' && kind !== 'save' && kind !== 'message') throw new Error('kind 只能是 open / save / message')
|
|
144
|
+
if (kind === 'message') {
|
|
145
|
+
const message = multiLine(input.message, DESKTOP_LIMITS.message)
|
|
146
|
+
if (!message) throw new Error('对话框要有 message')
|
|
147
|
+
const buttons = (Array.isArray(input.buttons) ? input.buttons : [])
|
|
148
|
+
.slice(0, DESKTOP_LIMITS.buttons)
|
|
149
|
+
.map((label) => oneLine(label, DESKTOP_LIMITS.button))
|
|
150
|
+
.filter(Boolean)
|
|
151
|
+
const options = {
|
|
152
|
+
type: MESSAGE_TYPES.has(input.type) ? input.type : 'info',
|
|
153
|
+
message,
|
|
154
|
+
detail: multiLine(input.detail, DESKTOP_LIMITS.detail),
|
|
155
|
+
buttons,
|
|
156
|
+
}
|
|
157
|
+
if (buttons.length) {
|
|
158
|
+
options.defaultId = boundedIndex(input.defaultId, buttons.length, 0)
|
|
159
|
+
options.cancelId = boundedIndex(input.cancelId, buttons.length, buttons.length - 1)
|
|
160
|
+
}
|
|
161
|
+
return { action: 'dialog', kind: 'message', options }
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
const options = {}
|
|
165
|
+
const title = oneLine(input.title, DESKTOP_LIMITS.title)
|
|
166
|
+
if (title) options.title = title
|
|
167
|
+
// 保存对话框的 defaultPath 可以只是个文件名,所以这里不要求绝对路径。
|
|
168
|
+
const defaultPath = pathText(input.defaultPath)
|
|
169
|
+
if (defaultPath) options.defaultPath = defaultPath
|
|
170
|
+
|
|
171
|
+
if (kind === 'open') {
|
|
172
|
+
const directory = input.directory === true
|
|
173
|
+
const properties = [directory ? 'openDirectory' : 'openFile']
|
|
174
|
+
if (input.multiple === true) properties.push('multiSelections')
|
|
175
|
+
options.properties = properties
|
|
176
|
+
}
|
|
177
|
+
// 目录选择不吃筛选器;Electron 传了也会忽略,干脆不传。
|
|
178
|
+
const filters = fileFilters(input.filters)
|
|
179
|
+
if (filters.length && !(kind === 'open' && input.directory === true)) options.filters = filters
|
|
180
|
+
return { action: 'dialog', kind, options }
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
const PARSERS = {
|
|
184
|
+
notify: parseNotify,
|
|
185
|
+
open: parseOpen,
|
|
186
|
+
reveal: parseReveal,
|
|
187
|
+
clipboard: parseClipboard,
|
|
188
|
+
dialog: parseDialog,
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* 路由里的 action + JSON 正文 → 给外壳的干净请求;不认识的 action 返回 null。
|
|
193
|
+
* 校验失败直接抛(路由转 400),错误文案是给插件作者看的。
|
|
194
|
+
*/
|
|
195
|
+
export function parseDesktopRequest(action, input) {
|
|
196
|
+
const parser = PARSERS[String(action ?? '')]
|
|
197
|
+
if (!parser) return null
|
|
198
|
+
const body = input && typeof input === 'object' && !Array.isArray(input) ? input : {}
|
|
199
|
+
return parser(body)
|
|
200
|
+
}
|
package/native-notify.js
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 原生通知总开关:设置里的「任务通知」同时管 `dsh-x-desktop-notify` 的 loader 行。
|
|
3
|
+
*
|
|
4
|
+
* 外壳本来就按这个开关拦截 `/api/desktop/notify`;这里再把插件行一并停掉,让「关」
|
|
5
|
+
* 变成插件不再监听会话事件,而不只是通知被外壳丢掉。开 = 删掉禁用块,关 = 写禁用块。
|
|
6
|
+
* 不卸载包、不动依赖和别的插件开关。
|
|
7
|
+
*
|
|
8
|
+
* 只管装了下面两个包之一的环境:单体插件(dsh-x-desktop-notify)或桌面组
|
|
9
|
+
* (dsh-x-desktop-bundle)。没装的环境不会被写上过期覆盖,以后装组也不会一上来就是停用。
|
|
10
|
+
*/
|
|
11
|
+
import { existsSync, readdirSync, readFileSync } from 'node:fs'
|
|
12
|
+
import { join } from 'node:path'
|
|
13
|
+
import { disableRowId, enableRowId } from './plugins.js'
|
|
14
|
+
|
|
15
|
+
/** 原生通知的 loader 行 id:插件自己的 patch 与桌面组 patch 用的是同一个 id。 */
|
|
16
|
+
export const NATIVE_NOTIFY_ROW_ID = 'x-desktop-notify'
|
|
17
|
+
|
|
18
|
+
/** 装了其中任意一个包的环境才归这个开关管。 */
|
|
19
|
+
export const NATIVE_NOTIFY_PACKAGES = Object.freeze(['dsh-x-desktop-notify', 'dsh-x-desktop-bundle'])
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* 这个 profile 装没装原生通知(单体或组)。
|
|
23
|
+
* @param {object} manifest - profile 的 package.json 内容。
|
|
24
|
+
* @returns {boolean} 装了为 true。
|
|
25
|
+
*/
|
|
26
|
+
export function profileHasNativeNotify(manifest) {
|
|
27
|
+
const dependencies = manifest?.dependencies && typeof manifest.dependencies === 'object' ? manifest.dependencies : {}
|
|
28
|
+
return NATIVE_NOTIFY_PACKAGES.some((name) => Object.hasOwn(dependencies, name))
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* 把原生通知开关落到一个 DSH_HOME 下的所有 profile。
|
|
33
|
+
*
|
|
34
|
+
* 单个环境读不动或补丁层写不进去(不是合法条目数组)只记失败,不影响其它环境——
|
|
35
|
+
* 开关是全局动作,不能因为一个坏环境就一个都关不掉。
|
|
36
|
+
*
|
|
37
|
+
* @param {string} home - DSH_HOME。
|
|
38
|
+
* @param {boolean} enabled - true 恢复插件行;false 停用。
|
|
39
|
+
* @returns {{ home: string, changed: number, profiles: string[], failed: { profile: string, error: string }[] }} 改动结果。
|
|
40
|
+
*/
|
|
41
|
+
export function applyNativeNotify(home, enabled) {
|
|
42
|
+
const result = { home, changed: 0, profiles: [], failed: [] }
|
|
43
|
+
const dir = join(home, 'profiles')
|
|
44
|
+
let names = []
|
|
45
|
+
try {
|
|
46
|
+
names = readdirSync(dir, { withFileTypes: true })
|
|
47
|
+
.filter((entry) => entry.isDirectory() && !entry.name.startsWith('.') && entry.name !== 'node_modules')
|
|
48
|
+
.map((entry) => entry.name)
|
|
49
|
+
} catch {
|
|
50
|
+
return result
|
|
51
|
+
}
|
|
52
|
+
for (const name of names) {
|
|
53
|
+
const profileDir = join(dir, name)
|
|
54
|
+
const file = join(profileDir, 'package.json')
|
|
55
|
+
if (!existsSync(file)) continue
|
|
56
|
+
let manifest
|
|
57
|
+
try {
|
|
58
|
+
manifest = JSON.parse(readFileSync(file, 'utf8'))
|
|
59
|
+
} catch {
|
|
60
|
+
continue
|
|
61
|
+
}
|
|
62
|
+
if (!profileHasNativeNotify(manifest)) continue
|
|
63
|
+
try {
|
|
64
|
+
const outcome = enabled ? enableRowId(profileDir, NATIVE_NOTIFY_ROW_ID) : disableRowId(profileDir, NATIVE_NOTIFY_ROW_ID)
|
|
65
|
+
if (outcome.changed) {
|
|
66
|
+
result.changed += 1
|
|
67
|
+
result.profiles.push(name)
|
|
68
|
+
}
|
|
69
|
+
} catch (error) {
|
|
70
|
+
result.failed.push({ profile: name, error: error instanceof Error ? error.message : String(error) })
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return result
|
|
74
|
+
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# DSH-X 桌面工作台
|
|
2
|
+
|
|
3
|
+
DSH-X 的第二套整合包:**把 [dsh-tauri 桌面版](https://github.com/dsh-tauri/deepseek-harness-desktop) 最常用的几项能力,在纯 dsh 生态里凑齐;再把 [ZCode](https://github.com/zai-org/ZCode) 的两份通用技能带过来。** 装它 = 得到一个独立 profile(默认名 `workbench`),和现有环境互不打扰。
|
|
4
|
+
|
|
5
|
+
> 为什么不是直接装 dsh-tauri 的插件:dsh-tauri 的 12 个内置插件都声明了 `external: ["dsh-tauri/client"]`,依赖 Tauri 宿主桥,在纯 dsh(包括 DSH-X 的 Electron 壳)里加载不到模块。所以这里选的是生态里同能力的独立插件,不是移植。
|
|
6
|
+
|
|
7
|
+
## 里面有什么
|
|
8
|
+
|
|
9
|
+
### 插件(装进 `workbench`,可在插件页单独开关)
|
|
10
|
+
|
|
11
|
+
| 插件 | 干什么 | 对应 dsh-tauri 的 |
|
|
12
|
+
|---|---|---|
|
|
13
|
+
| [`dsh-better-sidebar`](https://github.com/omdsh-dev/DSH-better-sidebar) | 右侧栏完整工作台:懒加载文件树(Git 状态着色、目录监听、全局搜索、拖拽上传)、CodeMirror 编辑器、终端、Source Control(暂存/提交/提交图)、本会话 AI 改动透镜、子代理 | 可选预设 DSH Better Sidebar |
|
|
14
|
+
| [`@cerbur/clutch-dsh-worktree`](https://github.com/Cerbur/clutch-dsh) | 按 Workspace → Worktree → Session 分组的 Git 工作树视图;工作树关系存 Host 自有文件,不改 dsh 的会话元数据 | `dsh-tauri-worktree` |
|
|
15
|
+
| [`dsh-plugin-cron-scheduler`](https://github.com/LittleBlackTong/dsh-plugin-cron) | 定时任务:cron 表达式或侧栏表单建任务,到点向新建/固定会话注入一条 user 消息触发完整 agent 轮次;有执行历史、手动运行、并发与错过不补跑保护 | `dsh-tauri-scheduler` |
|
|
16
|
+
| [`dsh-archived-conversations`](https://github.com/AKS1st/dsh-archived-conversations) | 设置页里的「已归档对话」列表与只读预览(最近 6 条消息)。dsh 目前没有取消归档 API,所以只读、不恢复 | `dsh-tauri-archive` |
|
|
17
|
+
| [`dsh-plugin-notify-sounds`](https://github.com/BillCx330/dsh-plugin-notify-sounds) | 需要你决策或任务完成时的提示音 + 系统通知(点通知跳回窗口),任务栏标题标记「等待你 / 已完成」,看过就安静 | `dsh-tauri-notification` |
|
|
18
|
+
|
|
19
|
+
### 技能(写到 `~/.dsh/skills`,所有 profile 共用)
|
|
20
|
+
|
|
21
|
+
| 技能 | 干什么 | 来源 |
|
|
22
|
+
|---|---|---|
|
|
23
|
+
| `agent-browser` | 浏览器自动化 CLI:导航、填表、点击、截图、抓数据、测 Web 应用;模型按 `agent-browser` 命令驱动 | ZCode 收录自 vercel-labs/agent-browser(Apache-2.0) |
|
|
24
|
+
| `electron` | 通过 Chrome DevTools Protocol 驱动 Electron 应用(VS Code、Slack 等);对 DSH-X 自己的 Electron 壳同样适用 | 同上(ZCode 的 `electron` 技能) |
|
|
25
|
+
|
|
26
|
+
`agent-browser` / `electron` 需要本机有 CLI:`npm i -g agent-browser`、`brew install agent-browser` 或 `cargo install agent-browser`,也可以直接 `npx agent-browser`。技能目录里附了完整参考文档和脚本模板,模型按需读,不会一次性灌进上下文。
|
|
27
|
+
|
|
28
|
+
## 和「DSH-X 推荐整合包」的区别
|
|
29
|
+
|
|
30
|
+
- 推荐包管的是**环境**:配置备份/迁移、记忆、同步、装饰。
|
|
31
|
+
- 这个包管的是**干活**:编辑与 Git、工作树、定时任务、归档、通知,外加浏览器/Electron 自动化技能。
|
|
32
|
+
- 两者装到不同 profile 可以并存;技能同名时后装的覆盖先装的(安装前会备份)。
|
|
33
|
+
|
|
34
|
+
## 怎么装
|
|
35
|
+
|
|
36
|
+
三种方式,任选:
|
|
37
|
+
|
|
38
|
+
1. **本地文件**:把 `.dspack` 拖进插件页的「整合包」区(或点安装选文件)。
|
|
39
|
+
2. **直链**:填这个包的下载地址。
|
|
40
|
+
3. **GitHub 仓库**:填 `owner/repo`(取最新 Release 里的 `.dspack`)。
|
|
41
|
+
|
|
42
|
+
装之前会把「要装什么、要改哪些文件、什么不会装」列给你看,确认了才动手;装失败自动回滚。装完在插件页切到 `workbench`、重启 dsh 生效;技能在「技能」页能看到,改完不用重启。
|
|
43
|
+
|
|
44
|
+
## 需要什么
|
|
45
|
+
|
|
46
|
+
- dsh `>= 0.2.1-rc.1 < 0.3.0`(`dsh-better-sidebar` 从这个版本起支持)。
|
|
47
|
+
- Windows / macOS / Linux;`better-sidebar` 的终端用 dsh 自带的能力,不需要额外 shell 配置。
|
|
48
|
+
- 浏览器/Electron 自动化要另装 `agent-browser` CLI,Electron 应用启动时要带 `--remote-debugging-port`。
|
|
49
|
+
- 定时任务按 dsh 进程存活计时:进程关着的时间段不补跑。
|
|
50
|
+
|
|
51
|
+
## 许可与出处
|
|
52
|
+
|
|
53
|
+
- 整合包本身 MIT。
|
|
54
|
+
- `agent-browser`、`electron` 技能:Copyright 2025 Vercel Inc.,Apache-2.0;本副本取自 zai-org/ZCode(Apache-2.0,commit `3c5b227649371507ddc4eb46ac5133afe6db1cab`)。DSH-X 原样收录未修改,每个技能目录里附了 `NOTICE.md` 与许可全文。
|
|
55
|
+
- 五个插件各自许可见对应 npm 包。
|
|
56
|
+
|
|
57
|
+
## 自己打包
|
|
58
|
+
|
|
59
|
+
```sh
|
|
60
|
+
node scripts/make-pack.mjs packs/dsh-x-workbench # 产出 release/packs/dsh-x-workbench-1.0.0.dspack
|
|
61
|
+
```
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright 2026 Z.AI Co., Ltd
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# 出处与许可
|
|
2
|
+
|
|
3
|
+
- 上游:vercel-labs/agent-browser(`skills/agent-browser/SKILL.md`),Copyright 2025 Vercel Inc.,Apache-2.0。
|
|
4
|
+
- 本副本取自 zai-org/ZCode 的 `.agents/skills/agent-browser`(commit `3c5b227649371507ddc4eb46ac5133afe6db1cab`,Apache-2.0);ZCode 侧对内容做过本地集成、格式与适配调整。
|
|
5
|
+
- DSH-X 原样收录,未再修改;许可全文见同目录 `LICENSE-APACHE-2.0.txt`。
|
|
6
|
+
- 使用时需要本机有 `agent-browser` CLI(`npm i -g agent-browser`、`brew install agent-browser` 或 `cargo install agent-browser`),或用 `npx agent-browser`。
|