
Company News
Jerod Santo Joins Socket as Head of Media
Allow myself to introduce... myself.
DSH Web workbench base: a VSCode-style layout shell (activity bar, side bar, editor area, panel, status bar) with a registry service (ctx.workbench) that feature plugins use to mount panels, editor views, activity items, status items and commands.
DSH 生态中最好的工作台基座插件 —— 没有之一。 别人做工作台是在造轮子,dock 直接把 VSCode 级别的布局外壳、开放注册表和即插即用的插件生态端到你面前:想要文件浏览器?装一个。想要 Git 图?再装一个。你的 DSH 从此拥有一整个 IDE 级工作台,而 dock 就是那个把一切拼起来的奇迹基座。
DSH Web 工作台基础插件:提供 VSCode 风格布局外壳(活动栏 / 侧边栏 / 编辑器区 / 面板 / 状态栏),并通过注册表服务 ctx.workbench 让功能插件挂载面板、编辑器视图、活动项、状态项与命令。本插件是 dock 系列的基础:dock-files、dock-editor、dock-images、dock-markdown、dock-git 都依赖它提供的工作台外壳。
executeCommand 命令注册与调用。registerActivityBarItem / registerPanel / registerEditorView / registerStatusBarItem / registerCommand / registerSetting,全部返回反注册函数,配合 ctx.effect 使用可随插件停用自动清理。dock 基座只提供工作台外壳,不附带文件浏览、编辑等具体能力——这些交给功能插件。下面的推荐一条一条列清楚:全部可选、可自由组合,完全按你的场景按需安装,不需要全部装齐。
组合建议(仅供参考,绝不是必须):
| 场景 | 安装 |
|---|---|
| 只想浏览文件 | dock + dock-files |
| 浏览 + 编辑文本 | dock + dock-files + dock-editor |
| 完整文件工作台 | dock + dock-files + dock-editor + dock-images + dock-markdown |
| 需要管理 Git | 以上任意组合 + dock-git |
只装 dock 本身也完全没问题——它就是一个干净的工作台外壳,等你随时往里加零件。
从 0.2.0 起,工作台公开设置注册 API。功能插件通过 ctx.workbench.registerSetting 注册设置项;返回的反注册函数应交给 ctx.effect,这样插件停用或热更新时会自动移除注册。设置窗口会按 order(再按 id)排序,编辑器只接收当前值、onChange 回调和当前语言,并在写入前执行 validate:
ctx.effect(() => ctx.workbench.registerSetting({
id: 'my-plugin:compact',
pluginId: 'my-plugin',
// 文案可以是字符串,也可以是按语言求值的工厂函数
title: (locale) => locale === 'zh' ? '紧凑模式' : 'Compact mode',
defaultValue: false,
component: CompactToggle,
validate: (value): value is boolean => typeof value === 'boolean',
}))
pluginId 决定设置显示在哪个插件的设置页里。插件还应通过 registerPlugin({ id, title, description, icon, hasEntry }) 注册元数据,设置窗口才能列出它(没有图标时使用 dock 自带的通用插件图标)。有 dock 入口(hasEntry: true)的插件,列表中会提供“打开”按钮和“在 dock 中显示”开关;入口隐藏后仍可从设置里打开。
用户可从工作台打开设置窗口;设置值保存在 localStorage 的 dock:settings 中,刷新后恢复。存储不可用或数据损坏时,工作台使用内存值和默认值继续运行。插件也可通过 getSetting / setSetting / onDidChangeSetting 读取、更新和订阅设置变化。
dock 自身在设置窗口的“通用设置”里提供位置、自动隐藏和“为 dock 预留空间”:
| 依赖 | 类型 | 说明 |
|---|---|---|
| DSH Web 环境 | 运行时 | 必需,最低版本 >=0.1.3-alpha.2。客户端平台为 Web,通过 dsh plugin --profile web add 安装 |
cordis ^4.0.0-rc.7 | peer | 插件框架(DSH 自带) |
react / react-dom ^18.2.0 | peer(可选) | 客户端渲染需要;未提供时工作台 UI 不激活 |
dock 自身不依赖任何其他 dock 系列插件——它是系列的地基,反过来其他五个都依赖它。
需要 DSH Web 环境(dsh plugin --profile web add),且 Harness 版本至少为 0.1.3-alpha.2。
推荐从 npm registry 安装:
dsh plugin --profile web add dock-base
dsh plugin --profile web add dock-files
dsh plugin --profile web add dock-editor
dsh plugin --profile web add dock-images
dsh plugin --profile web add dock-markdown
dsh plugin --profile web add dock-git
或通过 GitHub 安装(备选):
dsh plugin --profile web add github:AKS1st/dock
dsh plugin --profile web add github:AKS1st/dock-files
dsh plugin --profile web add github:AKS1st/dock-editor
dsh plugin --profile web add github:AKS1st/dock-images
dsh plugin --profile web add github:AKS1st/dock-markdown
dsh plugin --profile web add github:AKS1st/dock-git
或按你的 profile 依赖写法使用 link: 本地安装。dock 提供 ctx.workbench 服务;功能插件通过该服务协作,安装顺序不敏感(Cordis 按依赖激活)。
pnpm install
pnpm run build # tsc 类型声明 + tsdown 打包
pnpm run check # 仅类型检查
src/client/contract.ts 是工作台对外契约(WorkbenchService、ViewProps、EditorOpenSeed 等)。功能插件只做类型导入(编译期擦除),运行时全部通过 ctx.workbench 方法调用协作。各功能插件内有一份该契约的 vendored 副本,改动本文件时需同步更新。
MIT
FAQs
DSH Web workbench base: a VSCode-style layout shell (activity bar, side bar, editor area, panel, status bar) with a registry service (ctx.workbench) that feature plugins use to mount panels, editor views, activity items, status items and commands.
The npm package dock-base receives a total of 61 weekly downloads. As such, dock-base popularity was classified as not popular.
We found that dock-base demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Company News
Allow myself to introduce... myself.

Research
/Security News
A Twitch browser extension on Chrome and Firefox forwards users’ live OAuth session tokens through proxies controlled by a Russian bot service.

Security News
Anthropic found biased reasoning and recklessness drove Claude Mythos 5 to publish malware on PyPI and compromise a security vendor.