@jayyuen66/dsh-ocr-review 0.1.9 → 0.1.10

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/docs/DETAIL.md CHANGED
@@ -4,10 +4,10 @@ Runs the external `ocr` command line over a change set, reports the comments it
4
4
 
5
5
  ## What the card changes
6
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).
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` is a slug this plugin writes into the CLI's own config (provider `chatgpt`, with `api_key` / `api_key_cmd` removed); the credentials behind that provider come from the CLI's own login state, which the plugin only queries (`ocr auth`) and never stores.
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`; on Windows the value passes the shape check but the redirection does not happen, and the CLI keeps its default path.
9
9
 
10
- Six of these are read per call, so a change applies on the next review without restarting the host.
10
+ `effort`, `maxComments`, `timeoutMinutes` and `ocrConfigPath` are read per call, so a change applies on the next review without restarting the host. `language` and `autoVerify` are read when a provider/model selection is applied: `language` is written into the CLI config at that moment, and `autoVerify` only decides whether `ocr llm test` runs then.
11
11
 
12
12
  ## Two separate things called MCP
13
13
 
@@ -19,7 +19,7 @@ The card's MCP-servers editor writes the **external `ocr` tool's own** configura
19
19
 
20
20
  ## What it needs from outside
21
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.
22
+ The `ocr` command line, expected at version **1.13.3**; the expectation is declared once as `ocrCliVersion` in `package.json`, and the code constant plus both READMEs mirror that string, so a mismatch is reported (as a hint, never a hard failure) rather than papered over. Install paths are `brew install open-code-review` or `npm i -g @alibaba-group/open-code-review@1.13.3`. With no candidate on PATH at all, the pre-check reports "no ocr candidate on either path" plus an install hint; "command not found" (exit 127) is the different case where a candidate exists but the binary cannot actually be run. The version probe always forces `OCR_NO_UPDATE=1` so probing cannot trigger an upgrade.
23
23
 
24
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
25
 
package/docs/DETAIL.zh.md CHANGED
@@ -4,10 +4,10 @@
4
4
 
5
5
  ## 设置卡上改的是什么
6
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)。
7
+ - **模型** — `ocrProvider` 与 `ocrModel` 不是本插件存的值:它们是宿主模型命名空间的投影,没有可用密钥的条目照样列出但禁用。`chatGptModel` 是本插件写进外部命令行自己配置的 model slug(provider 置为 `chatgpt`,同时删掉 `api_key` / `api_key_cmd`);该提供方背后的凭据来自命令行自己的登录态,本插件只查询 `ocr auth`,不保存。
8
+ - **审查参数** — `effort`(`auto`/`low`/`medium`/`high`)是跑几轮审查,越深越费时。`language` 选中文或英文输出。`autoVerify`(默认开)在选完提供方与模型后跑一次 `ocr llm test`,选错当场就知道,而不是等第一次评审失败。`maxComments`(默认 12;0 表示全部,包括钉不到行上的意见)。`timeoutMinutes`(0 表示向宿主要上限;正数是分钟数,仍由宿主收口)。`ocrConfigPath`——留空就是 `~/.opencodereview/config.json`;填了就必须是 `<目录>/.opencodereview/config.json` 的形状,生效方式是重定向 `HOME`;Windows 上值能通过形状校验但不会重定向,命令行仍读默认路径。
9
9
 
10
- 其中六项每次调用现读,改完下一次评审生效,不需要重启宿主。
10
+ `effort`、`maxComments`、`timeoutMinutes` 与 `ocrConfigPath` 每次调用现读,改完下一次评审生效,不需要重启宿主。`language` 与 `autoVerify` 在应用一次 provider/model 选择时读取:`language` 当场写进命令行配置,`autoVerify` 只决定那时是否跑 `ocr llm test`。
11
11
 
12
12
  ## 两处都叫 MCP,但不是同一件事
13
13
 
@@ -15,11 +15,11 @@
15
15
 
16
16
  ## 要重启的值
17
17
 
18
- `llmTestTimeoutMs`(90000)、`startupVerify`(默认开:装载时自检端点)、`ocrBackgroundMaxMs`(0 表示不设兜底窗口)、`stdoutMaxBytes`(400000)、`ocrNoAutoUpdate`(默认 false,即保留上游的自动升级,除非你明确关掉)、`ocrInstallHint`(`both`/`brew`/`npm`)。写在本插件注册行的 `config:` 块,改值随重启生效。
18
+ `llmTestTimeoutMs`(90000)、`startupVerify`(默认开:装载时自检端点)、`ocrBackgroundMaxMs`(0 表示不设兜底窗口)、`stdoutMaxBytes`(400000)、`ocrNoAutoUpdate`(默认 false,即保留上游的自动升级,除非你明确关掉)、`ocrInstallHint`(`both`/`brew`/`npm`)。写在本插件于 `cordis.patch.yml` 注册行的 `config:` 块,改值随重启生效。
19
19
 
20
20
  ## 需要外部提供什么
21
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`,以免探测顺手触发升级。
22
+ `ocr` 命令行,期望版本 **1.13.3**;这个期望唯一声明在 `package.json` 的 `ocrCliVersion`,代码常量与两份 README 镜像同一个字符串,版本不符只作为提示报出,从不中断评审。装法是 `brew install open-code-review` 或 `npm i -g @alibaba-group/open-code-review@1.13.3`。PATH 上一个候选都没有时,预检报「no ocr candidate on either path」并附安装提示;「command not found」(exit 127)是另一种情况:候选在,但真二进制跑不起来。版本探测一律强制 `OCR_NO_UPDATE=1`,以免探测顺手触发升级。
23
23
 
24
24
  API 凭据不存这里:本插件写的是一个 `api_key_cmd`,运行时的密钥由那支辅助脚本现取,不进配置文件。脚本缺失时卡上给出告警,而不是发一次没有鉴权的请求。
25
25