@nelsonlongxiang/dsh-prompt-templates 0.2.8 → 0.2.10
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/README.md +37 -42
- package/README_zh.md +65 -0
- package/images/image-01.png +0 -0
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -1,70 +1,65 @@
|
|
|
1
|
-
# dsh-prompt-templates
|
|
1
|
+
# @nelsonlongxiang/dsh-prompt-templates
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
plugin: a Host bridge, a browser panel, and the Python backend it persists
|
|
5
|
-
through — all in one repository, installable with `dsh plugin`.
|
|
3
|
+
English | [中文](README_zh.md)
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/@nelsonlongxiang/dsh-prompt-templates)
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
plus a composer tool-row button that toggles it and inserts template content
|
|
11
|
-
into the draft. Templates persist in SQLite through a Python backend; the Host
|
|
12
|
-
bridges it in as a subprocess speaking newline-delimited JSON-RPC.
|
|
7
|
+
Quick prompt templates for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness): global and per-session templates, a right-side browser panel, and a Python-backed SQLite persistence — one self-contained plugin, installable with `dsh plugin`.
|
|
13
8
|
|
|
14
|
-
|
|
15
|
-
- Session templates are private to one session and can be promoted to global.
|
|
16
|
-
- The panel supports insert (append to draft), send-now, edit, delete, and
|
|
17
|
-
make-global actions, drag repositioning, and double-click reset.
|
|
9
|
+

|
|
18
10
|
|
|
19
|
-
##
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
dsh plugin --profile web add @nelsonlongxiang/dsh-prompt-templates
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Restart `dsh web`, then look for the templates button in the composer tool row.
|
|
18
|
+
|
|
19
|
+
**Requires `uv` on PATH** — install bootstraps a package-local Python venv with `uv sync`; a machine without it fails loud with a one-line fix instead of a broken install. The plugin composes beside the stock webserver row and spawns its Python child from that venv.
|
|
20
|
+
|
|
21
|
+
## What you get
|
|
22
|
+
|
|
23
|
+
- **Global + per-session templates** — globals apply everywhere; session templates stay private to one conversation and can be promoted to global in one click
|
|
24
|
+
- **Insert or send** — one click appends the template into the draft; send-now dispatches immediately; edit, delete, and make-global all live in the row
|
|
25
|
+
- **Search & scroll** — filter the list as you type, reliable scrolling for long collections
|
|
26
|
+
- **Drag to reposition, double-click to reset** — the panel remembers where you put it
|
|
27
|
+
- **Durable by design** — templates persist in SQLite through a Python backend the Host bridges in as a managed subprocess (newline-delimited JSON-RPC); the child is lazily spawned and torn down with the plugin
|
|
28
|
+
|
|
29
|
+
## How it works
|
|
20
30
|
|
|
21
31
|
```text
|
|
22
32
|
src/ TypeScript plugin (host half + browser half)
|
|
23
|
-
index.ts Host: spawns the Python child, exposes the
|
|
33
|
+
index.ts Host: spawns the Python child, exposes the HTTP routes
|
|
24
34
|
client/ Browser: panel UI registered into shell.overlay and
|
|
25
35
|
conversation.input.right
|
|
26
36
|
python/ Python backend package (template domain only)
|
|
27
37
|
src/dsh_prompt_templates/
|
|
28
|
-
pyproject.toml
|
|
38
|
+
pyproject.toml models, store, JSON-RPC server, CLI
|
|
29
39
|
cordis.patch.yml Bundle patch: mounts the plugin row
|
|
30
|
-
tsdown.config.ts Browser bundle (__ModuleLoader__ protocol)
|
|
31
40
|
```
|
|
32
41
|
|
|
33
|
-
The Python package
|
|
34
|
-
template domain (models, store, JSON-RPC server, CLI), extracted from the
|
|
35
|
-
shared extension backend so a plugin stays minimal and self-contained.
|
|
36
|
-
|
|
37
|
-
## Install
|
|
42
|
+
The Python package carries only the prompt-template domain, extracted from the shared extension backend so the plugin stays minimal and self-contained.
|
|
38
43
|
|
|
39
|
-
|
|
40
|
-
dsh plugin --profile <name> add <this package>
|
|
41
|
-
```
|
|
44
|
+
## Security
|
|
42
45
|
|
|
43
|
-
|
|
44
|
-
the
|
|
46
|
+
- Template content reaches a model request only as ordinary user text the user chose to insert — no automatic injection into any prompt
|
|
47
|
+
- The panel talks to the Python backend over the Host's plugin routes only; no extra listener, no outbound network
|
|
45
48
|
|
|
46
49
|
## Development
|
|
47
50
|
|
|
48
51
|
```sh
|
|
49
52
|
pnpm install
|
|
53
|
+
pnpm verify # typecheck + Python backend tests (uv --group test)
|
|
50
54
|
pnpm build # tsc host + tsc client + tsdown browser bundle
|
|
51
|
-
|
|
52
|
-
python/pytest # Python backend tests (uv run --project python/ext pytest)
|
|
53
|
-
pnpm test # TS tests
|
|
55
|
+
node scripts/bootstrap.mjs # uv sync the package-local venv
|
|
54
56
|
```
|
|
55
57
|
|
|
56
|
-
##
|
|
58
|
+
## Known limitations
|
|
57
59
|
|
|
58
|
-
|
|
59
|
-
a
|
|
60
|
+
- **Insert appends to the draft** — caret-position insert is deferred
|
|
61
|
+
- **Session templates need a current session** — with no session open, only global templates are reachable
|
|
60
62
|
|
|
61
|
-
##
|
|
63
|
+
## License
|
|
62
64
|
|
|
63
|
-
|
|
64
|
-
caret-position insert is deferred.
|
|
65
|
-
- **Session templates need a current session** — with no session open, only
|
|
66
|
-
global templates are reachable.
|
|
67
|
-
- **No template search** — the panel lists all templates; filtering is
|
|
68
|
-
deferred until the template count justifies it.
|
|
69
|
-
- **Python backend needs a local interpreter** — install bootstraps a
|
|
70
|
-
package-local venv with `uv`; a machine without `uv` must pre-create it.
|
|
65
|
+
MIT
|
package/README_zh.md
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# @nelsonlongxiang/dsh-prompt-templates
|
|
2
|
+
|
|
3
|
+
[English](README.md) | 中文
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@nelsonlongxiang/dsh-prompt-templates)
|
|
6
|
+
|
|
7
|
+
[DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 快捷提示词模板:全局与会话级模板、右侧浏览器面板、Python 后端的 SQLite 持久化——一个自包含插件,`dsh plugin` 即装。
|
|
8
|
+
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
## 安装
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
dsh plugin --profile web add @nelsonlongxiang/dsh-prompt-templates
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
重启 `dsh web`,在输入框工具行找到模板按钮。
|
|
18
|
+
|
|
19
|
+
**需要 PATH 上有 `uv`**——安装时用 `uv sync` 建包内 Python venv;缺失的机器会大声报错并给出一行修复指引,而不是装出坏插件。插件组合在标准 webserver 行旁,Python 子进程从该 venv 拉起。
|
|
20
|
+
|
|
21
|
+
## 你能得到什么
|
|
22
|
+
|
|
23
|
+
- **全局 + 会话模板**——全局处处生效;会话模板只属于当前对话,一键提升为全局
|
|
24
|
+
- **插入或直发**——一键追加进草稿;send-now 立即发送;编辑、删除、转全局都在行内
|
|
25
|
+
- **搜索与滚动**——边输入边过滤,长列表滚动可靠
|
|
26
|
+
- **拖拽定位、双击复位**——面板记住你放的位置
|
|
27
|
+
- **设计即持久**——模板经 Python 后端存 SQLite,Host 以受管子进程接入(换行分隔 JSON-RPC);子进程惰性拉起、随插件卸载回收
|
|
28
|
+
|
|
29
|
+
## 工作原理
|
|
30
|
+
|
|
31
|
+
```text
|
|
32
|
+
src/ TypeScript 插件(host 面 + 浏览器面)
|
|
33
|
+
index.ts Host:拉起 Python 子进程,暴露 HTTP 路由
|
|
34
|
+
client/ 浏览器:面板 UI 注册进 shell.overlay 与
|
|
35
|
+
conversation.input.right
|
|
36
|
+
python/ Python 后端包(仅模板领域)
|
|
37
|
+
src/dsh_prompt_templates/
|
|
38
|
+
pyproject.toml models、store、JSON-RPC server、CLI
|
|
39
|
+
cordis.patch.yml Bundle patch:挂插件行
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Python 包只承载模板领域,从共享扩展后端剥离而来,保持插件最小自包含。
|
|
43
|
+
|
|
44
|
+
## 安全
|
|
45
|
+
|
|
46
|
+
- 模板内容只有经用户主动插入才作为普通用户文本进入模型请求——绝不自动注入任何提示词
|
|
47
|
+
- 面板仅经 Host 的插件路由访问 Python 后端;无额外监听、无外联网络
|
|
48
|
+
|
|
49
|
+
## 开发
|
|
50
|
+
|
|
51
|
+
```sh
|
|
52
|
+
pnpm install
|
|
53
|
+
pnpm verify # typecheck + Python 后端测试(uv --group test)
|
|
54
|
+
pnpm build # tsc host + tsc client + tsdown 浏览器 bundle
|
|
55
|
+
node scripts/bootstrap.mjs # uv sync 包内 venv
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## 已知限制
|
|
59
|
+
|
|
60
|
+
- **插入是追加到草稿**——光标位置插入暂缓
|
|
61
|
+
- **会话模板需要当前会话**——无会话打开时只能用全局模板
|
|
62
|
+
|
|
63
|
+
## 许可证
|
|
64
|
+
|
|
65
|
+
MIT
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nelsonlongxiang/dsh-prompt-templates",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.10",
|
|
4
4
|
"description": "Quick prompt templates for DeepSeek Harness: global and per-session templates, a browser panel, and a Python-backed persistence backend",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -25,7 +25,9 @@
|
|
|
25
25
|
"python/README.md",
|
|
26
26
|
"scripts",
|
|
27
27
|
"cordis.patch.yml",
|
|
28
|
-
"README.md"
|
|
28
|
+
"README.md",
|
|
29
|
+
"README_zh.md",
|
|
30
|
+
"images"
|
|
29
31
|
],
|
|
30
32
|
"dsh": {
|
|
31
33
|
"bundle": {
|