@liustack/modlens 3.16.2 → 3.16.4

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/CHANGELOG.md CHANGED
@@ -1,10 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.16.4 - 2026-08-15
4
+
5
+ - **How to update is written down, and the explanation it replaces was wrong.** 3.10.0 claimed that pnpm's release-age gate has a 10-day window and that an explicit version or dist-tag skips it, so every install command in this repo carried `@latest` as the fix. Measured on a machine with no gate configured at all: pnpm 11 turns `minimumReleaseAge` on by default at 24 hours (`24 * 60` in its config reader; `pnpm config get` does not surface that particular default), and `add @liustack/modlens@latest` installed 3.9.1 while 3.16.3 was the published latest. The gate filters the candidate versions before the tag is resolved, so the tag lands on an older one, and a day of held-back wall-clock time can be several releases on a fast week. The pnpm issue behind the original claim describes a bug in pnpm 10.16.1 that was fixed, and says in its own text that `@latest` was subject to the gate. What does work is naming the version, a deliberate request rather than a resolution: pnpm 11 installs it and records that one version as an approved exception, leaving everything else behind the window. Where a stricter policy is configured it refuses instead, and `--config.minimumReleaseAge=0` lifts the gate for one command, for every package that command resolves. `harness-setup` now has an Updating section covering both install shapes, including why `update` cannot cross a major (it stays inside the recorded semver range) and how to check what actually landed.
6
+
7
+ ## 3.16.3 - 2026-08-15
8
+
9
+ - **The dsh tool is registered under a name of its own, so the model can actually see it ([#34](https://github.com/liustack/modlens/issues/34)).** A host with a durable attachment store mounts its own `read_image`, and 3.13.0 handled that by catching the duplicate-registration error and renaming. That catch never fired. dsh's tool registry is layered and a scoped tool shadows a global one, so a host `read_image` in the agent-preset scope and ours registered globally are not a duplicate at all: the registration succeeded, nothing was logged, and the model kept resolving the host tool, which refuses a text-only model outright. Nor is the collision cheap to detect, so the tool now takes the name `modlens_read_image` instead of competing for `read_image`, and the model finds it through the schema that reaches it every request regardless of the name. `toolName` still pins whatever a host prefers. Thanks to @ingleav626-art, who instrumented the registry and brought back the layer that made the old fix dead code.
10
+ - **A region kind outside the common list no longer fails the read ([#34](https://github.com/liustack/modlens/issues/34)).** `layout.regions[].type` was a closed enum, so a model answering `link` on any web screenshot or `search` on a portal produced a result the schema rejected, losing the entire read over a descriptive label. Region kinds are an open set: the same reporter found that extending the list to 13 values still was not enough. The field is a free string now, and the common vocabulary moved into its schema description, where it guides every provider that enforces the schema server-side without constraining any of them.
11
+
3
12
  ## 3.16.2 - 2026-08-14
4
13
 
5
14
  - **The claude-cli provider starts on Windows ([#31](https://github.com/liustack/modlens/issues/31)).** npm installs every JS CLI as a trio, and both ways of reaching it failed: the bare name found none of them (ENOENT, reported as "not installed" next to a `claude --version` that worked fine), and handing spawn the `.cmd` hit Node's post-CVE refusal to run batch files without a shell (EINVAL). Wrapping it in `cmd.exe` turned out to be a trap, since a cmd command line cannot carry a raw newline and our provider arguments are whole multi-line vision prompts, so a wrapped prompt truncates at its first line break and the rest is read as a second command. modlens instead reads the shim, takes the Node entry it points at, and spawns Node on it directly: no shell, no escaping, and the child is the real provider, so a timeout's SIGTERM lands on it rather than an intermediate. The reading is conservative by construction. Every line of the shim must be accounted for, the interpreter is read rather than inferred (cmd-shim will happily generate a python shim for a file named `.js`), and a shim carrying anything this cannot reproduce faithfully, an environment assignment, cmd control syntax, an argument whose quoting it cannot prove, is declined and left to a spawn error that names the provider, the command, and the real error code. Nine rounds of independent review shaped that boundary, each round adding a shape it had to refuse rather than guess at. Thanks to @zhang66633 for a report that arrived with both failure modes already isolated.
6
15
  - **The install procedure knows about dsh ([#32](https://github.com/liustack/modlens/issues/32)).** INSTALL.md, the file an agent is pointed at, never mentioned dsh once, so an agent told to install modlens followed the skill procedure to its end and left the user without the `read_image` tool and without the `(modlens vision)` entries they were looking for. It now opens with a dsh branch: install the plugin, skip the skill copy, keep the same engine configuration.
7
- - **`doctor` says when an installed skill copy has fallen behind ([#33](https://github.com/liustack/modlens/issues/33)).** A skill is installed by copying it, and a copy keeps the version it was stamped with, so one machine ran 3.8.0 for eight releases and hit bugs that were long fixed. doctor now reads the pin out of every installed copy it can find and compares it against the version of the CLI reporting, which differ exactly when it matters, since the dsh plugin and an `@latest` run are both current. Still offline: two local file reads, no registry call. Thanks to @Ztyss for a report that had already verified the release stamping, leaving the update story as the real gap.
16
+ - **`doctor` says when an installed skill copy has fallen behind ([#33](https://github.com/liustack/modlens/issues/33)).** A skill is installed by copying it, and a copy keeps the version it was stamped with, so one machine ran 3.8.0 for eight releases and hit bugs that were long fixed. doctor now reads the pin out of every installed copy it can find and compares it against the version of the CLI reporting, which differ exactly when it matters, since a copy is frozen at install time while the CLI reporting is whatever was just launched. Still offline: two local file reads, no registry call. Thanks to @Ztyss for a report that had already verified the release stamping, leaving the update story as the real gap.
8
17
 
9
18
  ## 3.16.1 - 2026-08-14
10
19
 
@@ -51,7 +60,7 @@
51
60
  - *dsh evidence cache.* Failed reads are no longer memoized forever (a fixed config gets a fresh chance without restarting dsh), concurrent steps join one in-flight read instead of double-spending the engine, the cache is capped LRU-style, and cancellation is per-waiter: aborting one step stops its own wait immediately while the shared read completes into the cache, instead of killing every concurrent joiner. Pasted HEIC/HEIF now maps to its real extension, and an unknown media type refuses instead of dressing up as PNG.
52
61
  - *Docs told the truth about less than the code did.* The security page now states per provider who fetches a remote URL (only gemini-api downloads locally behind the SSRF guards, magic-byte check, and size cap; openai/anthropic hand the URL to the vendor). The output contract now lists `visual` as required, matching the schema that always enforced it, with a docs-contract test pinning the two together. Doctor renders CLI providers as `[ok?] installed / sign-in not verified offline` instead of a flat ok, adds a machine-readable `status` field (`ready`/`installed`/`missing`) so JSON consumers stop reading bare-binary as ready, and the install flow treats the first real read as the auth check. The skill's trigger list drops `.bmp` (never supported by the CLI) and gains `.heif`.
53
62
  - *Hardening around the edges.* The release script and workflow now run lint, refuse version downgrades, and verify the tag matches package.json; CLI numeric flags reject trailing garbage (`--count 3x`); error exits use `process.exitCode` so piped output survives.
54
- - **dsh install can silently land on 3.5.0 ([#18](https://github.com/liustack/modlens/issues/18)).** pnpm v11's release-age quarantine falls back to an old version when every recent one is inside the window (10 days on pnpm 11.21, measured), and versions before 3.9.0 carry no `dsh.bundle` declaration, so the plugin installs as a plain dependency and none of the tools appear. There is no CLI or env override for the gate ([pnpm#11224](https://github.com/pnpm/pnpm/issues/11224) is still open), but an explicit version or dist-tag skips it ([pnpm#9989](https://github.com/pnpm/pnpm/issues/9989), verified against pnpm 11.21: a bare add resolved 2.8.0 while `@latest` resolved 3.10.0 under the same default gate). The install command everywhere now carries `@latest`, so new installs land current with zero user-side setup; troubleshooting documents the mechanism plus the durable bare-name `minimumReleaseAgeExclude` fallback for whenever pnpm closes that skip. Thanks to @stonogic086-1 for the precise diagnosis.
63
+ - **dsh install can silently land on 3.5.0 ([#18](https://github.com/liustack/modlens/issues/18)).** pnpm v11's release-age quarantine falls back to an old version when every recent one is inside the window (10 days on pnpm 11.21, measured), and versions before 3.9.0 carry no `dsh.bundle` declaration, so the plugin installs as a plain dependency and none of the tools appear. There is no CLI or env override for the gate ([pnpm#11224](https://github.com/pnpm/pnpm/issues/11224) is still open), but an explicit version or dist-tag skips it ([pnpm#9989](https://github.com/pnpm/pnpm/issues/9989), verified against pnpm 11.21: a bare add resolved 2.8.0 while `@latest` resolved 3.10.0 under the same default gate). **(Wrong, corrected in 3.16.4: the window is 24 hours, not 10 days, and `@latest` does not skip the gate.)** The install command everywhere now carries `@latest`, which does not in fact land current either; troubleshooting documents the mechanism plus a durable `minimumReleaseAgeExclude` fallback. Thanks to @stonogic086-1 for the precise diagnosis.
55
64
 
56
65
  ## 3.10.0 - 2026-08-14
57
66
 
package/README.md CHANGED
@@ -34,9 +34,9 @@ Issues are welcome any time: [open one](https://github.com/liustack/modlens/issu
34
34
 
35
35
  ## Highlights
36
36
 
37
- **🥇 The first vision plugin for DeepSeek Harness (dsh):** one command, `npx -y @deepseek-ai/dsh plugin --profile web add @liustack/modlens@latest`, and the text-only DeepSeek model behind dsh reads images through a native `read_image` tool. If dsh warns `declares no dsh.bundle`, pnpm's release-age gate installed an old version: see [troubleshooting](docs/troubleshooting.md#dsh-says-declares-no-dshbundle--installed-as-a-plain-dependency) for the one-line fix.
37
+ **🥇 The first vision plugin for DeepSeek Harness (dsh):** one command, `npx -y @deepseek-ai/dsh plugin --profile web add @liustack/modlens@latest`, and the text-only DeepSeek model behind dsh reads images through a native `modlens_read_image` tool. Updating is the same command again, with one wrinkle worth knowing: pnpm 11 holds back releases published in the last 24 hours, and `@latest` does not skip that, so a same-day fix needs its version named ([how to update](docs/harness-setup.md#keeping-it-up-to-date)).
38
38
 
39
- Pasting an image works two ways. **① Just paste.** On a text-only model the pasted image lands as a private temp file and its path enters the composer — the same interaction OpenCode and Pi ship — and the `read_image` tool takes it from there. **② Pick a `(modlens vision)` entry** in the model selector (it remembers your choice, so once is enough), then paste: the thumbnail stays visible in your message, closer to the Codex app feel, and the image is converted to structured evidence at request time, answered by the same underlying route. The plugin auto-discovers every provider route carrying text-only DeepSeek or GLM models and adds a wrapped entry per route (a stock install gets **`DeepSeek-V4-Flash (modlens vision)`** and **`DeepSeek-V4-Pro (modlens vision)`**; extra routes like opencode-go or zai get their own); the two families' own vision models are excluded automatically. Which paste route applies is the host's per-model call: only a model its metadata positively confirms text-only is taken over, anything unconfirmed is left alone, so vision models keep their native paste ([details](docs/harness-setup.md)).
39
+ Pasting an image works two ways. **① Just paste.** On a text-only model the pasted image lands as a private temp file and its path enters the composer — the same interaction OpenCode and Pi ship — and the `modlens_read_image` tool takes it from there. **② Pick a `(modlens vision)` entry** in the model selector (it remembers your choice, so once is enough), then paste: the thumbnail stays visible in your message, closer to the Codex app feel, and the image is converted to structured evidence at request time, answered by the same underlying route. The plugin auto-discovers every provider route carrying text-only DeepSeek or GLM models and adds a wrapped entry per route (a stock install gets **`DeepSeek-V4-Flash (modlens vision)`** and **`DeepSeek-V4-Pro (modlens vision)`**; extra routes like opencode-go or zai get their own); the two families' own vision models are excluded automatically. Which paste route applies is the host's per-model call: only a model its metadata positively confirms text-only is taken over, anything unconfirmed is left alone, so vision models keep their native paste ([details](docs/harness-setup.md)).
40
40
 
41
41
  **Paste an image and it reads it.** No saving to a file and passing a path first.
42
42
 
package/README.zh-CN.md CHANGED
@@ -34,11 +34,11 @@ DeepSeek 和 GLM 的主力对话模型是纯文本的,无法进行图片识别
34
34
 
35
35
  ## 亮点
36
36
 
37
- **🥇 全网第一个支持 DeepSeek Harness(dsh)的外挂视觉识别插件:**一条命令 `npx -y @deepseek-ai/dsh plugin --profile web add @liustack/modlens@latest`,dsh 背后的纯文本 DeepSeek 模型即可通过原生 `read_image` 工具读图。如果 dsh 提示 `declares no dsh.bundle`,是 pnpm 的发布冷静期装了旧版,一行命令可解,见[故障排查](docs/troubleshooting.zh-CN.md#dsh-提示-declares-no-dshbundle--installed-as-a-plain-dependency)。
37
+ **🥇 全网第一个支持 DeepSeek Harness(dsh)的外挂视觉识别插件:**一条命令 `npx -y @deepseek-ai/dsh plugin --profile web add @liustack/modlens@latest`,dsh 背后的纯文本 DeepSeek 模型即可通过原生 `modlens_read_image` 工具读图。更新就是再跑一遍同一条命令,有一个坑值得知道:pnpm 11 会扣住最近 24 小时内发布的版本,而 `@latest` 跳不过去,所以想要当天的修复得点名版本号([怎么更新](docs/harness-setup.zh-CN.md#保持更新))。
38
38
 
39
39
  DeepSeek Harness 粘贴识图有两种玩法。
40
40
 
41
- **① 直接粘贴** 贴进来的图片自主转换成文件路径进输入框(与 OpenCode、Pi 同款交互),`read_image` 工具接手读图。
41
+ **① 直接粘贴** 贴进来的图片自主转换成文件路径进输入框(与 OpenCode、Pi 同款交互),`modlens_read_image` 工具接手读图。
42
42
 
43
43
  **② 切到带 `(modlens vision)` 后缀的模型变体**(选择器有记忆,选一次就行)再粘贴:缩略图直接可见、所见即所得,体验更接近 Codex App。变体由插件自动发现生成:每条承载纯文本 DeepSeek 或 GLM 模型的 provider 路由各得一组包装条目(默认安装下就是 **`DeepSeek-V4-Flash (modlens vision)`** 和 **`DeepSeek-V4-Pro (modlens vision)`**,装了 opencode-go、zai 等额外路由的机器会各自多出一组),两家自己的视觉型号自动排除。走哪条通路由 host 依据真实模型元数据逐个裁决:只有被元数据确认纯文本的模型才会被接管,确认不了的一律不动,视觉模型因此保留原生贴图([细节](docs/harness-setup.zh-CN.md))。
44
44
 
@@ -72,7 +72,7 @@ agy # 浏览器完成
72
72
  npx -y @deepseek-ai/dsh plugin --profile web add @liustack/modlens@latest
73
73
  ```
74
74
 
75
- 装完即有 `read_image` 工具,选「(modlens vision)」模型变体即可直接粘贴识图。引擎配置同样在 `~/.modlens`,详见[宿主接入](docs/harness-setup.zh-CN.md)。
75
+ 装完即有 `modlens_read_image` 工具,选「(modlens vision)」模型变体即可直接粘贴识图。引擎配置同样在 `~/.modlens`,详见[宿主接入](docs/harness-setup.zh-CN.md)。
76
76
 
77
77
  ## 用法
78
78
 
package/dist/main.js CHANGED
@@ -501,7 +501,7 @@ async function apiFetch(url, init, proxy, env = process.env) {
501
501
  }
502
502
  }
503
503
  const JSON_TEMPLATE_INSTRUCTION = `Respond with ONE JSON object only, no markdown fences, no commentary. Fill this exact structure with your findings from the image (do not repeat this template literally, replace every value):
504
- {"summary":"one paragraph describing the image","ocr":{"full_text":"all visible text","lines":[{"text":"one line","language":"en"}]},"layout":{"regions":[{"type":"title|subtitle|paragraph|list|table|chart|form|code|image|icon|other","reading_order":1,"text":"region text"}]},"semantics":{"scene":"what kind of scene","intent":"what the image is for","entities":[{"name":"entity","type":"kind","evidence":"where seen"}],"relations":[{"subject":"a","predicate":"relates to","object":"b"}]},"visual":{"dominant_colors":["color"],"style":"visual style","notes":["notable visual detail"]},"uncertainty":["anything unreadable or ambiguous"]}`;
504
+ {"summary":"one paragraph describing the image","ocr":{"full_text":"all visible text","lines":[{"text":"one line","language":"en"}]},"layout":{"regions":[{"type":"a short kind, e.g. title, heading, paragraph, list, table, chart, form, code, image, icon, link, nav, button, search, or any other short label that fits better","reading_order":1,"text":"region text"}]},"semantics":{"scene":"what kind of scene","intent":"what the image is for","entities":[{"name":"entity","type":"kind","evidence":"where seen"}],"relations":[{"subject":"a","predicate":"relates to","object":"b"}]},"visual":{"dominant_colors":["color"],"style":"visual style","notes":["notable visual detail"]},"uncertainty":["anything unreadable or ambiguous"]}`;
505
505
  function buildVisionPrompt(options) {
506
506
  const readInstruction = options.imageKind === "inline" ? "Analyze the image attached to this message." : options.imageKind === "remote" ? `Fetch the image at this URL and analyze it: ${options.imageSource}` : `Read the image file at this path and analyze it: ${options.imageSource}`;
507
507
  const basePrompt = `${readInstruction}
@@ -553,21 +553,18 @@ const VISION_RESULT_SCHEMA = {
553
553
  items: {
554
554
  type: "object",
555
555
  properties: {
556
+ // Deliberately not an enum. Region kinds are an
557
+ // open set: a closed list rejected `link` on any
558
+ // web screenshot and `search` on a portal, and a
559
+ // rejected result fails the whole read over a
560
+ // descriptive label (issue #34). The common
561
+ // vocabulary moves into the description, which
562
+ // guides without constraining and rides along to
563
+ // every provider that enforces this schema
564
+ // server-side.
556
565
  type: {
557
566
  type: "string",
558
- enum: [
559
- "title",
560
- "subtitle",
561
- "paragraph",
562
- "list",
563
- "table",
564
- "chart",
565
- "form",
566
- "code",
567
- "image",
568
- "icon",
569
- "other"
570
- ]
567
+ description: "A short kind for this region. Prefer a common one where it fits: title, heading, paragraph, list, table, chart, form, code, image, icon, link, nav, button, search. Any other short label is fine when none of those describe it."
571
568
  },
572
569
  reading_order: { type: "number" },
573
570
  text: { type: "string" }
@@ -4072,7 +4069,7 @@ function parsePositiveInt(raw, flag) {
4072
4069
  }
4073
4070
  return Number.parseInt(raw, 10);
4074
4071
  }
4075
- program.name("modlens").description("Plug-in vision for text-only LLMs: image in, structured JSON evidence out").version("3.16.2");
4072
+ program.name("modlens").description("Plug-in vision for text-only LLMs: image in, structured JSON evidence out").version("3.16.4");
4076
4073
  program.command("analyze", { isDefault: true }).description("Analyze an image into structured JSON evidence (default command)").requiredOption("-i, --input <path|url>", "Input image path or https URL").option("-o, --output <path>", "Write result JSON to a file").option("-m, --model <name>", "Provider model name").option("-p, --provider <name>", `Vision provider (${listProviders().join(", ")})`).option("--prompt <text>", "Extra focus for this image").option("--timeout <ms>", "Provider timeout in milliseconds", "180000").option("--provider-bin <path>", "Provider binary path (default: agy)").option("--workdir <path>", "Working directory for the provider").option(
4077
4074
  "--extra-body <json>",
4078
4075
  `JSON merged into the API request body, e.g. '{"thinking":{"type":"disabled"}}'`
@@ -4182,7 +4179,7 @@ program.command("doctor").description(
4182
4179
  configPath: CONFIG_PATH,
4183
4180
  // Lets doctor name an installed skill copy that is older than
4184
4181
  // the CLI reporting on it (issue #33).
4185
- version: "3.16.2"
4182
+ version: "3.16.4"
4186
4183
  });
4187
4184
  const output = options.json ? JSON.stringify(report, null, 2) : renderDoctorReport(report);
4188
4185
  process.stdout.write(`${output}
@@ -58,7 +58,48 @@ dsh is different from the other harnesses: modlens plugs in as a native tool, no
58
58
  npx -y @deepseek-ai/dsh plugin --profile web add @liustack/modlens@latest
59
59
  ```
60
60
 
61
- This registers a `read_image` tool whose schema reaches the model on every request (no trigger heuristics), runs the modlens CLI shipped inside the same package, and returns the structured evidence as the tool's canonical JSON output. Engines, reuse grants, and guard rules stay in `~/.modlens/config.json`, shared with every other harness. dsh is in developer preview and its plugin surface may change; the plugin keeps its touch small (raw tool registration, the llm adapter surface for the vision variants, the attachment reader, and one agent pre-step hook) and degrades loudly if any of them moves.
61
+ This registers a `modlens_read_image` tool whose schema reaches the model on every request (no trigger heuristics), runs the modlens CLI shipped inside the same package, and returns the structured evidence as the tool's canonical JSON output. Engines, reuse grants, and guard rules stay in `~/.modlens/config.json`, shared with every other harness. dsh is in developer preview and its plugin surface may change; the plugin keeps its touch small (raw tool registration, the llm adapter surface for the vision variants, the attachment reader, and one agent pre-step hook) and degrades loudly if any of them moves.
62
+
63
+ ### Keeping it up to date
64
+
65
+ modlens ships often, and both install shapes freeze at whatever version they
66
+ got. On dsh, re-run the install. `add` is the command, not `update`: `update`
67
+ stays inside the semver range already recorded, and the range a plain install
68
+ writes is a caret one, so a profile that once landed on 2.7.1 updates to 2.8.0
69
+ and never crosses into 3.x.
70
+
71
+ ```sh
72
+ npx -y @deepseek-ai/dsh plugin --profile <name> add @liustack/modlens@latest
73
+ ```
74
+
75
+ Restart dsh, then check what actually landed with
76
+ `npx -y @deepseek-ai/dsh plugin --profile <name> list`. That check is worth
77
+ running, because what you get may not be the newest release: pnpm 11 holds back
78
+ anything published in the last 24 hours (`minimumReleaseAge`, on by default) and
79
+ resolves silently to the newest release older than that. `@latest` does not
80
+ change it: the gate filters the candidates before the tag is resolved, so the
81
+ tag lands on an older one. What that costs is a day of wall-clock time, not one
82
+ version, so on a fast-moving week it can be several releases back.
83
+
84
+ When it is not, name the version instead of asking for a tag:
85
+
86
+ ```sh
87
+ npx -y @deepseek-ai/dsh plugin --profile <name> add @liustack/modlens@3.16.4
88
+ ```
89
+
90
+ `npm view @liustack/modlens version` prints the current one. A named version is
91
+ a deliberate request rather than a resolution, so pnpm 11 installs it, and
92
+ since 11.1.3 records that one version as an approved exception in the profile's
93
+ `pnpm-workspace.yaml`; everything else stays behind the window. The
94
+ [troubleshooting page](troubleshooting.md#dsh-says-declares-no-dshbundle--installed-as-a-plain-dependency)
95
+ covers the stricter case, where you configured `minimumReleaseAge` yourself and
96
+ pnpm refuses rather than approves.
97
+
98
+ On the skill harnesses a skill is a copied folder, and the copy keeps its
99
+ install-time version, so re-run the install to overwrite it in place.
100
+ `modlens doctor` reads the pin out of every copy it can find and flags the ones
101
+ behind the CLI doing the reporting, which makes the drift visible before it
102
+ costs anyone a debugging session.
62
103
 
63
104
  ### Paste-to-path (web profile)
64
105
 
@@ -69,7 +110,7 @@ the image bytes go to the plugin's `/modlens/paste` route on the dsh web
69
110
  server (loopback, magic-byte checked, 25 MB cap), land as a private temp file,
70
111
  and the composer receives the file path as plain text — the same shape Pi,
71
112
  OpenCode, and Claude Code hand their models, and the modlens skill's and
72
- `read_image` tool's primary trigger. Admission never fires because the message
113
+ `modlens_read_image` tool's primary trigger. Admission never fires because the message
73
114
  carries no image attachment.
74
115
 
75
116
  The takeover is conditional, and the decision is the host's: the browser half
@@ -58,10 +58,30 @@ dsh 与其他 harness 不同:modlens 以原生工具的形式接入,而不
58
58
  npx -y @deepseek-ai/dsh plugin --profile web add @liustack/modlens@latest
59
59
  ```
60
60
 
61
- 这会注册一个 `read_image` 工具,它的 schema 随每次请求抵达模型(不靠触发启发式),运行同一个包里自带的 modlens CLI,并把结构化证据作为工具的标准 JSON 输出返回。引擎、复用授权和 guard 规则仍在 `~/.modlens/config.json` 里,与其他所有 harness 共享。dsh 还在开发者预览阶段,插件接口可能变化。这个插件刻意保持很小的接触面(原生工具注册、视觉变体所用的 llm 适配层、附件读取器,以及一个 agent 执行前钩子),其中任何一处变动,它都会大声报错而不是无声退化。
61
+ 这会注册一个 `modlens_read_image` 工具,它的 schema 随每次请求抵达模型(不靠触发启发式),运行同一个包里自带的 modlens CLI,并把结构化证据作为工具的标准 JSON 输出返回。引擎、复用授权和 guard 规则仍在 `~/.modlens/config.json` 里,与其他所有 harness 共享。dsh 还在开发者预览阶段,插件接口可能变化。这个插件刻意保持很小的接触面(原生工具注册、视觉变体所用的 llm 适配层、附件读取器,以及一个 agent 执行前钩子),其中任何一处变动,它都会大声报错而不是无声退化。
62
+
63
+ ### 保持更新
64
+
65
+ modlens 发布很频繁,而两种安装形态都会冻结在装进来的那个版本上。dsh 上重跑一遍安装即可。命令是 `add` 而不是 `update`:`update` 只在 package.json 里已记录的 semver 范围内挪动,而普通安装写进去的是 caret 范围,所以一个当初装到 2.7.1 的 profile 只会更新到 2.8.0,永远进不了 3.x。
66
+
67
+ ```sh
68
+ npx -y @deepseek-ai/dsh plugin --profile <name> add @liustack/modlens@latest
69
+ ```
70
+
71
+ 重启 dsh,然后用 `npx -y @deepseek-ai/dsh plugin --profile <name> list` 看看实际装到了什么。这一步值得做,因为拿到的未必是最新版:pnpm 11 会扣住最近 24 小时内发布的版本(`minimumReleaseAge`,默认开启),静默解析到比它更早的那个最新版本。`@latest` 改变不了这一点:冷静期先把候选版本过滤掉,dist-tag 才在剩下的里面解析,于是它落到了更旧的那个上。代价是一天的自然时间,不是一个版本,发布密集的一周里可能落后好几个版本。
72
+
73
+ 需要今天的版本时,改成点名版本号,而不是要一个 tag:
74
+
75
+ ```sh
76
+ npx -y @deepseek-ai/dsh plugin --profile <name> add @liustack/modlens@3.16.4
77
+ ```
78
+
79
+ `npm view @liustack/modlens version` 可以查到当前版本号。点名版本是一次明确指定而不是一次解析,所以 pnpm 11 会装上它,11.1.3 起还会把这一个版本作为已批准的例外写进该 profile 的 `pnpm-workspace.yaml`,其余一切仍留在窗口后面。更严格的情况(你自己配过 `minimumReleaseAge`,pnpm 会拒绝而不是批准)见[故障排查](troubleshooting.zh-CN.md#dsh-提示-declares-no-dshbundle--installed-as-a-plain-dependency)。
80
+
81
+ skill 类 harness 上,skill 是一个拷贝出来的文件夹,拷贝会保留安装时的版本,重跑安装原地覆盖即可。`modlens doctor` 会读出它能找到的每一份拷贝里钉住的版本,并标出落后于当前 CLI 的那些,让版本漂移在坑到人之前就先暴露出来。
62
82
 
63
83
  ### 粘贴转路径(paste-to-path,web profile)
64
84
 
65
- 过去在 dsh Web UI 里,**纯文本模型**下粘贴图片会死在图片准入检查这一步。插件现在带了一个浏览器端半边(由 dsh 的客户端插件系统自动加载),恰好在这种情况下接管粘贴:图片字节发到插件在 dsh web 服务器上的 `/modlens/paste` 路由(仅回环地址,校验 magic byte,上限 25 MB),落成一个私有临时文件,输入框收到的则是纯文本的文件路径。这与 Pi、OpenCode、Claude Code 递给模型的形态一致,也正是 modlens skill 和 `read_image` 工具的首要触发条件。消息里不带图片附件,准入检查根本不会触发。
85
+ 过去在 dsh Web UI 里,**纯文本模型**下粘贴图片会死在图片准入检查这一步。插件现在带了一个浏览器端半边(由 dsh 的客户端插件系统自动加载),恰好在这种情况下接管粘贴:图片字节发到插件在 dsh web 服务器上的 `/modlens/paste` 路由(仅回环地址,校验 magic byte,上限 25 MB),落成一个私有临时文件,输入框收到的则是纯文本的文件路径。这与 Pi、OpenCode、Claude Code 递给模型的形态一致,也正是 modlens skill 和 `modlens_read_image` 工具的首要触发条件。消息里不带图片附件,准入检查根本不会触发。
66
86
 
67
87
  接管是有条件的,且裁决权在 host 一侧:浏览器半边先向插件路由询问当前选中的模型是否纯文本,host 用 provider 注册表里声明的模型元数据(`inputModalities`)回答,而不是靠名称猜。`(modlens vision)` 变体和任何声明支持图片输入的模型都保留原生粘贴流程(变体在发请求时转换且保留缩略图,视觉模型自己读图),host 认不出的模型同样不接管:在 host 确认该接管之前,粘贴一律走原生路径。模型元数据里没有声明输入模态的,一律算认不出:元数据缺失绝不当成「已确认纯文本」。裁决还有 60 秒时效,模型中途变了会重新问询,不会永远信旧答案。在插件配置行里设 `pasteToPath: false` 可整体关掉这个功能:策略端点 404 时浏览器半边彻底停手。若路由在裁决确认后中途消失,失败结果返回前那个短暂窗口(一次本地往返)内发生的粘贴会丢失,之后客户端清空全部裁决,后续粘贴一律走原生路径。
@@ -44,7 +44,7 @@ The CLI prints one JSON object to stdout:
44
44
  "layout": {
45
45
  "regions": [
46
46
  {
47
- "type": "title|subtitle|paragraph|list|table|chart|form|code|image|icon|other",
47
+ "type": "string (a short kind: title, paragraph, list, table, chart, form, code, image, icon, link, nav, ...)",
48
48
  "reading_order": 1,
49
49
  "text": "string"
50
50
  }
@@ -71,4 +71,6 @@ The CLI prints one JSON object to stdout:
71
71
 
72
72
  Required fields: `summary`, `ocr`, `layout`, `semantics`, `visual`, `uncertainty` — every top-level field, `visual` included. (Earlier docs called `visual` optional; the enforced schema has always required it, so build to the schema.)
73
73
 
74
- Changes from v1: pixel `bbox` coordinates and numeric `confidence` scores were removed. Vision models fabricate both, so v2 stops pretending to provide them. `layout.regions[].type` gained `code`.
74
+ `layout.regions[].type` is a free string, not a closed list. Region kinds are an open set: a fixed enum rejected `link` on any web screenshot and `search` on a portal, and a rejected result fails the whole read over a descriptive label. The field's schema `description` names the common vocabulary as guidance, which reaches every provider that enforces this schema server-side, so an unlisted kind costs nothing.
75
+
76
+ Changes from v1: pixel `bbox` coordinates and numeric `confidence` scores were removed. Vision models fabricate both, so v2 stops pretending to provide them.
@@ -44,7 +44,7 @@ CLI 向 stdout 打印一个 JSON 对象:
44
44
  "layout": {
45
45
  "regions": [
46
46
  {
47
- "type": "title|subtitle|paragraph|list|table|chart|form|code|image|icon|other",
47
+ "type": "string (a short kind: title, paragraph, list, table, chart, form, code, image, icon, link, nav, ...)",
48
48
  "reading_order": 1,
49
49
  "text": "string"
50
50
  }
@@ -71,4 +71,6 @@ CLI 向 stdout 打印一个 JSON 对象:
71
71
 
72
72
  必填字段:`summary`、`ocr`、`layout`、`semantics`、`visual`、`uncertainty`,也就是每一个顶层字段,`visual` 也不例外。(早期文档把 `visual` 写成可选,但强制执行的 schema 一直要求它,请以 schema 为准。)
73
73
 
74
- 相对 v1 的变化:删掉了像素级 `bbox` 坐标和数值型 `confidence` 分数。视觉模型会凭空编造这两样,v2 不再假装提供。`layout.regions[].type` 新增了 `code`。
74
+ `layout.regions[].type` 是自由字符串,不是封闭列表。区域类型本质是开放集合:固定枚举会让任何网页截图里的 `link`、门户页里的 `search` 直接落选,而一次落选就为了一个描述性标签废掉整次识别。常用词表写在该字段的 schema `description` 里作为指引,凡是在服务端强制执行这份 schema 的 provider 都会收到,没列到的类型不会有任何代价。
75
+
76
+ 相对 v1 的变化:删掉了像素级 `bbox` 坐标和数值型 `confidence` 分数。视觉模型会凭空编造这两样,v2 不再假装提供。
@@ -124,37 +124,70 @@ Note that the hard refusal above only fires on an actual `denyModels` match agai
124
124
  ## dsh says "declares no dsh.bundle — installed as a plain dependency"
125
125
 
126
126
  The dsh profile installed an old modlens version. The `dsh.bundle` declaration
127
- exists since 3.9.0, and pnpm v11's release-age gate (`minimumReleaseAge`,
128
- quarantining recently published versions, with a 10-day window measured on pnpm 11.21) silently falls back to an older version when every
129
- recent one is inside the window. That old version has no bundle declaration,
130
- so dsh correctly treats it as a plain dependency and none of the tools appear.
131
-
132
- The fix: name the version explicitly. pnpm applies the age gate when resolving
133
- a range, but an explicit version or dist-tag skips it ([pnpm#9989](https://github.com/pnpm/pnpm/issues/9989), verified on pnpm 11.21), which is why the install
134
- command carries `@latest`:
127
+ exists since 3.9.0, and pnpm 11 holds back releases published in the last 24
128
+ hours (`minimumReleaseAge`, on by default since 11.0; `pnpm config get` does not
129
+ surface this particular default, so it prints nothing for it). When
130
+ every version carrying the declaration was inside that window, pnpm silently
131
+ resolved to an older one, which has no declaration, so dsh correctly treated it
132
+ as a plain dependency and none of the tools appeared.
133
+
134
+ `@latest` does not avoid this, which earlier versions of this page got wrong.
135
+ The gate filters the candidate versions before the tag is resolved, so the tag
136
+ simply lands on an older one. Name the exact version instead, which pnpm treats
137
+ as a deliberate request rather than a resolution:
135
138
 
136
139
  ```sh
137
- npx -y @deepseek-ai/dsh plugin --profile <name> add @liustack/modlens@latest
140
+ npx -y @deepseek-ai/dsh plugin --profile <name> add @liustack/modlens@3.16.4
138
141
  ```
139
142
 
140
- dsh's reconcile notices the bundle declaration on the new version and
141
- activates it; restart dsh afterwards. Verify with
142
- `npx -y @deepseek-ai/dsh plugin --profile <name> list` — the version shown
143
- should be 3.9.0 or newer.
143
+ `npm view @liustack/modlens version` prints the current one. pnpm 11 installs a named
144
+ version, and since 11.1.3 also records it as an approved exception in the
145
+ profile's `pnpm-workspace.yaml`, leaving every other package and every future
146
+ modlens release behind the window.
144
147
 
145
- If a future pnpm closes that skip, the durable alternative is a one-time
146
- exclusion in `~/.dsh/profiles/<name>/pnpm-workspace.yaml` — the bare package
147
- name, not `name@version`, so it survives future releases:
148
+ If you set `minimumReleaseAge` yourself, pnpm treats the policy as strict and
149
+ refuses instead, naming the version and the cutoff
150
+ (`ERR_PNPM_NO_MATURE_MATCHING_VERSION`). Approve that one version in the same
151
+ file:
148
152
 
149
153
  ```yaml
150
154
  minimumReleaseAgeExclude:
151
- - '@liustack/modlens'
155
+ - '@liustack/modlens@3.16.4'
156
+ ```
157
+
158
+ Or lift the gate for a single command, which lifts it for everything that
159
+ command resolves, not only modlens:
160
+
161
+ ```sh
162
+ npx -y @deepseek-ai/dsh plugin --profile <name> add @liustack/modlens@latest --config.minimumReleaseAge=0
152
163
  ```
153
164
 
154
- then `npx -y @deepseek-ai/dsh plugin --profile <name> update @liustack/modlens`.
155
- The trade-off is honest either way: an explicit `@latest` (or the exclusion)
156
- opts modlens out of pnpm's supply-chain cooling-off window, so new releases
157
- install immediately.
165
+ dsh's reconcile notices the bundle declaration on the new version and activates
166
+ it; restart dsh afterwards. Verify with
167
+ `npx -y @deepseek-ai/dsh plugin --profile <name> list`.
168
+
169
+ ## dsh: the model cannot see the read_image tool
170
+
171
+ The plugin registers its tool as `modlens_read_image`, not `read_image`. dsh's
172
+ tool registry is layered, and a scoped tool shadows a global one: a host
173
+ `read_image` mounted in the agent-preset scope and a plugin's registered
174
+ globally are not a duplicate at all, so the registration succeeds silently and
175
+ the model still resolves the host's, which refuses a text-only model outright
176
+ ([#34](https://github.com/liustack/modlens/issues/34)). Under our own name
177
+ there is nothing to shadow it, and the model finds the tool through its
178
+ schema, which reaches it on every request regardless of the name.
179
+
180
+ If the model still cannot see it, check the harness log for
181
+ `[modlens] ... registration skipped`. `toolName` in the plugin row pins a
182
+ different name, but pick one nothing else uses: any name a scoped tool already
183
+ holds will be shadowed exactly the way `read_image` is, which puts you back in
184
+ this section.
185
+
186
+ ```yaml
187
+ - id: modlens
188
+ config:
189
+ toolName: vision_read_image
190
+ ```
158
191
 
159
192
  ## fetch failed, or could not connect
160
193
 
@@ -123,24 +123,42 @@ Invocation guard denied this read: active model "gemini-3.1-pro" matches guards.
123
123
 
124
124
  ## dsh 提示 `declares no dsh.bundle — installed as a plain dependency`
125
125
 
126
- dsh profile 装到的是旧版 modlens。`dsh.bundle` 声明从 3.9.0 起才存在,而 pnpm v11 的发布冷静期机制(`minimumReleaseAge`,隔离刚发布的版本,pnpm 11.21 上实测窗口为 10 天)在所有较新版本都在窗口内时,会静默回退到更旧的版本。那个旧版本没有 bundle 声明,dsh 于是正确地把它当作普通依赖,一个工具都不会出现。
126
+ dsh profile 装到的是旧版 modlens。`dsh.bundle` 声明从 3.9.0 起才存在,而 pnpm 11 会扣住最近 24 小时内发布的版本(`minimumReleaseAge`,自 11.0 起默认开启。`pnpm config get` 不展示这一项的内置默认值,所以查它什么都不显示)。当带声明的版本全都落在这个窗口内时,pnpm 会静默回退到更旧的版本,而旧版本没有 bundle 声明,dsh 于是正确地把它当作普通依赖,一个工具都不会出现。
127
127
 
128
- 解法:把版本写死。pnpm 只在解析版本范围时应用冷静期,显式版本或 dist-tag 会跳过它([pnpm#9989](https://github.com/pnpm/pnpm/issues/9989),pnpm 11.21 上实测),安装命令带 `@latest` 就是这个原因:
128
+ `@latest` 绕不开这一层,本页早先的说法是错的。冷静期先把候选版本过滤掉,dist-tag 才在剩下的里面解析,于是它直接落到了更旧的那个上。改成写死精确版本号,pnpm 会把它当作一次明确的指定,而不是一次解析:
129
129
 
130
130
  ```sh
131
- npx -y @deepseek-ai/dsh plugin --profile <name> add @liustack/modlens@latest
131
+ npx -y @deepseek-ai/dsh plugin --profile <name> add @liustack/modlens@3.16.4
132
132
  ```
133
133
 
134
- dsh 的 reconcile 会注意到新版本上的 bundle 声明并激活它,随后重启 dsh。用 `npx -y @deepseek-ai/dsh plugin --profile <name> list` 验证,显示的版本应该是 3.9.0 或更新。
134
+ `npm view @liustack/modlens version` 可以查到当前版本号。pnpm 11 会装上被点名的版本,11.1.3 起还会把它作为一条已批准的例外写进该 profile 的 `pnpm-workspace.yaml`,其余所有包和 modlens 以后的版本仍然留在窗口后面。
135
135
 
136
- 如果将来的 pnpm 关掉了这条跳过通道,更持久的替代方案是在 `~/.dsh/profiles/<name>/pnpm-workspace.yaml` 里加一条一次性排除(写裸包名,不写 `name@version`,这样以后的新版本也能沿用):
136
+ 如果你自己设过 `minimumReleaseAge`,pnpm 会把这条策略视为严格模式,转而拒绝安装并报出版本与截止时间(`ERR_PNPM_NO_MATURE_MATCHING_VERSION`)。在同一个文件里放行这一个版本:
137
137
 
138
138
  ```yaml
139
139
  minimumReleaseAgeExclude:
140
- - '@liustack/modlens'
140
+ - '@liustack/modlens@3.16.4'
141
141
  ```
142
142
 
143
- 然后执行 `npx -y @deepseek-ai/dsh plugin --profile <name> update @liustack/modlens`。两种方式的代价都摆在明面上:显式 `@latest`(或这条排除)让 modlens 退出 pnpm 的供应链冷静期,新版本会立即装上。
143
+ 或者只为这一条命令解除冷静期,注意它解除的是这条命令解析到的所有包,不只 modlens:
144
+
145
+ ```sh
146
+ npx -y @deepseek-ai/dsh plugin --profile <name> add @liustack/modlens@latest --config.minimumReleaseAge=0
147
+ ```
148
+
149
+ dsh 的 reconcile 会注意到新版本上的 bundle 声明并激活它,随后重启 dsh。用 `npx -y @deepseek-ai/dsh plugin --profile <name> list` 验证。
150
+
151
+ ## dsh:模型看不到 read_image 工具
152
+
153
+ 插件注册的工具名是 `modlens_read_image`,不是 `read_image`。dsh 的工具注册表是分层的,scoped 层会遮蔽全局层:宿主的 `read_image` 挂在 agent preset 作用域、插件注册在全局层,两者根本不算重名,于是注册静默成功,模型解析到的仍是宿主那个,而它对纯文本模型直接拒绝([#34](https://github.com/liustack/modlens/issues/34))。用自己的名字就没有东西会遮蔽它,模型是通过工具 schema 找到它的,而 schema 每次请求都会送达,与叫什么名字无关。
154
+
155
+ 如果模型仍然看不到,去 harness 日志里搜 `[modlens] ... registration skipped`。想改名就在插件配置行里设 `toolName`,但要挑一个别人没用的:任何已被某个 scoped 工具占用的名字,都会像 `read_image` 一样被遮蔽,那就又绕回本节了。
156
+
157
+ ```yaml
158
+ - id: modlens
159
+ config:
160
+ toolName: vision_read_image
161
+ ```
144
162
 
145
163
  ## fetch failed 或连接失败
146
164
 
package/dsh/client.js CHANGED
@@ -7,7 +7,7 @@
7
7
  // (POST /modlens/paste), land as a private temp file, and the returned path
8
8
  // is inserted into the composer as plain text. A text-only model then sees
9
9
  // exactly what Pi, OpenCode, and Claude Code hand their models: a file path,
10
- // which is also the modlens skill's and read_image tool's primary trigger.
10
+ // which is also the modlens skill's and the read tool's primary trigger.
11
11
  //
12
12
  // Hand-written in the lazy-CJS bundle protocol (window.__ModuleLoader__.load
13
13
  // with a factory returning cordis-plugin exports), so no build step and no
package/dsh/index.js CHANGED
@@ -1,8 +1,10 @@
1
- // DeepSeek Harness (dsh) plugin: registers a read_image tool backed by the
2
- // modlens CLI that ships in this very package. dsh models are text-only, so
3
- // the tool is the vision bridge; unlike prompt-triggered skills, a registered
4
- // tool schema reaches the model on every request, so there is no trigger
5
- // gamble. The engine is spawned from ../dist/main.js inside this package:
1
+ // DeepSeek Harness (dsh) plugin: registers a modlens_read_image tool backed
2
+ // by the modlens CLI that ships in this very package. dsh models are
3
+ // text-only, so the tool is the vision bridge; unlike prompt-triggered
4
+ // skills, a registered tool schema reaches the model on every request, so
5
+ // there is no trigger gamble. The name is ours rather than the host's
6
+ // `read_image` (see the registration in apply, and issue #34).
7
+ // The engine is spawned from ../dist/main.js inside this package:
6
8
  // no PATH lookup, no npx, the plugin and its engine version-lock together.
7
9
  //
8
10
  // Loaded via the cordis.patch.yml row `@liustack/modlens/dsh` (see the
@@ -66,13 +68,11 @@ export function apply(ctx, config = {}) {
66
68
  // of @deepseek-ai/dsh-tools is not yet reliable), so this plugin owns its
67
69
  // own argument validation inside execute.
68
70
  //
69
- // The name can collide: hosts with a durable attachment store mount their
70
- // own native read_image (dsh-tool-fs), and a duplicate registration throws,
71
- // which used to fail the whole plugin fiber (issue #21). The collision
72
- // falls back to a prefixed name — valuable exactly there, since the native
73
- // tool is gated on the model declaring image input and vanishes for
74
- // text-only models — and any other registration error degrades loudly
75
- // instead of taking the vision wrapper down with it.
71
+ // The name is ours by default (see the registration below): hosts with a
72
+ // durable attachment store mount their own native read_image (dsh-tool-fs),
73
+ // which is gated on the model declaring image input and so refuses the
74
+ // text-only models this plugin exists for. Any registration error degrades
75
+ // loudly instead of taking the vision wrapper down with it (issue #21).
76
76
  const readImageTool = (toolName) => ({
77
77
  name: toolName,
78
78
  description:
@@ -100,7 +100,7 @@ export function apply(ctx, config = {}) {
100
100
  isConcurrencySafe: () => true,
101
101
  presentCall: (args) => ({
102
102
  card: 'generic',
103
- title: 'read_image',
103
+ title: toolName,
104
104
  kind: 'read',
105
105
  rawInput: args,
106
106
  ...(typeof args?.path === 'string' && !/^https?:\/\//i.test(args.path)
@@ -109,7 +109,7 @@ export function apply(ctx, config = {}) {
109
109
  }),
110
110
  async execute(args, exec) {
111
111
  if (typeof args?.path !== 'string' || args.path.trim() === '') {
112
- throw new Error('read_image needs a non-empty string "path".')
112
+ throw new Error(`${toolName} needs a non-empty string "path".`)
113
113
  }
114
114
  const cliArgs = [CLI_PATH, '-i', args.path, '--timeout', String(CLI_TIMEOUT_MS)]
115
115
  if (args.prompt) {
@@ -130,21 +130,24 @@ export function apply(ctx, config = {}) {
130
130
  return parsed.result
131
131
  },
132
132
  })
133
- const preferred = config.toolName || 'read_image'
133
+ // A name of our own rather than the host's. dsh's registry is layered and
134
+ // a scoped tool shadows a global one, so a host `read_image` mounted in the
135
+ // agent-preset scope and ours registered globally are not a duplicate at
136
+ // all: the registration succeeds, nothing throws, and the model still
137
+ // resolves the host's (issue #34). Detecting that from here would mean
138
+ // walking every agent (`agents.list()` plus `agent/created`) and asking
139
+ // `tools.get(name, agent)` per scope, then mutating a global catalog per
140
+ // agent. Not entering the collision is cheaper: no host tool is known to
141
+ // use this name, and the model finds ours through its schema, which reaches
142
+ // it on every request regardless of what the tool is called. `toolName`
143
+ // still pins whatever a host prefers.
144
+ const preferred = config.toolName || 'modlens_read_image'
134
145
  try {
135
146
  ctx.tools.register(readImageTool(preferred))
136
147
  } catch (error) {
137
- const fallback = 'modlens_read_image'
138
- if (preferred !== fallback && /already|duplicate/i.test(String(error))) {
139
- try {
140
- ctx.tools.register(readImageTool(fallback))
141
- console.error(`[modlens] tool name "${preferred}" is taken by the host; registered as "${fallback}" instead`)
142
- } catch (retryError) {
143
- console.error(`[modlens] read_image registration skipped: ${retryError}`)
144
- }
145
- } else {
146
- console.error(`[modlens] read_image registration skipped: ${error}`)
147
- }
148
+ // Same-layer duplicate of the chosen name, or a preview-era surface
149
+ // change: degrade loudly instead of taking the whole plugin down.
150
+ console.error(`[modlens] ${preferred} registration skipped: ${error}`)
148
151
  }
149
152
  }
150
153
 
@@ -381,7 +384,7 @@ function registerPasteRoute(ctx, host) {
381
384
  * turns the image into evidence text before the delegated request goes out;
382
385
  * the upstream serializer's own image rejection stays as the fail-closed
383
386
  * backstop. Guarded feature-detection: if the llm registration surface moved
384
- * (developer preview), the plugin quietly stays a read_image-only tool.
387
+ * (developer preview), the plugin quietly stays a read-only-tool plugin.
385
388
  *
386
389
  * Two modes (issue #29, design contributed by @zlycode01):
387
390
  * - `config.upstream` set: wrap exactly that one route, legacy behavior.
@@ -469,7 +472,7 @@ function registerVisionProvider(ctx, config) {
469
472
  console.error(`[modlens] vision provider ${providerId} already registered, keeping the existing one`)
470
473
  return true
471
474
  }
472
- // A preview-era surface change: degrade to the read_image-only plugin,
475
+ // A preview-era surface change: degrade to the tool-only plugin,
473
476
  // but say so in the harness log instead of vanishing (a swallowed
474
477
  // TypeError here once hid a missing base method).
475
478
  console.error(`[modlens] vision provider registration skipped (${providerId}): ${error}`)
@@ -1 +1 @@
1
- {"type":"object","properties":{"summary":{"type":"string"},"ocr":{"type":"object","properties":{"full_text":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"language":{"type":"string"}},"required":["text"]}}},"required":["full_text","lines"]},"layout":{"type":"object","properties":{"regions":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["title","subtitle","paragraph","list","table","chart","form","code","image","icon","other"]},"reading_order":{"type":"number"},"text":{"type":"string"}},"required":["type","reading_order","text"]}}},"required":["regions"]},"semantics":{"type":"object","properties":{"scene":{"type":"string"},"intent":{"type":"string"},"entities":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"},"evidence":{"type":"string"}},"required":["name","type"]}},"relations":{"type":"array","items":{"type":"object","properties":{"subject":{"type":"string"},"predicate":{"type":"string"},"object":{"type":"string"}},"required":["subject","predicate","object"]}}},"required":["scene","entities"]},"visual":{"type":"object","properties":{"dominant_colors":{"type":"array","items":{"type":"string"}},"style":{"type":"string"},"notes":{"type":"array","items":{"type":"string"}}}},"uncertainty":{"type":"array","items":{"type":"string"}}},"required":["summary","ocr","layout","semantics","visual","uncertainty"]}
1
+ {"type":"object","properties":{"summary":{"type":"string"},"ocr":{"type":"object","properties":{"full_text":{"type":"string"},"lines":{"type":"array","items":{"type":"object","properties":{"text":{"type":"string"},"language":{"type":"string"}},"required":["text"]}}},"required":["full_text","lines"]},"layout":{"type":"object","properties":{"regions":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","description":"A short kind for this region. Prefer a common one where it fits: title, heading, paragraph, list, table, chart, form, code, image, icon, link, nav, button, search. Any other short label is fine when none of those describe it."},"reading_order":{"type":"number"},"text":{"type":"string"}},"required":["type","reading_order","text"]}}},"required":["regions"]},"semantics":{"type":"object","properties":{"scene":{"type":"string"},"intent":{"type":"string"},"entities":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"type":{"type":"string"},"evidence":{"type":"string"}},"required":["name","type"]}},"relations":{"type":"array","items":{"type":"object","properties":{"subject":{"type":"string"},"predicate":{"type":"string"},"object":{"type":"string"}},"required":["subject","predicate","object"]}}},"required":["scene","entities"]},"visual":{"type":"object","properties":{"dominant_colors":{"type":"array","items":{"type":"string"}},"style":{"type":"string"},"notes":{"type":"array","items":{"type":"string"}}}},"uncertainty":{"type":"array","items":{"type":"string"}}},"required":["summary","ocr","layout","semantics","visual","uncertainty"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liustack/modlens",
3
- "version": "3.16.2",
3
+ "version": "3.16.4",
4
4
  "description": "Plug-in vision for text-only LLMs, powered by the free Antigravity CLI",
5
5
  "type": "module",
6
6
  "bin": {
@@ -20,11 +20,11 @@ powershell -ExecutionPolicy Bypass -File <skill-dir>\scripts\run.ps1 <args>
20
20
 
21
21
  It resolves a working runtime (PATH `modlens`, then `npx`, then `bunx`) and forwards your arguments unchanged. Exit 78 means no runtime: relay the `nextSteps` from its stderr JSON instead of retrying.
22
22
 
23
- If your harness forbids running scripts, reason through the same order by hand and run the first line that works (the pinned version is 3.16.2):
23
+ If your harness forbids running scripts, reason through the same order by hand and run the first line that works (the pinned version is 3.16.4):
24
24
 
25
- 1. A `modlens` on `PATH` whose major version is 3 and is at least 3.16.2: `modlens <args>`.
26
- 2. Otherwise, if `npx` exists: `npx --yes --package @liustack/modlens@3.16.2 modlens <args>`.
27
- 3. Otherwise, if `bunx` exists: `bunx --bun @liustack/modlens@3.16.2 <args>`.
25
+ 1. A `modlens` on `PATH` whose major version is 3 and is at least 3.16.4: `modlens <args>`.
26
+ 2. Otherwise, if `npx` exists: `npx --yes --package @liustack/modlens@3.16.4 modlens <args>`.
27
+ 3. Otherwise, if `bunx` exists: `bunx --bun @liustack/modlens@3.16.4 <args>`.
28
28
  4. Otherwise tell the user no JavaScript runtime was found and that installing Node 22.19+ (https://nodejs.org) or Bun (https://bun.sh) is the next step. Do not claim modlens itself failed.
29
29
 
30
30
  `references/runtime.md` documents the pin and the diagnostic fields.
@@ -8,7 +8,7 @@ shell syntax.
8
8
 
9
9
  ## Pinned version
10
10
 
11
- - Pinned CLI version: 3.16.2
11
+ - Pinned CLI version: 3.16.4
12
12
  - npm package: `@liustack/modlens`
13
13
  - CLI binary name: `modlens`
14
14
 
@@ -24,7 +24,7 @@ $ErrorActionPreference = 'Stop'
24
24
  # package.json version, and the release script rewrites it on every bump.
25
25
  $Package = '@liustack/modlens'
26
26
  $Bin = 'modlens'
27
- $Pinned = '3.16.2'
27
+ $Pinned = '3.16.4'
28
28
  # -------------------------------------------------------------------------------
29
29
 
30
30
  $NativeNote = 'no native artifact is published for this tool yet; phase A ships npm launch paths only'
@@ -22,7 +22,7 @@ set -eu
22
22
  # package.json version, and the release script rewrites it on every bump.
23
23
  PKG="@liustack/modlens"
24
24
  BIN="modlens"
25
- PINNED="3.16.2"
25
+ PINNED="3.16.4"
26
26
  # -------------------------------------------------------------------------------
27
27
 
28
28
  NATIVE_NOTE="no native artifact is published for this tool yet; phase A ships npm launch paths only"