@yanglaofish/dsh-proxy-pro 2.0.2 → 2.0.3

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 CHANGED
@@ -13,6 +13,8 @@
13
13
 
14
14
  > 全部踩坑与设计决策见 [`docs/LESSONS.md`](docs/LESSONS.md)(必读),规格与验收清单见 [`docs/SPEC.md`](docs/SPEC.md)。
15
15
 
16
+ `2.0.3` 修复新版 DSH 严格输出校验下 `proxy_test` 无法返回结果的问题:补齐代理与直连徽标的 Schema 声明,保留原有诊断和严格字段检查。
17
+
16
18
  ## 安装
17
19
 
18
20
  两种方式任选其一(npm 包已发布,拉取即用、免构建授权):
@@ -1,5 +1,15 @@
1
1
  # dsh-proxy-pro v0.1 验收清单(自验版)
2
2
 
3
+ ## 2.0.3 严格输出 Schema 补丁(2026-10-22)
4
+
5
+ - 对应 [issue #2](https://github.com/yanglaofish/dsh-proxy-pro/issues/2):`proxy_test` 实际返回的 `proxyBadge`、`directBadge` 漏声明,导致新版 DSH 拒绝整个工具结果。
6
+ - 输出 Schema 补齐两个徽标,内含必填 `text` 和 `tone`(`ok` / `warn` / `bad`);徽标本身可省略,以兼容无效 URL 的提前返回。保留 `additionalProperties: false`。
7
+ - 新增实际工具执行与真实 DSH 校验器的合同回归,覆盖四个工具、双通道成功、单通道失败、407 认证、403/404、网关及 DNS 故障、代理关闭、无效 URL;同时验证未知字段、非法颜色和缺失徽标文本仍被拒绝。
8
+ - 本地先复现相同的未声明属性错误,再修复;使用 `@deepseek-ai/dsh-tools@0.2.1-rc.2`,完整测试 76 项通过、0 失败、0 跳过。测试传输使用隔离替身,不将此记录描述为公网或桌面人工验收。
9
+ - 自基线 `663e5c1` 的独立规范与需求审查分别为 0 项遗留问题;语法、差异空白检查及 npm 归档中的徽标声明检查通过。
10
+ - 发布流程安装隔离的固定版测试运行时,执行同一严格校验后才发布。开发者可先执行 `npm install --prefix .test-runtime --no-save --package-lock=false --ignore-scripts @deepseek-ai/dsh-tools@0.2.1-rc.2 --registry=https://registry.npmjs.org`,再执行 `npm test`。未安装时真实编译/输出校验会明确标为跳过。
11
+ - npm 与镜像的实际发布结果在确认后补充;此条测试记录不代表包已公开。
12
+
3
13
  > 用途:重启 DSH 后逐项自验插件是否生效。每项给出「看哪里」与「预期结果」;
4
14
  > 标 🔵 的项需要会话内的模型(我)代跑,标 👁 的项你自己在界面上看。
5
15
  > 全部通过 = FR-1..FR-9(SPEC §7 A1-A11)达成,可以进入「接管旧插件 → 发布」。
@@ -58,4 +68,4 @@ dsh-plugin-proxy)→ 重启 → 复测 A1-A6。回滚 = 删该行,settings.y
58
68
 
59
69
  ---
60
70
 
61
- _维护:本清单与 SPEC §7 验收清单一一对应;观察通道约定见 SPEC §7 附录。_
71
+ _维护:本清单与 SPEC §7 验收清单一一对应;观察通道约定见 SPEC §7 附录。_
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * dsh-proxy-pro — tool schema specs (pure data, no imports).
3
3
  *
4
- * These are the author-facing dsh-tools value-schema specs for the three agent
4
+ * These are the author-facing dsh-tools value-schema specs for the four agent
5
5
  * tools. They live in their own module for ONE reason: `test/tool-schema.test.mjs`
6
6
  * compiles them with the real `@deepseek-ai/dsh-tools` compiler before the app
7
7
  * ever boots, so a schema-DSL violation can no longer surface only as a
@@ -72,6 +72,16 @@ const PROBE_RESULT_SCHEMA = {
72
72
  },
73
73
  }
74
74
 
75
+ // 通道徽标由双通道诊断产生;无效 URL 提前返回时可省略整个徽标。
76
+ const PROBE_BADGE_SCHEMA = {
77
+ type: 'object',
78
+ additionalProperties: false,
79
+ properties: {
80
+ text: { type: 'string', required: true },
81
+ tone: { type: 'string', enum: ['ok', 'warn', 'bad'], required: true },
82
+ },
83
+ }
84
+
75
85
  /** Output schema of `proxy_test`. Dual-channel: forces both legs in parallel
76
86
  * (走代理 / 直连), then combines them into one human verdict + recommendation
77
87
  * (2026-09-18: single-side probes cannot tell WHO answered, so a strategy
@@ -90,6 +100,8 @@ export const PROXY_TEST_SCHEMA = {
90
100
  short: { type: 'string', required: true },
91
101
  why: { type: 'string', required: true },
92
102
  fix: { type: 'string', required: true },
103
+ proxyBadge: PROBE_BADGE_SCHEMA,
104
+ directBadge: PROBE_BADGE_SCHEMA,
93
105
  hint: { type: 'string' },
94
106
  },
95
107
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yanglaofish/dsh-proxy-pro",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "description": "DSH proxy manager: route model requests, web fetches and spawned tools through the Windows system proxy or a custom address; per-URL route diagnosis, one-click toggle from the conversation header, a dedicated Settings page, and keepalive-aware 407 hints.",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",