Skip to content
dsh.fish
Bundle

dsh-open-in-editor

Open DSH Web produced files in a configurable local macOS IDE or copy their absolute paths.

Source
shaomingbo
License
MIT
Updated
Updated 2 days ago

Readme

# DSH Open in Editor

Open DeepSeek Harness Web produced files in a configurable local macOS IDE or copy their absolute paths.

## Features

- Click a produced filename to open it in the configured default IDE.
- Click its arrow to copy the absolute path, or choose System default, Zed, Visual Studio Code, or Xcode for one open without changing the default.
- When a turn produces more than six paths, expand **+N more** to access every file and collapse it again when finished.
- Choose the default under **Settings → Open in IDE** and refresh local application detection.
- Open files or directories; relative produced paths are resolved against the session workspace first.

The first release supports macOS only. Ordinary inline file links keep DSH's native opener; this plugin replaces only the produced-files turn tail.

Requires DeepSeek Harness v0.1.2-alpha.2 or newer.

## Installation

Run the pinned GitHub release installer:

```sh
npx --yes github:shaomingbo/dsh-open-in-editor#v0.3.1
```

The installer safely updates the `web` profile, enables the bundle, and runs `pnpm install --ignore-scripts`. It preserves a package-manifest backup and restores the original manifest if dependency installation fails. It never restarts DSH automatically.

After installation, restart DSH manually and hard-refresh the existing Web GUI.

Use another profile or package source when needed:

```sh
npx --yes github:shaomingbo/dsh-open-in-editor#v0.3.1 --profile web
npx --yes github:shaomingbo/dsh-open-in-editor#v0.3.1 --source link:/absolute/path/to/dsh-open-in-editor
```

`DSH_OPEN_IN_EDITOR_SOURCE` provides the same source override for automation.

Check the configured state:

```sh
npx --yes github:shaomingbo/dsh-open-in-editor#v0.3.1 status
```

Manual profile editing remains a fallback: add the pinned source to `dependencies`, add `dsh-open-in-editor` to `dsh.profile.bundles`, then run `pnpm install --ignore-scripts` in the profile directory.

## Security

- Browser-to-Host RPC is restricted to loopback authority.
- The Host accepts absolute paths only and uses `realpath` plus `stat` to require an existing regular file or directory.
- Applications come from a fixed allowlist; arbitrary commands, executables, and arguments are not accepted.
- `/usr/bin/open` is invoked with an argv array and never through a shell.
- Path copying uses the browser Clipboard API after resolving relative paths against the session workspace; it does not add a Host RPC.
- The default IDE is persisted through DSH's `open-in-editor` settings namespace.

## Development

```sh
pnpm install --ignore-scripts
npm run check
```

Tests cover application detection, path validation, safe argv construction, absolute-path copying, clipboard failures, default and one-shot IDE selection, loopback RPC registration, turn-tail chain selection, produced-path expansion/deduplication, and settings registration.

## Uninstall

```sh
npx --yes github:shaomingbo/dsh-open-in-editor#v0.3.1 uninstall
```

Then restart DSH manually and hard-refresh the Web GUI.

## License

MIT

Install

dsh plugin --profile web add github:shaomingbo/dsh-open-in-editor#4c3dbfe064df7ebdfc2ac05ca0be83d8df2c0c48

Profile: web

Source