@inkbite/shotink 0.0.0-stage → 1.4.2

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 34394
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.
package/README.md CHANGED
@@ -1,3 +1,109 @@
1
- # Temporary Holding Version
1
+ # DSH Screenshot
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
+ [![DSH Market](https://raw.githubusercontent.com/2BingLing/dsh-market/master/assets/readme/badge-listed-en.svg)](https://dsh.market/) [![Windows only](https://img.shields.io/badge/platform-Windows-0078d4)](#install)
4
+
5
+ The capture entry has two possible homes: a camera button in the composer tool row, and a **Screenshot** row in the composer `+` menu. Either one drags a region (the chrome is the familiar capture-tool layout: dimmed desktop, dashed outline, size chip, action bar), confirms, and the PNG lands in the draft as an image attachment. Both places ship enabled, and **Settings → Screenshot** switches between menu only, button only, or both.
6
+
7
+ **Windows only.** The overlay is a Windows PowerShell + WinForms window; other platforms are refused explicitly (HTTP 501) instead of failing silently.
8
+
9
+ ![selection UI](https://raw.githubusercontent.com/mbcc5732/dsh-screenshot/main/docs/preview.png)
10
+
11
+ ![annotation flow: capture, circle, arrow, numbered badges, a text label, mosaic, insert into chat](https://raw.githubusercontent.com/mbcc5732/dsh-screenshot/main/docs/flow.gif)
12
+
13
+ ## Features
14
+
15
+ - **Region capture** — drag any rectangle on the desktop, or single-click a window to take the whole window; the region stays movable and resizable before you commit. The DSH window hides itself the moment a capture starts, so it never ends up inside the shot.
16
+ - **Annotation you can undo** — pen, box, arrow, numbered step badges, text labels, mosaic, colour cycle and per-stroke undo, painted on a transparent layer above the frozen pixels; pen weight and mosaic coarseness each step through 细/中/粗 by right-clicking the button.
17
+ - **One-click into the conversation** — the result is cropped, flattened with your marks and attached to the current draft; nothing is written to disk.
18
+ - **Two entry points, switchable** — a camera button in the tool row and a **Screenshot** row in the `+` menu (`dsh-screenshot:placement` decides which).
19
+ - **Window shortcut** — `Ctrl+Shift+X` starts a capture anywhere in the DSH window; the shortcut section in **Settings → Screenshot** switches it to `Ctrl+Shift+A`, `Alt+Shift+S` or off. One capture at a time, so a double press cannot stack overlays.
20
+ - **Global hotkey** — `Alt+Shift+S` works with DSH in the background or covered by another app, and the shot lands in the draft that is open, so you never have to switch windows first. Same section in settings switches it to `Ctrl+Alt+Shift+X` or off.
21
+ - **Floating ball** — a 48px disc stays on the desktop and starts a capture on one click, through the same path as the hotkey. Drag it anywhere and the spot is remembered; right-click to **hide** it. It steps out of the frame for the grab, so it never appears in the shot. Toggle it under **Settings → Screenshot → Floating ball**.
22
+ - **Zero configuration** — no keys, no extra service, no network calls; `Ctrl+Z` undoes, `Esc` cancels.
23
+ - **Windows only** — PowerShell + WinForms overlay, other platforms get an explicit HTTP 501.
24
+
25
+ ## Usage
26
+
27
+ 1. Pick **Screenshot** in the `+` menu (or the camera button, depending on where you put the entry) — or use a key: `Ctrl+Shift+X` inside the DSH window, `Alt+Shift+S` as a global hotkey that works with any app in front.
28
+ 2. Drag a region; a single click on a window picks that window, with a dashed hover preview.
29
+ 3. The selection stays editable: drag inside it to move, drag the eight white round handles to resize.
30
+ 4. Annotate: the left half of the bar is [pen][box][arrow][number][text][mosaic][undo][color]. Pick one to enable it, pick it again to hand the body back to moving. The pen draws freehand; box, arrow and mosaic take a dragged rectangle; mosaic pixelates the pixels underneath; **number** stamps 1, 2, 3 … on each click, for step-by-step screenshots; **text** drops a label you type in place (`Enter` commits, `Esc` cancels, clicking elsewhere commits too); the colour chip cycles 红/黄/蓝/黑/白; `Ctrl+Z` or undo drops the last stroke. **Right-click the pen or mosaic button** to step 细/中/粗 — the hover card shows the setting you are on.
31
+ 5. Confirm with `Enter`, a double-click inside the selection, or the **Insert into chat** pill — DSH comes to the foreground as it closes, so a capture taken with the global hotkey lands in view. **Copy** only fills the clipboard (label flashes 已复制) without closing. **Cancel** / `Esc` discards.
32
+ 6. The image appears in the composer; type your question and send.
33
+
34
+ Once a stroke exists the selection is frozen: marks live in screen coordinates, so moving or resizing the crop underneath them would decouple the marks from what gets saved. Undo them away to adjust the region again.
35
+
36
+ ### Where the entry lives
37
+
38
+ **Settings → Screenshot** holds four sections - where the entry lives, the window shortcut, the global hotkey and the floating ball; a pick applies immediately and is remembered in browser localStorage across restarts:
39
+
40
+ - **Both places** (default) — button plus menu row.
41
+ - **`+` menu only** — the button retracts, leaving one menu row (it sits in the 添加 group, right under 文件).
42
+ - **Toolbar button only** — just the camera button left of the composer.
43
+
44
+ Chrome: everything outside the selection is dimmed by half while the region keeps its brightness; a dark dashed outline, eight white round handles, a white rounded size chip outside the top-left corner, and a white rounded action bar under the selection: eight annotation tools at its left, then the identical Copy / Cancel / Insert into chat items. No toasts.
45
+
46
+ ## Configuration
47
+
48
+ The only settings are where the entry lives and the two key combos, all changed from the UI rather than a file:
49
+
50
+ | Key | Values | Default |
51
+ | --- | --- | --- |
52
+ | `dsh-screenshot:placement` (localStorage) | `both` / `menu` / `toolbar` | `both` |
53
+ | `dsh-screenshot:shortcut` (localStorage) | `ctrl+shift+x` / `ctrl+shift+a` / `alt+shift+s` / `off` | `ctrl+shift+x` |
54
+ | `dsh-screenshot:hotkey` (localStorage) | `alt+shift+s` / `ctrl+alt+shift+x` / `off` | `alt+shift+s` |
55
+
56
+ The global hotkey is registered with Windows (`RegisterHotKey`) and the floating ball is a window of its own, both owned by the resident overlay helper - so they only exist while DSH runs: quit DSH and both go with it, nothing is left behind.
57
+
58
+ Pick it in **Settings → Screenshot**; the choice survives a restart. There is no config file and nothing to install besides the plugin itself.
59
+
60
+ ## Install
61
+
62
+ ```bash
63
+ dsh plugin --profile web add github:mbcc5732/dsh-screenshot
64
+ ```
65
+
66
+ - **Locally**: drop this directory into `default-workspace/` and mount it through `cordis.patch.yml` — that is how it currently runs.
67
+ - **Through the market index**: add `https://mbcc5732.github.io/dsh-screenshot/index.json` as an index source, search `截图`, install. Same bundle, see below.
68
+
69
+ ## Publishing to the plugin market
70
+
71
+ The DSH plugin market is a **JSON index** (format 1), not an app-store upload: host the index at any HTTPS URL, and users add that URL as an index source in the plugin market to find and install this bundle.
72
+
73
+ 1. Push to a public repository (GitHub et al.) containing this directory.
74
+ 2. Build the index:
75
+ ```
76
+ node market/build-index.mjs --repo https://github.com/<you>/dsh-screenshot
77
+ ```
78
+ With a git checkout, `commit`, `publishTimestamp` and the URL default to `HEAD`, the commit date and the `origin` remote; `--commit`, `--timestamp` and `--path` (package subdirectory) override them.
79
+ For npm, use `--npm --registry https://registry.npmjs.org` — that also requires actually publishing the package and renaming `name` to your own scope.
80
+ 3. Upload the resulting index to any HTTPS static host (GitHub Pages, object storage, your own domain). This repository already serves one:
81
+
82
+ ```
83
+ https://mbcc5732.github.io/dsh-screenshot/index.json
84
+ ```
85
+
86
+ 4. Add that URL as an index source in the plugin market. Installs use a pinned spec like
87
+ `git+https://github.com/mbcc5732/dsh-screenshot.git#<40-hex-commit>`.
88
+
89
+ Republishing after a code change: commit, push, then rebuild `docs/index.json` from the new HEAD and push it again.
90
+
91
+ ```
92
+ git add . && git commit -m "..." && git push
93
+ node market/build-index.mjs --out docs/index.json
94
+ git add docs/index.json && git commit -m "index: rebuild" && git push
95
+ ```
96
+
97
+ `market/example.index.json` is the sample produced from an example repository; its shape passes DSH's own validator (`parseMarketIndex` from `@deepseek-ai/dsh-plugin-market-index`).
98
+
99
+ Listing in the official index is curated by the DeepSeek team; this repository has no self-serve entry point.
100
+
101
+ ## Permissions and implementation
102
+
103
+ - Keeps one resident `powershell.exe` (`capture.ps1 -Serve`) preheated, so a click costs ~130–220ms. It exits with the host, and closes any open overlay within a second if the host disappears.
104
+ - Captures the whole desktop (per-monitor DPI v2, native pixels on scaled displays), crops to the selection, writes a PNG into `%TEMP%\dsh-screenshot-tool`, hands the bytes back and deletes the file at once; the clipboard keeps a copy.
105
+ - Only the pixels you framed are uploaded; no other window leaks into the attachment.
106
+
107
+ ## Docs
108
+
109
+ - `docs/DETAIL.md` / `docs/DETAIL.zh.md` — behaviour and limits, item by item.
package/README.zh.md ADDED
@@ -0,0 +1,109 @@
1
+ # DSH 对话截屏
2
+
3
+ [![DSH Market](https://raw.githubusercontent.com/2BingLing/dsh-market/master/assets/readme/badge-listed-zh.svg)](https://dsh.market/) [![仅 Windows](https://img.shields.io/badge/platform-Windows-0078d4)](#安装)
4
+
5
+ 截屏入口有两个位置:输入框工具栏的相机按钮,以及输入框「+」菜单里的「截图」一行。点任意一处都能拖出选区(界面就是常见截图工具那套:选区外压暗、虚线选框、尺寸标签、底部工具条),确认后 PNG 作为图片附件插入当前草稿。也能直接用键:窗口里按 `Ctrl+Shift+X`,任何应用在前台时按全局热键 `Alt+Shift+S`。默认两处入口都放,可以在「设置 → 截图」里改成只放菜单或只放按钮。
6
+
7
+ ![选区界面](https://raw.githubusercontent.com/mbcc5732/dsh-screenshot/main/docs/preview.png)
8
+
9
+ ![涂画演示:框选 → 画圈 → 箭头 → 序号 → 文字 → 马赛克 → 插入对话](https://raw.githubusercontent.com/mbcc5732/dsh-screenshot/main/docs/flow.gif)
10
+
11
+ **仅 Windows**:遮罩层是 Windows PowerShell + WinForms 窗口,其他平台会被显式拒绝(HTTP 501),不会悄悄失败。
12
+
13
+ ## 功能
14
+
15
+ - **区域截图**:桌面任意拖框;只点一下窗口则整窗截取。松手后仍可挪位、改大小。按下截图键的一刻 DSH 窗口自己收起(和常见截图工具一样),所以截出来的图里不会有它自己。
16
+ - **可撤销的涂画**:画笔、方框、箭头、序号、文字、马赛克、换色、逐笔撤销,画在生成图之上的透明层里;画笔粗细和马赛克强度各自右键切换 细/中/粗。
17
+ - **一键插入对话**:裁剪 + 合成标注后直接作为图片附件进当前草稿,不落盘;确认的一刻 DSH 窗口自动到前台,用全局热键在别的应用里截的图不用手动切回来才看得到。
18
+ - **两个入口可切换**:工具栏相机按钮 + 「+」菜单「截图」行(`dsh-screenshot:placement` 记忆选择)。
19
+ - **窗口内快捷键**:在 DSH 窗口里按 `Ctrl+Shift+X` 就能直接开始截图,可在「设置 → 截图」里换成 `Ctrl+Shift+A` / `Alt+Shift+S` 或关闭;同一时刻只允许一次截图,连按不会叠出两个遮罩。
20
+ - **系统级全局热键**:DSH 在后台、被别的应用盖住时也能按 `Alt+Shift+S` 直接截,截完的图自动落到当前打开的那个草稿里,不用先切回 DSH;可在「设置 → 截图」里换成 `Ctrl+Alt+Shift+X` 或关闭。
21
+ - **悬浮球**:桌面上常驻一颗 48px 的小圆球,点一下就开始截图(和全局热键同一套流程,不用切回 DSH)。按住可以拖到任意位置,位置会记住;右键可「隐藏悬浮球」。截图开始的一刻它自己让开,不会出现在画面里。可在「设置 → 截图 → 悬浮窗」里关掉。
22
+ - **零配置**:不要密钥、不联网、不起额外服务;`Ctrl+Z` 撤销,`Esc` 取消。
23
+ - **仅 Windows**:PowerShell + WinForms 遮罩,其他平台显式返回 501。
24
+
25
+ ## 用法
26
+
27
+ 1. 点「+」菜单里的「截图」(或工具栏相机按钮,看你把入口放在哪);也可以按快捷键:DSH 窗口里 `Ctrl+Shift+X`,任何应用在前台都能用的全局热键 `Alt+Shift+S`。
28
+ 2. 拖框选区;只点一下某个窗口则选中该窗口,悬停时先用虚线框预览。
29
+ 3. 松手后仍可编辑:框内按住拖动整体挪位,拖四角/四边白色圆手柄改大小。
30
+ 4. 涂画:工具条左侧是 [画笔][方框][箭头][序号][文字][马赛克][撤销][颜色],点一下启用,再点同一图标就回到「移动选区」。画笔随手拖出任意线;方框、箭头、马赛克拖出矩形范围;马赛克会采样选区内的原图打码;**序号**每点一下就落一个 1、2、3… 的圆标,做步骤图最省事;**文字**点一下就地出现输入框,打完字 `Enter` 落下、`Esc` 取消、点别处也会落下;颜色按钮循环切换 红/黄/蓝/黑/白;`Ctrl+Z` 或点撤销删掉最后一笔。**右键点画笔或马赛克按钮**可切 细/中/粗,悬停提示会显示当前档位。
31
+ 5. `Enter`、框内双击、或工具条「✓ 插入对话」确认——确认时 DSH 窗口会被拉到前台,用全局热键在别的应用里截的图,回来就能看到附件;「复制」只进剪贴板不关闭(标签短暂显示「已复制」);「取消」/`Esc` 放弃。
32
+ 6. 图片出现在输入框,写问题后正常发送。
33
+
34
+ **画了第一笔后选区会锁住**:标注是画在屏幕坐标上的,这时候再挪框或改大小会让标注和最终裁剪错位,所以要先撤销干净再调选区。
35
+
36
+ ### 入口位置
37
+
38
+ 「设置 → 截图」里有四个区块:「截图入口」三个选项、「截屏快捷键」四个选项、「全局热键」三个选项、「悬浮窗」两个选项,选完立刻生效(存在浏览器 localStorage,重启 DSH 也记得):
39
+
40
+ - **两处都放**(默认):按钮 + 菜单行。
41
+ - **仅“+”菜单**:按钮收起来,只留菜单行(菜单行排在「添加」分组里、紧贴「文件」下面)。
42
+ - **仅工具栏按钮**:光有输入框左侧的相机按钮。
43
+
44
+ 界面:选区外整屏压暗 50%,选区内保持原亮度;深色细虚线选框、8 个白色圆形手柄、左上外侧白底圆角尺寸标签、选区下方白色圆角工具条(左侧 8 个涂画图标 + 复制 / 取消 / ✓ 插入对话,同款扁平样式)。不弹任何提示气泡。
45
+
46
+ ## 配置
47
+
48
+ 唯一的设置是「入口放在哪」和两个键位,都在界面里改,没有配置文件:
49
+
50
+ | 键 | 取值 | 默认 |
51
+ | --- | --- | --- |
52
+ | `dsh-screenshot:shortcut` (localStorage) | `ctrl+shift+x` / `ctrl+shift+a` / `alt+shift+s` / `off` | `ctrl+shift+x` |
53
+ | `dsh-screenshot:hotkey` (localStorage) | `alt+shift+s` / `ctrl+alt+shift+x` / `off` | `alt+shift+s` |
54
+ | `dsh-screenshot:placement`(localStorage) | `both` / `menu` / `toolbar` | `both` |
55
+
56
+ 全局热键由常驻的遮罩进程向 Windows 注册(`RegisterHotKey`),悬浮球也是它创建的窗口,所以两者都只在 DSH 运行期间存在:DSH 退出,热键与悬浮球一起消失,不会留下后台残留。
57
+
58
+ 在「+」菜单的「截图入口」里选,重启 DSH 后仍然记得。除插件本身外无需安装任何东西。
59
+
60
+ ## 安装
61
+
62
+ ```bash
63
+ dsh plugin --profile web add github:mbcc5732/dsh-screenshot
64
+ ```
65
+
66
+ - **本地**:把本目录放进 `default-workspace/`,用 `cordis.patch.yml` 挂载即可(当前就是这种用法)。
67
+ - **走插件市场索引**:把 `https://mbcc5732.github.io/dsh-screenshot/index.json` 添加为索引源,搜「截图」即可安装,与上一条是同一个包,细节见下一节。
68
+
69
+ ## 上架到插件市场
70
+
71
+ DSH 的插件市场是一份 **索引 JSON**(format 1),不是应用商店后台上传:把索引放到任意 HTTPS 可达地址,用户在插件市场里添加该地址作为「索引源」,就能搜到并安装本插件。
72
+
73
+ 1. 推到公开仓库(GitHub 等),确保仓库里包含本目录全部文件。
74
+ 2. 生成索引:
75
+ ```
76
+ node market/build-index.mjs --repo https://github.com/<you>/dsh-screenshot
77
+ ```
78
+ 有 git 检出时 `commit`、`publishTimestamp`、`origin` 都会自动读取;也可显式传 `--commit` / `--timestamp` / `--path`(子目录)。
79
+ npm 源用 `--npm --registry https://registry.npmjs.org`(需要先把包真的发到 npm,且把 `name` 改成你自己的 scope)。
80
+ 3. `market/index.json`(或 `docs/index.json`)传到任意 HTTPS 静态地址(GitHub Pages、对象存储、自己域名都行)。本仓库的索引已经托管好:
81
+
82
+ ```
83
+ https://mbcc5732.github.io/dsh-screenshot/index.json
84
+ ```
85
+
86
+ 4. 在 DSH 插件市场里添加这个 URL 作为索引源,条目即可安装,安装 spec 形如
87
+ `git+https://github.com/mbcc5732/dsh-screenshot.git#<40位commit>`。
88
+
89
+ 重新发布(改了代码之后):提交推送,然后用当前 HEAD 重新生成 `docs/index.json` 再推一次。
90
+
91
+ ```
92
+ git add . && git commit -m "..." && git push
93
+ node market/build-index.mjs --out docs/index.json
94
+ git add docs/index.json && git commit -m "index: rebuild" && git push
95
+ ```
96
+
97
+ `market/example.index.json` 是用示例仓库生成的样例,结构可通过 DSH 自带校验器(`@deepseek-ai/dsh-plugin-market-index` 的 `parseMarketIndex`)。
98
+
99
+ 进官方索引需要 DeepSeek 团队收录,本仓库没有自助入口。
100
+
101
+ ## 权限与实现说明
102
+
103
+ - 启动一个常驻 `powershell.exe`(`capture.ps1 -Serve`)做预热,点击延迟约 130–220ms;进程随宿主退出,宿主异常消失时遮罩 1 秒内自关。
104
+ - 全屏抓取当前桌面(per-monitor DPI v2,缩放屏按物理像素),选区裁剪后写 PNG 到 `%TEMP%\dsh-screenshot-tool`,字节读回后立即删除;剪贴板另留一份。
105
+ - 上传的是你自己圈定的那块像素,不会有其它窗口内容进入附件。
106
+
107
+ ## 文档
108
+
109
+ - `docs/DETAIL.zh.md` / `docs/DETAIL.md`:逐项行为与限制说明。