dsh-vision-router 1.6.1 → 1.6.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/README.md +3 -3
- package/README.zh.md +2 -2
- package/entry.js +32 -1
- package/index.js +309 -135
- package/lib/adapter-update-coalescer.js +74 -0
- package/lib/client.js +417 -296
- package/lib/depth-guidance.js +18 -12
- package/lib/image-resource-governor.js +215 -0
- package/lib/pixel-diff-stream.js +143 -0
- package/lib/session-vision-state.js +400 -0
- package/lib/structured-bootstrap.js +23 -15
- package/lib/structured-flow-hardening.js +388 -0
- package/lib/tesseract-exec-compat.js +146 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
<p align="center">💬 <strong>QQ community group: 1105463028</strong></p>
|
|
30
30
|
|
|
31
31
|
> [!WARNING]
|
|
32
|
-
> 📌 **Announcement (v1.6.
|
|
32
|
+
> 📌 **Announcement (v1.6.2)**
|
|
33
33
|
>
|
|
34
|
-
> **v1.6.
|
|
34
|
+
> **v1.6.2:** Stability release — fixes onboarding, OCR, model synchronization and large-image handling, improving long-session and overall runtime reliability.
|
|
35
35
|
|
|
36
36
|
<p align="center">
|
|
37
37
|
<img src="assets/vision-demo.gif" width="640" alt="Demo: paste an image, the agent locates the send button with vision_ground / vision_crop / vision_pixel_diff and answers with coordinates" />
|
|
@@ -154,7 +154,7 @@ The auto-vision group follows the live DSH model catalog. Adding models or chang
|
|
|
154
154
|
|
|
155
155
|
### 3. Paste or upload the image
|
|
156
156
|
|
|
157
|
-
After choosing the “+ Auto Vision” group, paste or upload an image normally. By default the complete vision tool schema is stable from session start, so the agent can immediately use `vision_describe`, `vision_ground`, `vision_crop`, and the rest across multiple steps when needed.
|
|
157
|
+
After choosing the “+ Auto Vision” model group, paste or upload an image normally. By default the complete vision tool schema is stable from session start, so the agent can immediately use `vision_describe`, `vision_ground`, `vision_crop`, and the rest across multiple steps when needed.
|
|
158
158
|
|
|
159
159
|
The built-in anonymous OVH vision fallback is already configured, so normal image use needs no signup or API key. **The lower-right chat picker selects only the brain/conversation model**; vision backends do not belong there. Advanced options live under **Settings → Plugins → Plugin config → 视觉路由(自动识图)**: each vision-backend row may select any callable generative user model already configured under **Settings → Models**. DSH image-capability metadata is advisory only: undeclared or text-only-labelled models remain selectable and show a warning. At runtime Vision Router always tries the provider's registered DSH adapter first — including WebSocket, RPC and private transports — and falls through on a real failure. The direct compatibility bridge is used only when an http(s) OpenAI Chat Completions endpoint is positively identified. Leaving every user row empty is valid; the OVH chain remains the final fallback. `Vision HTTP` is an internal transport route, not a model group users should select.
|
|
160
160
|
|
package/README.zh.md
CHANGED
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
<p align="center">💬 <strong>QQ 用户交流群:1105463028</strong></p>
|
|
30
30
|
|
|
31
31
|
> [!WARNING]
|
|
32
|
-
> 📌 **公告(v1.6.
|
|
32
|
+
> 📌 **公告(v1.6.2)**
|
|
33
33
|
>
|
|
34
|
-
> **v1.6.
|
|
34
|
+
> **v1.6.2:集中修复引导、OCR、模型同步与大图处理问题,提升长会话和整体运行稳定性。**
|
|
35
35
|
|
|
36
36
|
<p align="center">
|
|
37
37
|
<img src="assets/vision-demo.gif" width="640" alt="演示:粘贴图片,Agent 用 vision_ground / vision_crop / vision_pixel_diff 定位发送按钮并给出坐标" />
|
package/entry.js
CHANGED
|
@@ -14,6 +14,12 @@ import { installAdversarialHardening } from './lib/adversarial-hardening.js'
|
|
|
14
14
|
import { installLocalVisionStabilizer } from './lib/local-vision-stabilizer.js'
|
|
15
15
|
import { installWrapperDirectoryAlias } from './lib/wrapper-directory.js'
|
|
16
16
|
import { installAndroidAttachmentCompat } from './lib/android-attachment-compat.js'
|
|
17
|
+
import { contextWithCoalescedAdapterUpdates } from './lib/adapter-update-coalescer.js'
|
|
18
|
+
import { installTesseractExecFileCompat } from './lib/tesseract-exec-compat.js'
|
|
19
|
+
import {
|
|
20
|
+
installStructuredFlowHardening,
|
|
21
|
+
normalizeGuidanceOverrides,
|
|
22
|
+
} from './lib/structured-flow-hardening.js'
|
|
17
23
|
import {
|
|
18
24
|
attachmentContextForContract,
|
|
19
25
|
installRc7SettingsCompatibility,
|
|
@@ -26,6 +32,10 @@ import {
|
|
|
26
32
|
// for the settings namespace, so composition config and settings validation
|
|
27
33
|
// agree on the same default.
|
|
28
34
|
core.Config.set('progressiveTools', z.boolean().default(false))
|
|
35
|
+
// Structured 1+x now also has a turn-level wall-clock budget. Individual
|
|
36
|
+
// visionTaskTimeoutMs budgets remain unchanged; this one prevents a deep turn
|
|
37
|
+
// from multiplying them into several minutes of serial waiting.
|
|
38
|
+
core.Config.set('visionTurnBudgetMs', z.number().step(1000).min(10000).max(600000).default(90000))
|
|
29
39
|
|
|
30
40
|
export * from './index.js'
|
|
31
41
|
export {
|
|
@@ -73,6 +83,11 @@ export function apply(ctx, config = {}) {
|
|
|
73
83
|
const runtimeConfig = {
|
|
74
84
|
...bootConfig,
|
|
75
85
|
progressiveTools: hardenedConfig.progressiveTools === true,
|
|
86
|
+
guidanceOverrides: normalizeGuidanceOverrides(bootConfig.guidanceOverrides ?? hardenedConfig.guidanceOverrides),
|
|
87
|
+
visionTurnBudgetMs:
|
|
88
|
+
Number.isFinite(Number(bootConfig.visionTurnBudgetMs))
|
|
89
|
+
? Number(bootConfig.visionTurnBudgetMs)
|
|
90
|
+
: 90000,
|
|
76
91
|
}
|
|
77
92
|
const rc7 = isRc7ContractRuntime(stabilizedCtx)
|
|
78
93
|
const ownershipCtx = rc7 ? protectRc7ProviderOwnership(stabilizedCtx) : stabilizedCtx
|
|
@@ -89,6 +104,22 @@ export function apply(ctx, config = {}) {
|
|
|
89
104
|
const attachmentCompatCtx = attachmentContextForContract(settingsCtx, logging.logger, {
|
|
90
105
|
installAndroidAttachmentCompat,
|
|
91
106
|
})
|
|
107
|
+
// Final structured-flow guard sits closest to core.apply so it sees the
|
|
108
|
+
// actual tool registrations and pre-step listener. It makes bootstrap
|
|
109
|
+
// one-shot, enforces fast/standard/deep quotas, tracks mixed branches,
|
|
110
|
+
// rejects empty/non-evidence results, and applies one shared turn deadline.
|
|
111
|
+
const structuredCtx = installStructuredFlowHardening(attachmentCompatCtx, runtimeConfig)
|
|
112
|
+
// DSH rc.7 publishes llm/adapters-updated synchronously from inside
|
|
113
|
+
// registerAdapter(). Coalesce only Vision Router's listener: nested events
|
|
114
|
+
// mark the topology dirty and the outer pass reruns to a fixed point, so we
|
|
115
|
+
// neither double-register a twin nor lose a provider added mid-pass.
|
|
116
|
+
const reconciledCtx = contextWithCoalescedAdapterUpdates(structuredCtx)
|
|
117
|
+
// index.js historically passes image bytes as `options.input` to the async
|
|
118
|
+
// execFile API. That option is not fed into child stdin, so Tesseract waits
|
|
119
|
+
// for data until the OCR slice expires. Materialize only this exact
|
|
120
|
+
// Tesseract-stdin call to a temporary image file; all other execFile calls
|
|
121
|
+
// keep their native behavior.
|
|
122
|
+
installTesseractExecFileCompat(reconciledCtx)
|
|
92
123
|
|
|
93
124
|
// 启动诊断摘要只描述 composition/apply 的基础配置。设置服务可能稍后
|
|
94
125
|
// 覆盖这些值;每个图片轮还会记录 current() 的实时决策,避免把这个
|
|
@@ -109,7 +140,7 @@ export function apply(ctx, config = {}) {
|
|
|
109
140
|
/* diagnostics must never break apply */
|
|
110
141
|
}
|
|
111
142
|
try {
|
|
112
|
-
const result = core.apply(
|
|
143
|
+
const result = core.apply(reconciledCtx, runtimeConfig)
|
|
113
144
|
// DSH rc.7's Settings -> Models surface is backed by the configurable
|
|
114
145
|
// provider directory, not by the live adapter registry alone. Publish the
|
|
115
146
|
// main DeepSeek + 自动识图 route as a derived alias of official DeepSeek so
|