dsh-plugin-tether 0.1.16 → 0.1.17

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/index.js +12 -2
  3. package/package.json +7 -7
package/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  本文件记录面向用户的变化。每个版本的这一节会原样作为该版本 Release 的说明。
4
4
 
5
+ ## 0.1.17
6
+
7
+ ### 修复
8
+
9
+ - **sidecar 自己的 `--help` 还是中文**([#8](https://github.com/zexadev/dsh-tether/issues/8))。0.1.16 把界面和终端输出都做了英文,唯独 `tether-host --help` 和每个参数的说明漏了,手跑二进制的人只能对着中文猜参数。现在帮助文本也按语言出中英。
10
+ - **Windows 和 macOS 上手跑 sidecar 恒出中文**。判定语言只认 `LC_ALL`/`LANG`,而这两个系统本来就不设这两个变量,英文用户于是必得中文。现在环境变量没有就问系统语言。
11
+ - **配对失败的原因在手机上显示成中文**。原因是电脑侧直接把中文句子发给了手机——这句该由看到它的那一端来措辞。线上改成只传原因码,手机 App 和 dsh 界面各按自己那侧的语言显示。另有几处写死的中文一并补齐(phone-sim 的代理就绪、本地代理监听失败、前台服务日志、移除设备失败)。
12
+
13
+ ### English
14
+
15
+ This release finishes what 0.1.16 started: `tether-host --help` and all option descriptions are now English on an English machine, the language is detected from the system when `LC_ALL`/`LANG` are unset (which is the normal case on Windows and macOS), and a failed pairing is now worded by whichever side displays it, so the phone no longer shows a Chinese reason. Nothing a user can see is Chinese-only any more; if you find something, please open an issue.
16
+
5
17
  ## 0.1.16
6
18
 
7
19
  ### 新增
package/index.js CHANGED
@@ -26,6 +26,16 @@ const terminalZh = /^zh/i.test(
26
26
  )
27
27
  /** 终端文案 */
28
28
  const tt = (zh, en) => (terminalZh ? zh : en)
29
+ /**
30
+ * sidecar 发的是配对失败原因码(tether-core 定义),不是人话——同一条消息手机上也要显示,
31
+ * 只能各端各译。认不出的原样带出:0.1.16 及更早的 sidecar 直接发中文句子。
32
+ */
33
+ const pairFailText = (code) => ({
34
+ 'no-window': tt('主机上没有开着的配对窗口', 'no pairing window is open'),
35
+ expired: tt('配对窗口已过期', 'the pairing window expired'),
36
+ 'too-many-attempts': tt('配对码试错次数超限', 'too many wrong codes'),
37
+ 'bad-code': tt('配对码不正确', 'wrong pairing code'),
38
+ }[code] ?? code)
29
39
  /** 路由文案 */
30
40
  const tr = (req, zh, en) => {
31
41
  const declared = req.headers['x-dsh-tether-lang'] || req.headers['accept-language'] || ''
@@ -215,7 +225,7 @@ function apply(ctx, config = {}) {
215
225
  break
216
226
  }
217
227
  case 'pairing-closed':
218
- console.log(`[tether] ${tt('配对窗口已关闭: ', 'the pairing window closed: ')}${msg.reason}`)
228
+ console.log(`[tether] ${tt('配对窗口已关闭: ', 'the pairing window closed: ')}${pairFailText(msg.reason)}`)
219
229
  break
220
230
  case 'pairing-done':
221
231
  console.log(`[tether] ${tt('配对成功: ', 'paired: ')}${msg.name}(${msg.peer.slice(0, 16)}…)`)
@@ -660,7 +670,7 @@ function injectNarrowScreenCss(html) {
660
670
  .catch(function (e) {
661
671
  drop.disabled = false
662
672
  drop.textContent = tx('移除失败', 'Removal failed')
663
- console.error('[dsh-tether] 移除设备失败', e)
673
+ console.error('[dsh-tether] ' + tx('移除设备失败', 'could not remove the device'), e)
664
674
  })
665
675
  })
666
676
  row.append(dot, label, drop)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-tether",
3
- "version": "0.1.16",
3
+ "version": "0.1.17",
4
4
  "description": "Mobile client for the DeepSeek Harness — use the dsh on your dev machine from your Android or iOS phone, remotely across networks, peer-to-peer over iroh with no server to set up (falls back to a relay that only sees ciphertext)",
5
5
  "keywords": [
6
6
  "dsh",
@@ -54,11 +54,11 @@
54
54
  "@deepseek-ai/dsh-user-approval": { "optional": true }
55
55
  },
56
56
  "optionalDependencies": {
57
- "dsh-tether-host-android-arm64": "0.1.16",
58
- "dsh-tether-host-darwin-arm64": "0.1.16",
59
- "dsh-tether-host-darwin-x64": "0.1.16",
60
- "dsh-tether-host-linux-arm64": "0.1.16",
61
- "dsh-tether-host-linux-x64": "0.1.16",
62
- "dsh-tether-host-win32-x64": "0.1.16"
57
+ "dsh-tether-host-android-arm64": "0.1.17",
58
+ "dsh-tether-host-darwin-arm64": "0.1.17",
59
+ "dsh-tether-host-darwin-x64": "0.1.17",
60
+ "dsh-tether-host-linux-arm64": "0.1.17",
61
+ "dsh-tether-host-linux-x64": "0.1.17",
62
+ "dsh-tether-host-win32-x64": "0.1.17"
63
63
  }
64
64
  }