@nelsonlongxiang/dsh-prompt-templates 0.2.8 → 0.2.9

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.
Files changed (3) hide show
  1. package/README.md +35 -42
  2. package/README_zh.md +63 -0
  3. package/package.json +3 -2
package/README.md CHANGED
@@ -1,70 +1,63 @@
1
- # dsh-prompt-templates
1
+ # @nelsonlongxiang/dsh-prompt-templates
2
2
 
3
- Quick prompt templates for DeepSeek Harness, distributed as one self-contained
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
- ## What it is
5
+ [![npm](https://img.shields.io/npm/v/@nelsonlongxiang/dsh-prompt-templates?label=npm)](https://www.npmjs.com/package/@nelsonlongxiang/dsh-prompt-templates)
8
6
 
9
- A right-side panel listing **global** and **per-session** prompt templates,
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
- - Global templates apply to every session.
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
+ ## Install
10
+
11
+ ```sh
12
+ dsh plugin --profile web add @nelsonlongxiang/dsh-prompt-templates
13
+ ```
14
+
15
+ Restart `dsh web`, then look for the templates button in the composer tool row.
16
+
17
+ **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.
18
18
 
19
- ## Layout
19
+ ## What you get
20
+
21
+ - **Global + per-session templates** — globals apply everywhere; session templates stay private to one conversation and can be promoted to global in one click
22
+ - **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
23
+ - **Search & scroll** — filter the list as you type, reliable scrolling for long collections
24
+ - **Drag to reposition, double-click to reset** — the panel remembers where you put it
25
+ - **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
26
+
27
+ ## How it works
20
28
 
21
29
  ```text
22
30
  src/ TypeScript plugin (host half + browser half)
23
- index.ts Host: spawns the Python child, exposes the Typert Remote
31
+ index.ts Host: spawns the Python child, exposes the HTTP routes
24
32
  client/ Browser: panel UI registered into shell.overlay and
25
33
  conversation.input.right
26
34
  python/ Python backend package (template domain only)
27
35
  src/dsh_prompt_templates/
28
- pyproject.toml
36
+ pyproject.toml models, store, JSON-RPC server, CLI
29
37
  cordis.patch.yml Bundle patch: mounts the plugin row
30
- tsdown.config.ts Browser bundle (__ModuleLoader__ protocol)
31
38
  ```
32
39
 
33
- The Python package is **not** `dsh_ext` — this plugin carries only the prompt
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
40
+ The Python package carries only the prompt-template domain, extracted from the shared extension backend so the plugin stays minimal and self-contained.
38
41
 
39
- ```sh
40
- dsh plugin --profile <name> add <this package>
41
- ```
42
+ ## Security
42
43
 
43
- The bundle patch mounts the plugin row; the Host spawns the Python child from
44
- the package-local venv created during install.
44
+ - Template content reaches a model request only as ordinary user text the user chose to insert — no automatic injection into any prompt
45
+ - The panel talks to the Python backend over the Host's plugin routes only; no extra listener, no outbound network
45
46
 
46
47
  ## Development
47
48
 
48
49
  ```sh
49
50
  pnpm install
51
+ pnpm verify # typecheck + Python backend tests (uv --group test)
50
52
  pnpm build # tsc host + tsc client + tsdown browser bundle
51
- python/python-bootstrap.mjs # uv sync the package-local Python venv
52
- python/pytest # Python backend tests (uv run --project python/ext pytest)
53
- pnpm test # TS tests
53
+ node scripts/bootstrap.mjs # uv sync the package-local venv
54
54
  ```
55
55
 
56
- ## Model Experience
56
+ ## Known limitations
57
57
 
58
- Indirectly, through the conversation draft: inserted template content reaches
59
- a model request only as ordinary user text.
58
+ - **Insert appends to the draft** — caret-position insert is deferred
59
+ - **Session templates need a current session** — with no session open, only global templates are reachable
60
60
 
61
- ## Known Limitations and Deferred Work
61
+ ## License
62
62
 
63
- - **Insert appends to the draft** — clicking a template appends its content;
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.
63
+ MIT
package/README_zh.md ADDED
@@ -0,0 +1,63 @@
1
+ # @nelsonlongxiang/dsh-prompt-templates
2
+
3
+ [English](README.md) | 中文
4
+
5
+ [![npm](https://img.shields.io/npm/v/@nelsonlongxiang/dsh-prompt-templates?label=npm)](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
+ ```sh
12
+ dsh plugin --profile web add @nelsonlongxiang/dsh-prompt-templates
13
+ ```
14
+
15
+ 重启 `dsh web`,在输入框工具行找到模板按钮。
16
+
17
+ **需要 PATH 上有 `uv`**——安装时用 `uv sync` 建包内 Python venv;缺失的机器会大声报错并给出一行修复指引,而不是装出坏插件。插件组合在标准 webserver 行旁,Python 子进程从该 venv 拉起。
18
+
19
+ ## 你能得到什么
20
+
21
+ - **全局 + 会话模板**——全局处处生效;会话模板只属于当前对话,一键提升为全局
22
+ - **插入或直发**——一键追加进草稿;send-now 立即发送;编辑、删除、转全局都在行内
23
+ - **搜索与滚动**——边输入边过滤,长列表滚动可靠
24
+ - **拖拽定位、双击复位**——面板记住你放的位置
25
+ - **设计即持久**——模板经 Python 后端存 SQLite,Host 以受管子进程接入(换行分隔 JSON-RPC);子进程惰性拉起、随插件卸载回收
26
+
27
+ ## 工作原理
28
+
29
+ ```text
30
+ src/ TypeScript 插件(host 面 + 浏览器面)
31
+ index.ts Host:拉起 Python 子进程,暴露 HTTP 路由
32
+ client/ 浏览器:面板 UI 注册进 shell.overlay 与
33
+ conversation.input.right
34
+ python/ Python 后端包(仅模板领域)
35
+ src/dsh_prompt_templates/
36
+ pyproject.toml models、store、JSON-RPC server、CLI
37
+ cordis.patch.yml Bundle patch:挂插件行
38
+ ```
39
+
40
+ Python 包只承载模板领域,从共享扩展后端剥离而来,保持插件最小自包含。
41
+
42
+ ## 安全
43
+
44
+ - 模板内容只有经用户主动插入才作为普通用户文本进入模型请求——绝不自动注入任何提示词
45
+ - 面板仅经 Host 的插件路由访问 Python 后端;无额外监听、无外联网络
46
+
47
+ ## 开发
48
+
49
+ ```sh
50
+ pnpm install
51
+ pnpm verify # typecheck + Python 后端测试(uv --group test)
52
+ pnpm build # tsc host + tsc client + tsdown 浏览器 bundle
53
+ node scripts/bootstrap.mjs # uv sync 包内 venv
54
+ ```
55
+
56
+ ## 已知限制
57
+
58
+ - **插入是追加到草稿**——光标位置插入暂缓
59
+ - **会话模板需要当前会话**——无会话打开时只能用全局模板
60
+
61
+ ## 许可证
62
+
63
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nelsonlongxiang/dsh-prompt-templates",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
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,8 @@
25
25
  "python/README.md",
26
26
  "scripts",
27
27
  "cordis.patch.yml",
28
- "README.md"
28
+ "README.md",
29
+ "README_zh.md"
29
30
  ],
30
31
  "dsh": {
31
32
  "bundle": {