dsh-prompt-manage 0.2.0 → 0.4.1
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/CHANGELOG.md +41 -0
- package/README.md +73 -96
- package/README.zh.md +67 -0
- package/THIRD_PARTY_NOTICES.md +16 -0
- package/assets/icon-512.png +0 -0
- package/client.js +852 -117
- package/icon.svg +7 -5
- package/index.js +205 -31
- package/locale/en.json +2 -2
- package/locale/zh.json +2 -2
- package/optimizer.js +288 -0
- package/package.json +9 -3
- package/prompts/prompt-optimizer.system.md +109 -0
- package/screenshots/composer-optimize.png +0 -0
- package/screenshots/composer-palette-search.png +0 -0
- package/screenshots/composer-entry.png +0 -0
- package/screenshots/composer-palette-dark.png +0 -0
- package/screenshots/composer-palette.png +0 -0
- package/screenshots/prompt-history-search.png +0 -0
- package/screenshots/prompt-history.png +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,47 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project are documented in this file.
|
|
4
4
|
|
|
5
|
+
## 0.4.1
|
|
6
|
+
|
|
7
|
+
Released on 2026-11-23.
|
|
8
|
+
|
|
9
|
+
- Replace the package icon (`icon.svg`) and its 512px catalog render (`assets/icon-512.png`) with the clock-history mark that matches the current composer and sidebar glyph, and point the README header in both languages at `icon.svg` so the README and the DSH Plugins page show the same current artwork.
|
|
10
|
+
|
|
11
|
+
## 0.4.0
|
|
12
|
+
|
|
13
|
+
Released on 2026-11-19.
|
|
14
|
+
|
|
15
|
+
- Rename the visible product to **Prompt Manage** / **提示词管理** everywhere the sidebar and page title show it; the package id stays `dsh-prompt-manage`.
|
|
16
|
+
- Make the history index scale to thousands of prompts: warm the index at activation, keep parsed per-session results in a bounded LRU cache, revalidate unchanged payloads with a stable ETag, and serve stale-while-revalidate between scans. The response budget rises to 10,000 prompts / 4,000,000 characters.
|
|
17
|
+
- Speed up search by preparing lowercased prompt and metadata text once per index, replacing the per-keystroke character loop with native `indexOf` fuzzy matching over the full prompt, and deferring the filter pass so typing stays responsive with thousands of long prompts.
|
|
18
|
+
- Search now explicitly treats whitespace-separated words as an AND query: `react 登录` matches only prompts containing both terms, in any order, across prompt text, project, and session title; matching terms are highlighted when they fall inside the preview window.
|
|
19
|
+
- Render the sidebar list in 100-row pages with a **Show more** button and `content-visibility` for off-screen rows; the composer palette stays capped at 60 results.
|
|
20
|
+
- Add a mock-data screenshot of the composer palette search for the README; every prompt, project, and session visible in it is synthetic.
|
|
21
|
+
- Rewrite the README around user-facing features, screenshots, installation, and usage, remove implementation details, and add a Simplified Chinese version.
|
|
22
|
+
|
|
23
|
+
## 0.3.2
|
|
24
|
+
|
|
25
|
+
Released on 2026-11-19.
|
|
26
|
+
|
|
27
|
+
- Keep the composer prompt palette inside the viewport on short windows: its height now follows the room above the composer instead of forcing a minimum that clipped the search row.
|
|
28
|
+
- Place the caret at the end of the draft after applying a history prompt (including command mode) and after optimizing a prompt.
|
|
29
|
+
- Replace the composer history and optimizer glyphs with a clock-history icon and a magic-wand icon (ISC-licensed Lucide geometry), and refresh the README and plugin metadata descriptions accordingly.
|
|
30
|
+
|
|
31
|
+
## 0.3.1
|
|
32
|
+
|
|
33
|
+
Released on 2026-11-18.
|
|
34
|
+
|
|
35
|
+
- Fix the composer command mode (`/goal`, `/plan`, and other slash commands): the prompt history **Apply** action and the **Optimize prompt** chip now stay usable while a command chip is active.
|
|
36
|
+
- Applying a history prompt in command mode appends it after the command instead of replacing the leading slash command; optimizing reads and replaces only the command's argument text while preserving the command chip.
|
|
37
|
+
|
|
38
|
+
## 0.3.0
|
|
39
|
+
|
|
40
|
+
Released on 2026-11-18.
|
|
41
|
+
|
|
42
|
+
- Add a sparkle **Optimize prompt** chip immediately left of the prompt history chip in the composer. It sends the current draft through the session's selected model with the editable system prompt in `prompts/prompt-optimizer.system.md` and replaces the draft with the model's `<optimized_prompt>` block.
|
|
43
|
+
- The optimizer reads the system prompt from disk on every request so future tuning only needs a file edit; add its host service, POST route, timeout, input limit, error codes, and a success toast with **Undo**.
|
|
44
|
+
- Keep the history palette, sidebar page, and all existing copy unchanged; the optimizer shares the composer tool row and theme tokens.
|
|
45
|
+
|
|
5
46
|
## 0.2.0
|
|
6
47
|
|
|
7
48
|
Released on 2026-11-17.
|
package/README.md
CHANGED
|
@@ -1,105 +1,82 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
- **Apply** (or clicking a row, or pressing Enter on the highlighted row) puts
|
|
35
|
-
the prompt into the composer. With an empty composer the whole draft is
|
|
36
|
-
replaced; with an existing draft the prompt is inserted at the caret and
|
|
37
|
-
padded so it never glues onto neighbouring text.
|
|
38
|
-
- Up/Down walk the results, Escape closes the palette and returns focus to the
|
|
39
|
-
composer, and clicking anywhere else closes it. While the composer is sending
|
|
40
|
-
or running a command, Apply stays disabled and the footer says why.
|
|
41
|
-
- The palette reuses one 30-second cache of the local index: reopening is
|
|
42
|
-
instant, and a failed refresh keeps the previous rows visible.
|
|
43
|
-
|
|
44
|
-
## How it works
|
|
45
|
-
|
|
46
|
-
- Host half: registers one local route, `GET /api/prompt-history`, and builds an
|
|
47
|
-
in-memory index from `sessionQuery.listSessions()` + `sessionQuery.readSession()`.
|
|
48
|
-
Only `user/message` events whose source kind is `user` are indexed, plus the
|
|
49
|
-
objective of a `/goal` command (the Harness wraps that command instead of
|
|
50
|
-
creating a plain user message). Time, runtime, approval, other command, and
|
|
51
|
-
subagent-authored messages are excluded.
|
|
52
|
-
- Client half: registers `sidebar.panellist` with the matching `main` panel, then
|
|
53
|
-
adds two composer contributions that share one seat: a compact chip in
|
|
54
|
-
`conversation.input.right` (rendered directly before the model selector) and
|
|
55
|
-
the palette in the composer's own `conversation.input.overlay` anchor, which
|
|
56
|
-
positions it above the card at the composer's width. The palette never portaled
|
|
57
|
-
into `document.body`, so it inherits the host theme, the composer's stacking
|
|
58
|
-
context, and the docked layout.
|
|
59
|
-
- Insertion uses the session's published input actions: `setDraft` for an empty
|
|
60
|
-
draft (so multi-line prompts become real paragraphs) and `insertText` at the
|
|
61
|
-
caret captured when the chip was pressed otherwise. Focus returns through the
|
|
62
|
-
conversation input facade, which restores the editor's stored selection.
|
|
63
|
-
- The chip and the palette are hand-written controls styled only with
|
|
64
|
-
`--dsw-alias-*` / `--dsw-*` theme tokens; the bundle imports no Harness Client
|
|
65
|
-
package, so host upgrades cannot break it.
|
|
66
|
-
- Cache: per-session persistence revisions avoid re-reading unchanged logs. The
|
|
67
|
-
cache is memory-only; the session log remains the source of truth.
|
|
68
|
-
|
|
69
|
-
## Privacy and limits
|
|
70
|
-
|
|
71
|
-
Everything stays on the local machine. The route sits behind Connection's
|
|
72
|
-
Host/Origin and browser-authentication fence, and returns only prompt text,
|
|
73
|
-
project labels, session titles, and timestamps. It never uploads content or
|
|
74
|
-
writes to session logs. On macOS, the first copy can raise the system
|
|
75
|
-
clipboard/app-data permission prompt; allow it once to enable copying. Fork-inherited prompt prefixes are skipped so a forked
|
|
76
|
-
session does not duplicate its parent's history. Up to 5,000 prompts and 2,000
|
|
77
|
-
sessions are returned per request, with a 2,000,000-character response budget;
|
|
78
|
-
longer prompt text is truncated at 50,000 characters for display while the
|
|
79
|
-
source log is untouched. The palette renders at most 60 rows per search.
|
|
80
|
-
|
|
81
|
-
## Install
|
|
82
|
-
|
|
83
|
-
From npm:
|
|
1
|
+
<p align="center"><img src="icon.svg" width="96" height="96" alt="Prompt Manage icon"></p>
|
|
2
|
+
|
|
3
|
+
# Prompt Manage
|
|
4
|
+
|
|
5
|
+
[English](README.md) | [简体中文](README.zh.md)
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/dsh-prompt-manage)
|
|
8
|
+
[](LICENSE)
|
|
9
|
+
|
|
10
|
+
Prompt Manage is a DeepSeek Harness plugin that helps you reuse prompts you
|
|
11
|
+
have already written and turn rough drafts into clearer prompts before sending
|
|
12
|
+
them.
|
|
13
|
+
|
|
14
|
+
## Features
|
|
15
|
+
|
|
16
|
+
- **Prompt palette.** Click the clock icon in the composer to search every
|
|
17
|
+
prompt you have written. Search prompt text, project names, and session
|
|
18
|
+
titles; separate words with spaces to require all of them. **Apply** inserts
|
|
19
|
+
a prompt at the caret.
|
|
20
|
+
- **Prompt optimizer.** Click the magic-wand icon to rewrite the current draft
|
|
21
|
+
with the model selected in the composer. **Undo** restores the original text.
|
|
22
|
+
- **Prompt Manage page.** Open it from the sidebar to browse every prompt with
|
|
23
|
+
its project, session, and time. Copy any prompt with one click.
|
|
24
|
+
|
|
25
|
+
## Screenshots
|
|
26
|
+
|
|
27
|
+

|
|
28
|
+
|
|
29
|
+

|
|
30
|
+
|
|
31
|
+
## Installation
|
|
32
|
+
|
|
33
|
+
### From npm
|
|
84
34
|
|
|
85
35
|
```sh
|
|
86
36
|
dsh plugin --profile desktop add dsh-prompt-manage
|
|
87
37
|
```
|
|
88
38
|
|
|
89
|
-
|
|
90
|
-
must be listed in the profile's `dsh.profile.bundles`; the Plugins page adds
|
|
91
|
-
that row for you. Release notes live in [CHANGELOG.md](CHANGELOG.md) and the
|
|
92
|
-
publishing steps are in [RELEASING.md](RELEASING.md).
|
|
39
|
+
### From a local checkout
|
|
93
40
|
|
|
94
|
-
|
|
41
|
+
In DeepSeek Harness, open **Plugins → Add plugin** and select the checkout
|
|
42
|
+
directory.
|
|
95
43
|
|
|
96
|
-
|
|
44
|
+
### Requirements
|
|
97
45
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
46
|
+
- DeepSeek Harness 0.2.2 or newer
|
|
47
|
+
- A Web or desktop profile
|
|
48
|
+
|
|
49
|
+
## Usage
|
|
50
|
+
|
|
51
|
+
### Reuse a prompt
|
|
52
|
+
|
|
53
|
+
1. Open a conversation and click the clock icon next to the model selector.
|
|
54
|
+
2. Search for a prompt, then click **Apply** or press Enter.
|
|
55
|
+
3. Edit the inserted text before sending.
|
|
56
|
+
|
|
57
|
+
If you search with multiple words, every word must match. For example,
|
|
58
|
+
`react 登录` finds prompts that mention both terms.
|
|
59
|
+
|
|
60
|
+
### Optimize a draft
|
|
61
|
+
|
|
62
|
+
1. Type or paste your draft in the composer.
|
|
63
|
+
2. Click the magic-wand icon.
|
|
64
|
+
3. Review the rewritten draft and press **Undo** if needed.
|
|
65
|
+
|
|
66
|
+
### Browse prompt history
|
|
67
|
+
|
|
68
|
+
Open **Prompt Manage** from the sidebar to see all saved prompts, or choose
|
|
69
|
+
**View all prompts** at the bottom of the composer palette. Each row shows the
|
|
70
|
+
prompt's project, session, and time; use **Copy** to copy it.
|
|
71
|
+
|
|
72
|
+
## Privacy
|
|
73
|
+
|
|
74
|
+
Prompt Manage reads local DSH session records only. Nothing is uploaded except
|
|
75
|
+
the draft you choose to optimize, which is sent to the model selected in your
|
|
76
|
+
composer in the same way as a normal message. The plugin never writes to your
|
|
77
|
+
session history.
|
|
78
|
+
|
|
79
|
+
## License
|
|
102
80
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
normally unnecessary. The package is MIT licensed.
|
|
81
|
+
MIT. See [LICENSE](LICENSE). Icon geometry adapted from Lucide is covered in
|
|
82
|
+
[THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<p align="center"><img src="icon.svg" width="96" height="96" alt="提示词管理图标"></p>
|
|
2
|
+
|
|
3
|
+
# 提示词管理
|
|
4
|
+
|
|
5
|
+
[English](README.md) | 简体中文
|
|
6
|
+
|
|
7
|
+
[](https://www.npmjs.com/package/dsh-prompt-manage)
|
|
8
|
+
[](LICENSE)
|
|
9
|
+
|
|
10
|
+
提示词管理是一个 DeepSeek Harness 插件,帮你复用已经写过的提示词,并在发送前把草稿改写成更清晰的提示词。
|
|
11
|
+
|
|
12
|
+
## 功能
|
|
13
|
+
|
|
14
|
+
- **提示词弹窗。** 在输入框点击时钟图标,搜索你写过的所有提示词。可以按提示词内容、项目名或会话标题搜索;多个关键词用空格分隔,必须同时匹配。点击「应用」即可把提示词插入光标处。
|
|
15
|
+
- **提示词优化。** 点击魔棒图标,用输入框当前选择的模型改写草稿;如果不满意,可以点击「撤销」恢复原文。
|
|
16
|
+
- **提示词管理页面。** 从侧边栏打开,查看全部提示词及其所属项目、会话和输入时间,并支持一键复制。
|
|
17
|
+
|
|
18
|
+
## 截图
|
|
19
|
+
|
|
20
|
+

|
|
21
|
+
|
|
22
|
+

|
|
23
|
+
|
|
24
|
+
## 安装
|
|
25
|
+
|
|
26
|
+
### 从 npm 安装
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
dsh plugin --profile desktop add dsh-prompt-manage
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### 从本地目录安装
|
|
33
|
+
|
|
34
|
+
在 DeepSeek Harness 中打开 **插件 → 添加插件**,选择本地目录即可。
|
|
35
|
+
|
|
36
|
+
### 环境要求
|
|
37
|
+
|
|
38
|
+
- DeepSeek Harness 0.2.2 或更高版本
|
|
39
|
+
- Web 或桌面版 profile
|
|
40
|
+
|
|
41
|
+
## 使用
|
|
42
|
+
|
|
43
|
+
### 复用提示词
|
|
44
|
+
|
|
45
|
+
1. 打开任意对话,点击模型选择器旁边的时钟图标。
|
|
46
|
+
2. 搜索要用的提示词,点击「应用」或按 Enter。
|
|
47
|
+
3. 按需修改插入的文本后发送。
|
|
48
|
+
|
|
49
|
+
如果搜索多个词,所有词都必须匹配。例如 `react 登录` 会找到同时包含这两个词的提示词。
|
|
50
|
+
|
|
51
|
+
### 优化提示词
|
|
52
|
+
|
|
53
|
+
1. 在输入框中输入或粘贴草稿。
|
|
54
|
+
2. 点击魔棒图标。
|
|
55
|
+
3. 查看改写结果,如果不满意可以点击「撤销」恢复原文。
|
|
56
|
+
|
|
57
|
+
### 浏览提示词管理
|
|
58
|
+
|
|
59
|
+
从侧边栏打开 **提示词管理** 查看全部提示词,也可以在输入框弹窗底部点击「查看全部提示词」。每条记录都会显示所属项目、会话和输入时间,点击「复制」即可复制完整提示词。
|
|
60
|
+
|
|
61
|
+
## 隐私
|
|
62
|
+
|
|
63
|
+
提示词管理只读取本机 DSH 会话记录。除了你主动使用提示词优化时发送给当前所选模型的草稿外,不会上传任何内容;插件也不会写入你的会话历史。
|
|
64
|
+
|
|
65
|
+
## 许可证
|
|
66
|
+
|
|
67
|
+
MIT,详见 [LICENSE](LICENSE)。图标几何来自 Lucide(ISC 许可),说明见 [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md)。
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Third-party notices
|
|
2
|
+
|
|
3
|
+
## Lucide icons
|
|
4
|
+
|
|
5
|
+
The history (clock with rewind arrow) and optimize (magic wand with sparkles)
|
|
6
|
+
SVG geometries in `client.js` and `icon.svg` are adapted from
|
|
7
|
+
[Lucide](https://lucide.dev), Copyright (c) 2022 Lucide Contributors,
|
|
8
|
+
licensed under the ISC License:
|
|
9
|
+
|
|
10
|
+
> ISC License
|
|
11
|
+
>
|
|
12
|
+
> Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
|
|
13
|
+
>
|
|
14
|
+
> Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
|
|
15
|
+
>
|
|
16
|
+
> THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
Binary file
|