dsh-sidebar-quote 0.0.0-stage → 1.0.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.
@@ -0,0 +1,43 @@
1
+ # Asset licenses(素材权利声明)
2
+
3
+ 本插件(`dsh-sidebar-quote`)的**代码**以 MIT 许可发布(见根目录 LICENSE)。
4
+ 图形素材的权利**独立于代码许可**,逐项声明如下。
5
+
6
+ ## 1. `icon.svg` — 插件卡片图标(原创,MIT)
7
+
8
+ 手写 SVG(简笔蓝鲸 + 浅蓝圆角底),由本仓库作者原创绘制,
9
+ 随代码一同以 MIT 许可分发。
10
+
11
+ ## 1b. `icon.png` / `avatar.png` / `icon-avatar.png` — 位图图标与鲸鱼按钮头像(AI 二创,CC BY-NC-SA 4.0)
12
+
13
+ - 形象来源:社区为 DeepSeek Harness 创作的"鲸鱼女仆"非官方同人形象
14
+ (俗称"大肥鱼")。该同人形象是 DeepSeek 鲸标的非官方二创;
15
+ **DeepSeek 名称与鲸标商标归 DeepSeek(深度求索)所有**,本项目与其无隶属或背书关系。
16
+ - `icon.png`、`avatar.png`、`icon-avatar.png` 是**同一张 128px 图**(客户端内嵌
17
+ `AVATAR_DATA_URL` 的源文件):以一张社区流传的鲸鱼女仆参考图(原始画师不详)为输入,
18
+ 经 AI 图像编辑模型二次创作生成(新增比 V 手势与构图调整),
19
+ 再经裁切、羽化圆形遮罩与缩放处理。
20
+ - `icon.png` 因此**不是原创素材**:包内代码/手写 SVG 的 MIT 许可不覆盖这三个位图。
21
+ 这三个位图按 **CC BY-NC-SA 4.0** 处理(与同类社区插件的既有声明一致):
22
+ - BY — 分发时须保留本声明与来源说明;
23
+ - NC — 不得将本头像单独用于商业用途(插件代码的 MIT 不延伸覆盖它);
24
+ - SA — 基于本头像的二次创作须以相同许可共享。
25
+ - 本仓库**不主张**对该底层角色设计拥有任何权利;原始参考图不随本包分发。
26
+
27
+ ## 3. `preview.svg` — 详情页预览图(原创,MIT)
28
+
29
+ 手写 SVG 示意图(文档选区 → 引用按钮 → 输入框),随代码以 MIT 分发。
30
+
31
+ ## 权利一览
32
+
33
+ | 文件 | 类型 | 许可 |
34
+ | --- | --- | --- |
35
+ | `index.js` / `client.js` 等代码 | 原创代码 | MIT |
36
+ | `icon.svg` | 原创手绘 SVG | MIT |
37
+ | `icon.png` / `avatar.png` / `icon-avatar.png` | 社区同人形象的 AI 二创 | CC BY-NC-SA 4.0 |
38
+ | `preview.svg` | 原创手绘 SVG | MIT |
39
+
40
+ ---
41
+
42
+ 若你是上述同人形象的作者且希望更改这份声明的许可或署名方式,
43
+ 请提 issue,我们会尽快配合调整。
package/LICENSE ADDED
@@ -0,0 +1,32 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 dsh-sidebar-quote authors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
23
+ ---
24
+
25
+ Scope of this license: the MIT license above covers the plugin **code** and
26
+ the author-original artwork (`icon.svg`, `icon.png`, `preview.svg`).
27
+ It does **not** cover `avatar.png` (the whale-girl button avatar), which is
28
+ an AI-derived fan-work distributed under CC BY-NC-SA 4.0 — see
29
+ ASSET_LICENSE.md for the full asset declaration.
30
+ "DeepSeek" and the DeepSeek whale logo are trademarks of DeepSeek
31
+ (深度求索); this project is unofficial and not affiliated with or endorsed
32
+ by DeepSeek.
package/README.md CHANGED
@@ -1,3 +1,83 @@
1
- # Temporary Holding Version
1
+ # dsh-sidebar-quote
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Select text in the sidebar document preview (Markdown, PDF, Office, plain text,
4
+ code) and ask about it right there: the selection enters the composer as a
5
+ read-only quote chip with your question attached. A little whale beside the
6
+ composer rewrites your draft into an executable prompt — and every rewrite is
7
+ reviewed by you before it touches anything.
8
+
9
+ ## What it does
10
+
11
+ - **Quote & ask** — select text in a document preview, press the floating
12
+ button, type your question, press Enter. The quote goes into the composer as
13
+ an atomic read-only chip (`insertQuote`), so the model (and you) can always
14
+ tell what you were asking about. The source filename is shown on the card
15
+ when the preview provides one. Quotes longer than 8000 characters are
16
+ truncated and the card tells you so.
17
+ - **Prompt optimization (the whale)** — press the whale to send the draft to a
18
+ two-stage rewrite:
19
+ 1. *Analyze* finds real execution gaps (missing task boundary, background,
20
+ constraints, output form, or acceptance criteria). If the gaps would
21
+ change the result completely, it asks at most two questions first.
22
+ If there is nothing worth closing, it says so and leaves your draft alone.
23
+ 2. *Generate* rewrites the draft to close exactly those gaps, longer or
24
+ shorter as needed — no fixed template, no fixed length multiplier.
25
+ A deterministic gate flags invented facts, placeholders and copy-only
26
+ rewrites; violations trigger one repair round before you ever see it.
27
+ 3. You get a **preview panel** (draggable, action buttons always visible)
28
+ listing what changed and which gap each change closes. Nothing is written
29
+ to the composer until you press "Write to composer". One click on ↩
30
+ restores your original draft.
31
+ - Quotes stay read-only through optimization: the rewrite replaces your words,
32
+ never the quoted originals.
33
+
34
+ ## Recommended usage
35
+
36
+ The optimizer does not see your conversation history — only the draft and any
37
+ quotes in it. So:
38
+
39
+ - **First message of a project, or a standalone task**: press the whale; the
40
+ rewrite adds the background it needs.
41
+ - **Follow-up turns**: send as-is; the conversation already carries the
42
+ context.
43
+ - **A follow-up that could be misunderstood**: quote the previous conclusion
44
+ into the composer, then press the whale — quotes are the context channel.
45
+
46
+ ## Requirements
47
+
48
+ - DSH `>=0.2.2-rc.1`, Node `>=22`
49
+ - Uses the agent's currently selected model; two model calls per optimization
50
+ (analyze + generate), each capped (2048 / 8192 output tokens). No data leaves
51
+ the model provider you already use.
52
+
53
+ ## Install
54
+
55
+ From npm (once published):
56
+
57
+ ```
58
+ dsh plugin add dsh-sidebar-quote
59
+ ```
60
+
61
+ Or from a local checkout:
62
+
63
+ ```
64
+ dsh plugin add <path-to-this-repo>
65
+ ```
66
+
67
+ ## Privacy
68
+
69
+ Your draft (and any quoted text) is sent to the selected model for rewriting.
70
+ Nothing is stored beyond the draft itself; the plugin keeps no history of its
71
+ own.
72
+
73
+ ## License & assets
74
+
75
+ Code and hand-drawn SVGs (icon.svg, preview.svg): MIT (see LICENSE). The
76
+ bitmap icons (icon.png / avatar.png) are AI-derived fan works of a community
77
+ mascot, distributed under CC BY-NC-SA 4.0 — see
78
+ ASSET_LICENSE.md. "DeepSeek" and the whale logo are trademarks of DeepSeek;
79
+ this plugin is unofficial and not endorsed by DeepSeek.
80
+
81
+ ## License
82
+
83
+ MIT
package/README.zh.md ADDED
@@ -0,0 +1,58 @@
1
+ # dsh-sidebar-quote 使用说明
2
+
3
+ 在右侧文档预览(Markdown / PDF / Office / 纯文本 / 代码)里选中一段文字,就地提问:选区会以只读引用的形式进入输入框,你的问题跟在后面。输入框旁的小鲸鱼可以把草稿改写成一份能直接执行的提示词——每一步都经过你的确认。
4
+
5
+ ## 功能
6
+
7
+ ### 1. 引用并提问
8
+
9
+ 1. 在文档预览里选中文字,浮出「引用并提问」按钮;
10
+ 2. 旁边出现小卡片,显示引用预览和来源文件名(预览能提供时);
11
+ 3. 输入问题,Enter 存入输入框(Shift+Enter 换行,Esc 取消);
12
+ 4. 引用以只读形式进入输入框,多段之间自动空行。
13
+
14
+ 超过 8000 字符的选区会被截断,卡片会明确提示「超出上限的部分已截掉」,不会静默丢失。
15
+
16
+ ### 2. 提示词优化(小鲸鱼)
17
+
18
+ 点鲸鱼后走两阶段改写:
19
+
20
+ 1. **找缺口**:分析草稿缺什么(任务边界 / 背景 / 约束 / 输出形式 / 验收标准五类)。缺口会实质性改变结果时,最多问两个问题再动笔;没有值得补的缺口时直说「没改动」,不会硬改。
21
+ 2. **改写**:按缺口整篇重写,允许更长或更短——没有固定模板和扩写倍率。确定性闸门会拦下编造的具体值、占位符和"只换说法",有违规会自动跑一轮修复。
22
+ 3. **预览确认**:改写结果先显示在可拖动的预览面板里(动作按钮永远在底部可见),列出「这次改了什么 / 补了哪些缺口」。你点「写入输入框」之前,输入框不会被碰;写错可点 ↩ 一键恢复。
23
+
24
+ 优化后引用仍然只读:改写只动你的文字,不动引用原文。
25
+
26
+ ### 3. 推荐用法
27
+
28
+ 优化器**看不到会话历史**——它只能看到输入框里的草稿和引用。所以:
29
+
30
+ - 项目第一句、独立的新任务:点鲸鱼,让它补背景;
31
+ - 后续追问:直接发送,别点鲸鱼——对话历史本身就是上下文;
32
+ - 容易被误解的追问:先引用上一轮的结论,再点鲸鱼。引用是优化器唯一的上下文通道。
33
+
34
+ ## 安装
35
+
36
+ npm(发布后):
37
+
38
+ ```
39
+ dsh plugin add dsh-sidebar-quote
40
+ ```
41
+
42
+ 或本地目录:
43
+
44
+ ```
45
+ dsh plugin add <仓库路径>
46
+ ```
47
+
48
+ ## 模型与隐私
49
+
50
+ 优化使用当前会话已选的模型,每次优化两次调用(分析 + 生成,输出上限 2048 / 8192 tokens)。发送内容只有草稿和引用;插件自身不保存任何历史。
51
+
52
+ ## 许可与素材
53
+
54
+ 代码与手绘 SVG(icon.svg、preview.svg)以 MIT 发布(见 LICENSE)。位图图标(icon.png/avatar.png)是社区同人形象的 AI 二创,按 CC BY-NC-SA 4.0 分发,权利声明见 ASSET_LICENSE.md。"DeepSeek" 与鲸鱼标志是深度求索的商标;本插件为非官方作品,与官方无隶属关系。
55
+
56
+ ## 许可
57
+
58
+ MIT