Sttrevens/dsh-linked-folders

dsh plugin: multi-folder workspace — global linked-folders list + per-session on-the-fly linking, managed from the Web sidebar.

Bundle 已验证 MIT JavaScript 未知
Bundle 已验证

已收录

0

Session

Bundle 已验证

版本未知
语言JavaScript
许可证MIT
在 GitHub 查看

预览

第 1 个预览,共 2 个:Sttrevens/dsh-linked-folders
第 2 个预览,共 2 个:Sttrevens/dsh-linked-folders

功能介绍

多文件夹工作区:全局链接文件夹列表 + 会话内临时挂载(link_folder/unlink_folder),侧边栏管理并支持系统选目录。

适合

  • 需要在一个 DSH 会话中跨多个仓库或目录工作的开发者。
  • 希望同时使用持久化全局目录列表和由 Agent 管理的会话临时链接的用户。
  • 适合通过侧边栏管理并使用系统原生目录选择器的 DSH Web 工作流。

不适合

  • 期望链接目录自动扩大写权限的用户;在 workspace-write 模式下,写入仍限制在会话工作区根目录。
  • 不需要额外目录根路径的单文件夹工作流,增加链接及对应提示词没有实际价值。
  • 依赖可选工作区选择器菜单入口、但无法在 DSH 更新后重新应用编译客户端补丁的用户。

README

@steven-wu/dsh-linked-folders

Out-of-tree dsh plugin that gives a session multi-folder workspace access — like Codex’s linked folders.

  • A global linked-folders list (durable, cross-session) — your “global workspace”.
  • Per-session temporary links the model adds/removes on the fly with link_folder / unlink_folder.

Both lists are injected into the system prompt, so the model knows which extra roots it may cd into and work across.

Install

The package declares a dsh.bundle manifest, so dsh plugin add installs it and adds it to the profile’s bundle layers automatically:

dsh plugin --profile web add @steven-wu/dsh-linked-folders
# restart the web profile, then refresh the page

Use

  • Composer → the 📁 button on the left of the input bar. Click it to open the panel: manage the global list (add by absolute path or Browse…, remove with ×) and see this session’s temporary links.
  • Model: say “link folder /path/to/foo” — the agent calls link_folder; “unlink /path/to/foo” calls unlink_folder. Session links appear in the prompt as (this session).
Workspace-picker entry (optional Tier-2 patch)

The official workspace-picker menu is inline (not a slot), so the plugin can’t add to it. scripts/patch-workspace-picker.py patches the compiled dsh-client-ui-workspace bundle to add a “Link folder…” entry next to “Add workspace”; selecting it dispatches dsh:link-folder-requested, which this plugin listens for (opens the native picker and links the chosen path).

python3 scripts/patch-workspace-picker.py
# then restart dsh web

Re-run after a dsh update (idempotent; the original bundle is backed up to *.pre-linkfolder.bak).

Configuration

State lives in ~/.dsh/linked-folders.json:

{
  "global": ["/Users/you/projects/app", "/Users/you/projects/lib"],
  "sessions": { "session-abc…": ["/tmp/scratch"] }
}

Override the path with the DSH_LINKED_FOLDERS env var or the bundle row’s config.path. Linked folders are canonicalized to real paths and must be existing directories.

Sandbox note

The plugin only advertises folders to the model and provides the management UI; it does not change the file sandbox. Under danger-full-access the model can read/write anywhere; under workspace-write it can read linked folders but writes are still confined to the session workspace root.

Model experience

  • System prompt: a ## Linked folders section listing global + session roots.
  • Tools: link_folder(path) / unlink_folder(path).
  • Web Remote: the client bundle explicitly mounts the linkedFolders Remote contribution before the sidebar consumes it (required by dsh rc.6+).
  • Prompt token cost: proportional to the number of linked folders (one short line each), zero when none are linked.

常见问题常见问题

在启用了 DSH 的终端中执行已验证命令 dsh plugin --profile default add github:Sttrevens/dsh-linked-folders。命令会解析公开 package 元数据,并保持插件与本页展示的目录身份一致。