Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ The code is the developer documentation. Releases follow the [release guide](REL
| [@klarkxy/dsh-model-route](plugins/dsh-model-route/README.en.md) | Published (`published`) | Published on npm; fixes, testing and version updates keep the Published lifecycle. |
| [@klarkxy/dsh-plugin-kit](plugins/dsh-plugin-kit/README.en.md) | Published (`published`) | Published on npm; fixes, testing and version updates keep the Published lifecycle. |
| [@klarkxy/dsh-prompt-override](plugins/dsh-prompt-override/README.en.md) | Published (`published`) | Published on npm; subsequent versions follow the normal update workflow. |
| [@klarkxy/dsh-quick-review](plugins/dsh-quick-review/README.en.md) | Testing (`testing`) | Read-only review session and sidebar tab passed first-release acceptance; the first npm release goes through the manual first_release workflow. |
| [@klarkxy/dsh-safe-auto](plugins/dsh-safe-auto/README.en.md) | Published (`published`) | Published on npm; fixes, testing and version updates keep the Published lifecycle. |
| [@klarkxy/dsh-secret-manager](plugins/dsh-secret-manager/README.en.md) | Published (`published`) | Published on npm; subsequent versions follow the normal update workflow. |
| [@klarkxy/dsh-session-manager](plugins/dsh-session-manager/README.en.md) | Published (`published`) | Published on npm; fixes, testing and version updates keep the Published lifecycle. |
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ pnpm check
| [@klarkxy/dsh-model-route](plugins/dsh-model-route/README.md) | 已发布 (`published`) | 已有 npm 发布记录;后续修复、测试和版本更新保持已发布。 |
| [@klarkxy/dsh-plugin-kit](plugins/dsh-plugin-kit/README.md) | 已发布 (`published`) | 已有 npm 发布记录;后续修复、测试和版本更新保持已发布。 |
| [@klarkxy/dsh-prompt-override](plugins/dsh-prompt-override/README.md) | 已发布 (`published`) | 已有 npm 发布记录;后续版本按正常更新流程维护。 |
| [@klarkxy/dsh-quick-review](plugins/dsh-quick-review/README.md) | 测试中 (`testing`) | 只读评审会话与侧边栏标签页已完成首次发布验收;首次 npm 发布走手动 first_release 流程。 |
| [@klarkxy/dsh-safe-auto](plugins/dsh-safe-auto/README.md) | 已发布 (`published`) | 已有 npm 发布记录;后续修复、测试和版本更新保持已发布。 |
| [@klarkxy/dsh-secret-manager](plugins/dsh-secret-manager/README.md) | 已发布 (`published`) | 已有 npm 发布记录;后续版本按正常更新流程维护。 |
| [@klarkxy/dsh-session-manager](plugins/dsh-session-manager/README.md) | 已发布 (`published`) | 已有 npm 发布记录;后续修复、测试和版本更新保持已发布。 |
Expand Down
4 changes: 2 additions & 2 deletions index.json
Original file line number Diff line number Diff line change
Expand Up @@ -618,8 +618,8 @@
},
"versions": [
{
"version": "0.3.4",
"publishTimestamp": 1795139366,
"version": "0.3.5",
"publishTimestamp": 1795153532,
"source": {
"type": "npm"
},
Expand Down
42 changes: 42 additions & 0 deletions plugins/dsh-quick-review/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
The Star And Thank Author License (SATA)
Version 2.1, September 2026

Copyright © 2026 Klarkxy(278370456@qq.com)

Project Url: https://github.com/klarkxy/dsh-editor
https://github.com/klarkxy/sata-license
https://github.com/klarkxy/dsh-plugins

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

And wait, one more thing — an invitation, not a condition: it would be best if
you star/+1/like the project(s) in the project url section above, and thank the
author(s) in the Copyright section. You may, and arguably you should — but the
permissions above hold either way, star or no star.

Here are some suggested ways:

- Email the authors a thank-you letter, and make friends with him/her/them.
- Report bugs or issues.
- Tell friends what a wonderful project this is.
- And, sure, you can just express thanks in your mind without telling the world.

Contributors of this project by forking have the option to add his/her name and
forked project url at copyright and project url sections, but shall not delete
or modify anything else in these two sections.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
35 changes: 35 additions & 0 deletions plugins/dsh-quick-review/README.en.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Quick Review

<!-- release-state-note -->

[简体中文](README.md) / English

Start a read-only review session from the current conversation with one click. It streams live in a right-sidebar tab, reviews only this session's own changes, and its first-turn verdict is sent back to the conversation automatically.

## Install

```sh
dsh plugin --profile web add @klarkxy/dsh-quick-review
```

Replace `web` with your profile name and restart the profile as DSH prompts.

## Use

1. Open a conversation that has already produced file changes.
2. Click **Review** in the conversation header.
3. Pick a review model in the popover (your last choice is remembered; leaving it empty follows the host default chat model), optionally add a focus, then click **Start review**.
4. A review tab opens in the right sidebar showing the live review conversation, with its status on top.
5. When the review's first turn finishes, its final answer is sent back to the main session. After chatting further with the reviewer, use **Send to main again** in the tab to relay the newest answer.

## Limits

- The review scope comes from the host's session change recording (`workspace/changes` summaries). After a host restart or without recorded changes it falls back to "all uncommitted changes in the workspace", which the popover and the review prompt state plainly.
- The review session is pinned to the host's built-in `read-only` permission preset (read-only sandbox, writes require approval). The plugin refuses to start when the preset is missing rather than launching a writable reviewer.
- The review model is written to the review session only; it never changes your global default model.
- The first-turn verdict is sent back exactly once. An aborted, failed, or empty turn sends nothing and shows as undelivered in the tab.
- Blank and subagent sessions have no review entry. **Send to main again** relies on the plugin's in-memory records and is unavailable after a host restart.

## License

[SATA License 2.1](LICENSE)
35 changes: 35 additions & 0 deletions plugins/dsh-quick-review/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# 快速评审

<!-- release-state-note -->

简体中文 / [English](README.en.md)

一键从当前对话派出一个只读评审会话:它在右侧面板里实时展开,只评审本会话产生的改动,首轮评审结论自动发回当前对话。

## 安装

```sh
dsh plugin --profile web add @klarkxy/dsh-quick-review
```

将 `web` 替换为你的 profile 名称,按 DSH 提示重启 profile。

## 使用

1. 打开一个已经产生过文件修改的对话。
2. 点击对话右上角的「评审」。
3. 在弹窗中选择评审模型(会记住上次选择;留空跟随宿主默认对话模型),可填写「关注点」,点击「开始评审」。
4. 右侧面板打开评审标签页,实时显示评审会话的完整对话;标签页顶部显示评审状态。
5. 评审首轮结束后,最终结论自动发回主会话。与评审会话继续对话后,可点标签页里的「再次发回主会话」把最新回答再发一次。

## 主要限制

- 评审范围取宿主的会话改动记录(`workspace/changes` 汇总);宿主重启或会话没有改动记录时,回退为「工作区全部未提交改动」,弹窗和评审提示会如实说明。
- 评审会话固定使用宿主内置的 `read-only` 权限预设(只读沙箱 + 写操作需批准);宿主缺少该预设时插件拒绝启动,不会放行可写评审。
- 评审模型只写入评审会话,不改动全局默认模型。
- 首轮评审只自动发回一次;评审被中止、失败或没有产出文本时不会发送,状态在标签页中显示为未成功。
- 空白会话与子代理会话不显示评审入口;「再次发回主会话」依赖插件运行中的内存记录,宿主重启后不可用。

## 许可证

[SATA License 2.1](LICENSE)
6 changes: 6 additions & 0 deletions plugins/dsh-quick-review/cordis.patch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Enabled when installed. Adds a conversation-header quick review action and a
# right-sidebar review tab.
- insert:
- id: quick-review
name: '@klarkxy/dsh-quick-review'
disabled: false
15 changes: 15 additions & 0 deletions plugins/dsh-quick-review/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions plugins/dsh-quick-review/locale/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"meta": {
"title": "Quick Review",
"description": "Start a read-only review session over the current session's changes; its verdict is sent back automatically."
}
}
6 changes: 6 additions & 0 deletions plugins/dsh-quick-review/locale/zh.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"meta": {
"title": "快速评审",
"description": "一键派出只读评审会话审阅当前会话的改动,结果自动发回本会话。"
}
}
133 changes: 133 additions & 0 deletions plugins/dsh-quick-review/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
{
"name": "@klarkxy/dsh-quick-review",
"version": "0.1.0",
"description": "Quick Review: start a read-only code review of the current session's changes from the conversation header, with the review shown in a sidebar tab and its verdict relayed back.",
"icon": "./icon.svg",
"license": "SEE LICENSE IN LICENSE",
"type": "module",
"engines": {
"node": ">=22",
"dsh": ">=0.2.1-rc.1"
},
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"exports": {
".": {
"types": "./lib/index.d.ts",
"import": "./lib/index.js",
"default": "./lib/index.js"
},
"./contracts": {
"types": "./lib/contracts.d.ts",
"import": "./lib/contracts.js",
"default": "./lib/contracts.js"
},
"./client": {
"default": "./lib/client.js"
},
"./package.json": "./package.json",
"./locale/*.json": "./locale/*.json"
},
"files": [
"icon.svg",
"locale/*.json",
"lib",
"cordis.patch.yml",
"README.md",
"README.en.md",
"LICENSE"
],
"dsh": {
"bundle": {
"patch": "./cordis.patch.yml"
},
"client": {
"platform": "web",
"inject": [
"@deepseek-ai/dsh-client-connection",
"@deepseek-ai/dsh-api-remotes",
"@deepseek-ai/dsh-api-session-controller",
"@deepseek-ai/dsh-client-locale",
"@deepseek-ai/dsh-client-resources",
"@deepseek-ai/dsh-client-ui-slots",
"@deepseek-ai/dsh-client-ui-session",
"@deepseek-ai/dsh-client-ui-conversation",
"@deepseek-ai/dsh-client-ui-sidebar-right",
"@deepseek-ai/dsh-client-ui-primitives"
]
}
},
"scripts": {
"build": "tsdown && node ../../scripts/editor-plugins/wrap-client.mjs @klarkxy/dsh-quick-review",
"typecheck": "tsc --noEmit -p tsconfig.json",
"test": "vitest run --root ../.. --config vitest.editor-plugins.config.ts --maxWorkers=2 plugins/dsh-quick-review/src"
},
"dependencies": {
"@klarkxy/dsh-model-route": "workspace:*",
"@klarkxy/dsh-plugin-kit": "workspace:*",
"zod": "^4.1.5"
},
"peerDependencies": {
"@deepseek-ai/cordis": ">=4.0.4",
"@deepseek-ai/dsh-llm": ">=0.2.1-rc.1",
"@deepseek-ai/dsh-session": ">=0.2.1-rc.1",
"@deepseek-ai/dsh-storage-domain": ">=0.2.0-rc.2"
},
"peerDependenciesMeta": {
"@deepseek-ai/cordis": {
"optional": true
},
"@deepseek-ai/dsh-llm": {
"optional": true
},
"@deepseek-ai/dsh-session": {
"optional": true
},
"@deepseek-ai/dsh-storage-domain": {
"optional": true
}
},
"devDependencies": {
"@deepseek-ai/cordis": "4.1.0",
"@deepseek-ai/dsh-llm": "0.2.2-rc.5",
"@deepseek-ai/dsh-session": "0.2.2-rc.5",
"@deepseek-ai/dsh-storage-domain": "0.2.2-rc.5",
"zod": "4.4.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"@types/react": "18.3.31",
"@types/react-dom": "^18.3.0",
"@deepseek-ai/dsh-agent": "0.2.2-rc.5",
"@deepseek-ai/dsh-api-session-controller": "0.2.2-rc.5",
"@deepseek-ai/dsh-client-resources": "0.2.2-rc.5",
"@deepseek-ai/dsh-client-ui-conversation": "0.2.2-rc.5",
"@deepseek-ai/dsh-client-ui-primitives": "0.2.2-rc.5",
"@deepseek-ai/dsh-client-ui-sidebar-right": "0.2.2-rc.5",
"@deepseek-ai/dsh-client-ui-slots": "0.2.2-rc.5",
"jsdom": "29.1.1",
"@types/jsdom": "28.0.3"
},
"keywords": [
"dsh",
"dsh-plugin",
"dsh-plugins",
"deepseek-harness",
"deepseek-harness-plugin",
"code-review",
"review",
"quick-review"
],
"repository": {
"type": "git",
"url": "git+https://github.com/klarkxy/dsh-plugins.git",
"directory": "plugins/dsh-quick-review"
},
"homepage": "https://klarkxy.github.io/dsh-plugins/plugins/quick-review/",
"bugs": {
"url": "https://github.com/klarkxy/dsh-plugins/issues"
},
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
}
}
61 changes: 61 additions & 0 deletions plugins/dsh-quick-review/src/anchored-position.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import { useEffect, useLayoutEffect, useRef, useState, type CSSProperties, type RefObject } from 'react'

/**
* Local replacement for the host's useAnchoredPosition primitive, which was
* removed from @deepseek-ai/dsh-client-ui-primitives after 0.2.2-rc.1. Same
* contract: absolute-placement coordinates for the panel, or null until the
* first measurement. Flips to the side with more room, clamps into the
* viewport margin, and re-measures on resize and scroll while open.
*/
export function useAnchoredPosition(options: {
open: boolean
anchorRef: RefObject<HTMLElement | null>
panelRef: RefObject<HTMLElement | null>
side?: 'top' | 'bottom'
align?: 'start' | 'end'
gap: number
margin: number
}): CSSProperties | null {
const { open, anchorRef, panelRef, side = 'bottom', align = 'start', gap, margin } = options
const [position, setPosition] = useState<CSSProperties | null>(null)
const frame = useRef(0)

const measure = () => {
const anchor = anchorRef.current
const panel = panelRef.current
if (!anchor) return
const anchorRect = anchor.getBoundingClientRect()
const panelWidth = panel?.offsetWidth ?? 0
const panelHeight = panel?.offsetHeight ?? 0
const preferTop = side === 'top' || anchorRect.bottom + gap + panelHeight > window.innerHeight - margin
const top = preferTop
? Math.max(margin, anchorRect.top - gap - panelHeight)
: Math.min(anchorRect.bottom + gap, window.innerHeight - margin - panelHeight)
const anchorStart = align === 'end' ? anchorRect.right - panelWidth : anchorRect.left
const left = Math.min(Math.max(anchorStart, margin), Math.max(margin, window.innerWidth - margin - panelWidth))
setPosition({ left, top })
}

const schedule = () => {
if (typeof requestAnimationFrame !== 'function') { measure(); return }
if (frame.current) cancelAnimationFrame(frame.current)
frame.current = requestAnimationFrame(measure)
}

useLayoutEffect(() => {
if (!open) { setPosition(null); return }
measure()
window.addEventListener('resize', schedule)
window.addEventListener('scroll', schedule, true)
return () => {
window.removeEventListener('resize', schedule)
window.removeEventListener('scroll', schedule, true)
if (frame.current && typeof cancelAnimationFrame === 'function') cancelAnimationFrame(frame.current)
frame.current = 0
}
}, [open, anchorRef, panelRef, side, align, gap, margin])

useEffect(() => () => { if (frame.current && typeof cancelAnimationFrame === 'function') cancelAnimationFrame(frame.current) }, [])

return position
}
Loading
Loading