@jayyuen66/dsh-ocr-review 0.1.7 → 0.1.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.
package/cordis.patch.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # ocr-review:open-code-review 工作区审查插件(bundle)。
2
- # 双面包机制:本包含 Host 半(host.ts:5 个工具 ocr_review/ocr_scan/
3
- # ocr_delegate_preview/ocr_delegate_rule/ocr_session + 由 `Config` 上 `.volatile()`
2
+ # 双面包机制:本包含 Host 半(host.ts:7 个工具 ocr_review/ocr_scan/
3
+ # ocr_delegate_preview/ocr_delegate_rule/ocr_session/ocr_rules_check/ocr_llm + 由 `Config` 上 `.volatile()`
4
4
  # 隐式投影的设置面(命名空间就是下面这条的 id)+ 设置卡的 `ocrReview` Remote 读面)与
5
5
  # Client 半(src/client-entry.ts → client.js:设置卡片,从宿主设置服务的
6
6
  # llm-pi-ai.providers 选 provider/model 应用到
@@ -10,7 +10,9 @@
10
10
  # 组合包层:本文件由 package.json 的 dsh.bundle.patch 指向,随
11
11
  # `dsh plugin --profile web add/remove ./plugins/ocr-review` 维护。行按裸包名
12
12
  # 引用本包(client-modules 只扫描裸包名条目的 dsh.client 声明)。
13
- # 注意 pnpm ≥12.3.0:12.0.0 的 add 本地目录有 #14437 bug。
13
+ # pnpm 12.0–12.2 的 `pnpm add <本地目录>` 不可用(上游 #14437:无别名的本地路径被当
14
+ # registry 包名解析;12.1.0/12.2.0 复现,12.2.0 的 release notes 无修复),12.3.0 起修复。
15
+ # 把本包目录加进 profile 前先确认 pnpm ≥12.3.0;从 registry 装不受影响。
14
16
  - insert:
15
17
  - id: ocr-review
16
18
  name: "@jayyuen66/dsh-ocr-review"
package/docs/DETAIL.md ADDED
@@ -0,0 +1,28 @@
1
+ # Open code review
2
+
3
+ Runs the external `ocr` command line over a change set, reports the comments it produces, and manages which model does the reviewing.
4
+
5
+ ## What the card changes
6
+
7
+ - **Model** — `ocrProvider` and `ocrModel` are not stored settings: they project the host's model namespace, and entries without a usable key are shown but disabled. `chatGptModel` reflects the external CLI's own login state, which this plugin reads but does not own.
8
+ - **Review parameters** — `effort` (`auto`/`low`/`medium`/`high`) is how many review passes run: deeper review costs more time. `language` chooses Chinese or English output. `autoVerify` (on) runs `ocr llm test` after you pick a provider and model, so a wrong choice fails at pick time rather than at first review. `maxComments` (default 12; 0 means all, including comments that cannot be anchored to a line). `timeoutMinutes` (0 requests the host's ceiling; a positive value is minutes, still clamped by the host). `ocrConfigPath` — empty means `~/.opencodereview/config.json`; a non-empty value must be `<dir>/.opencodereview/config.json` and is honoured by redirecting `HOME` (POSIX only).
9
+
10
+ Six of these are read per call, so a change applies on the next review without restarting the host.
11
+
12
+ ## Two separate things called MCP
13
+
14
+ The card's MCP-servers editor writes the **external `ocr` tool's own** configuration. It is unrelated to the `integrationMode` / `mcpPort` surface of the Scrapling plugin, and nothing in this plugin serves MCP itself.
15
+
16
+ ## Restart-only values
17
+
18
+ `llmTestTimeoutMs` (90000), `startupVerify` (on: the endpoint self-check runs at load), `ocrBackgroundMaxMs` (0 = no backstop window), `stdoutMaxBytes` (400000), `ocrNoAutoUpdate` (false: upstream auto-upgrade stays on unless you say otherwise) and `ocrInstallHint` (`both`/`brew`/`npm`). Set them in the `config:` block of this plugin's row in `cordis.patch.yml`.
19
+
20
+ ## What it needs from outside
21
+
22
+ The `ocr` command line, expected at version **1.13.3**; the expectation is declared in code and mirrored in the package's manifest and READMEs, so a mismatch is reported rather than papered over. Install paths are `brew install open-code-review` or `npm i -g @alibaba-group/open-code-review@1.13.3`. A missing binary is reported as "command not found"; the case where a launcher exists but the binary does not says exactly that. The version probe always forces `OCR_NO_UPDATE=1` so probing cannot trigger an upgrade.
23
+
24
+ API credentials are not stored here: the plugin writes a `api_key_cmd` that calls a helper script, so the key is fetched at run time instead of landing in a config file. If that script is missing, the card warns rather than sending an unauthenticated request.
25
+
26
+ ## Further detail
27
+
28
+ The tool list exposed to the model, how background reviews become host jobs and the argument guard's flag table are in the package README (`README.md` / `README.zh-CN.md`).
@@ -0,0 +1,28 @@
1
+ # 代码评审(open-code-review)
2
+
3
+ 调用外部 `ocr` 命令行评审一个变更集,回报它给出的意见,并管理用来评审的模型。
4
+
5
+ ## 设置卡上改的是什么
6
+
7
+ - **模型** — `ocrProvider` 与 `ocrModel` 不是本插件存的值:它们是宿主模型命名空间的投影,没有可用密钥的条目照样列出但禁用。`chatGptModel` 反映的是外部命令行自己的登录态,本插件读它但不拥有它。
8
+ - **审查参数** — `effort`(`auto`/`low`/`medium`/`high`)是跑几轮审查,越深越费时。`language` 选中文或英文输出。`autoVerify`(默认开)在选完提供方与模型后跑一次 `ocr llm test`,选错当场就知道,而不是等第一次评审失败。`maxComments`(默认 12;0 表示全部,包括钉不到行上的意见)。`timeoutMinutes`(0 表示向宿主要上限;正数是分钟数,仍由宿主收口)。`ocrConfigPath`——留空就是 `~/.opencodereview/config.json`;填了就必须是 `<目录>/.opencodereview/config.json` 的形状,生效方式是重定向 `HOME`(仅 POSIX)。
9
+
10
+ 其中六项每次调用现读,改完下一次评审生效,不需要重启宿主。
11
+
12
+ ## 两处都叫 MCP,但不是同一件事
13
+
14
+ 卡上的 MCP servers 编辑器改的是**外部 `ocr` 工具自己的**配置。它与「Scrapling 网页抓取」那套 `integrationMode` / `mcpPort` 的 MCP 面没有关系,本插件也不对外提供 MCP 服务。
15
+
16
+ ## 要重启的值
17
+
18
+ `llmTestTimeoutMs`(90000)、`startupVerify`(默认开:装载时自检端点)、`ocrBackgroundMaxMs`(0 表示不设兜底窗口)、`stdoutMaxBytes`(400000)、`ocrNoAutoUpdate`(默认 false,即保留上游的自动升级,除非你明确关掉)、`ocrInstallHint`(`both`/`brew`/`npm`)。写在本插件注册行的 `config:` 块,改值随重启生效。
19
+
20
+ ## 需要外部提供什么
21
+
22
+ `ocr` 命令行,期望版本 **1.13.3**;这个期望写在代码里,并镜像到包清单与两份 README,所以版本不符是被报出来的,不是被掩盖的。装法是 `brew install open-code-review` 或 `npm i -g @alibaba-group/open-code-review@1.13.3`。命令行不存在时按「找不到命令」报;只有垫片没有真二进制时说的也是这一件。版本探测一律强制 `OCR_NO_UPDATE=1`,以免探测顺手触发升级。
23
+
24
+ API 凭据不存这里:本插件写的是一个 `api_key_cmd`,运行时的密钥由那支辅助脚本现取,不进配置文件。脚本缺失时卡上给出告警,而不是发一次没有鉴权的请求。
25
+
26
+ ## 更完整的说明
27
+
28
+ 暴露给模型的工具清单、后台评审如何落成宿主作业、参数守卫的旗标对照表都写在随包 README(`README.md` / `README.zh-CN.md`)。