Skip to content
dsh.fish
Bundle

dsh-prompt-history

DSH composer plugin: ↑/↓ prompt-history navigation — browse the current session's sent prompts right in the input box, with a "历史 x/y" badge.

Source
cw1999mm
License
MIT
Updated
Updated 8 hours ago

Readme

# dsh-prompt-history

English | [中文](README.zh-CN.md)

DSH (DeepSeek Harness) community plugin: **↑/↓ prompt-history navigation** for the composer. Recall the prompts you already sent in the current session without leaving the input box — press `↑` to pull back the last sent prompt, browse older ones with `↑`/`↓`, and always keep your original draft safe.

A small `历史 x/y` badge appears in the composer's tool row while you browse.

## Features

- `↑`/`↓` browse the current session's sent prompts (user + steering nodes), newest first.
- Consecutive duplicates are collapsed.
- Multi-line drafts are respected: `↑` only starts browsing when the caret is on the first line.
- Browsing exits automatically when you send the message or switch sessions; pressing `↓` past the newest prompt restores your saved draft.
- Keydown is bound to the composer card (`[data-composer-card]`), not `window`. Sidebar search and other inputs never see the handler.

## Requirements

- A DeepSeek Harness **web** profile (any profile name; the examples below use `web`).

## Installation

The package ships its compiled `lib/` in the repo, so neither install path needs a build step.

### Option A — tarball

```sh
cd dsh-prompt-history
npm pack                        # → dsh-prompt-history-0.1.0.tgz
dsh plugin --profile web add ./dsh-prompt-history-0.1.0.tgz
```

### Option B — git (latest)

```sh
dsh plugin --profile web add github:cw1999mm/dsh-prompt-history
```

Then restart (or refresh) the web UI. The plugin loads as the `dsh-prompt-history` bundle layer; remove it with:

```sh
dsh plugin --profile web remove dsh-prompt-history
```

### Manual / development install

Link the package into your profile's `node_modules` and add the bundle row:

```sh
# from the profile directory (e.g. ~/.dsh/profiles/web)
pnpm add link:<absolute path to this project>
```

Then append to the profile's `cordis.patch.yml`:

```yaml
- insert:
    - id: dsh-prompt-history
      name: dsh-prompt-history
```

## Usage

1. Focus the composer and type — or don't: your draft is saved automatically.
2. Press `↑` (with the caret on the first line) to load the most recent prompt you sent in this session.
3. `↑`/`↓` move through older/newer prompts; the `历史 x/y` badge shows where you are.
4. Press `↓` past the newest prompt (or just send) to return to your original draft.

## How it works

- `lib/index.js` — host half. Deliberately empty: it exists only so the plugin is a valid, activating row in the cordis composition.
- `lib/client.js` — browser half, discovered through the package's `dsh.client` declaration. It declares `inject = ['slots']`, waits for that service, then hooks `conversation.input.right`, binds ↑/↓ on the composer card, and reads the session's chat snapshot to build the prompt history.

## License

[MIT](./LICENSE) © 2026 cw1999mm

Install

dsh plugin --profile web add github:cw1999mm/dsh-prompt-history

Profile: web

  • This source has no pinned commit, so a later push upstream changes what installs. Prefer pinning a commit.
Source