@oadank/dsh-input-tools 0.3.14 → 0.3.15

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
@@ -69,6 +69,7 @@ powershell -ExecutionPolicy Bypass -File scripts\setup-profile.ps1
69
69
  # Linux/macOS:
70
70
  bash scripts/setup-profile.sh
71
71
  pnpm install
72
+ pnpm run build:lib # ⚠️ 必须!全新 clone 无编译产物,跳过会报 Failed to resolve @deepseek-ai/dsh-client-web
72
73
  pnpm run build:web
73
74
  dsh --profile web
74
75
  ```
@@ -103,7 +104,7 @@ cd deepseek-harness
103
104
  git checkout 141eb6fef8 # 官方 dsh-0.1.0-rc.8 基线
104
105
  # 打补丁(脚本自动探测/输入源码位置):
105
106
  powershell -ExecutionPolicy Bypass -File <插件目录>\patches\apply-voice-patch.ps1
106
- pnpm install && pnpm run build:web && dsh --profile web
107
+ pnpm install && pnpm run build:lib && pnpm run build:web && dsh --profile web
107
108
  ```
108
109
 
109
110
  ### 方案 B:直接用整合版 fork(推荐)
@@ -112,7 +113,7 @@ pnpm install && pnpm run build:web && dsh --profile web
112
113
  git clone https://github.com/oadank/deepseek-harness.git
113
114
  cd deepseek-harness
114
115
  powershell -ExecutionPolicy Bypass -File scripts\setup-profile.ps1
115
- pnpm install && pnpm run build:web && dsh --profile web
116
+ pnpm install && pnpm run build:lib && pnpm run build:web && dsh --profile web
116
117
  ```
117
118
 
118
119
  > 补丁基线官方 rc.8(141eb6fef8),官方后续更新可能不兼容,请先 checkout 该基线再打。回滚:`git apply -R`。
package/lib/client.js CHANGED
@@ -586,6 +586,12 @@ window.__ModuleLoader__.load({
586
586
  const [vdSamples, setVdSamples] = useState([]); // VoiceDesign 官方示例音频(预生成)
587
587
  // [2026-08-21] 试听失败的错误提示(之前失败静默无反馈)
588
588
  const [previewErr, setPreviewErr] = useState(null);
589
+ // [2026-08-22] 试听失败浮动 Toast(fixed 顶部居中,醒目弹窗式,6 秒自动消失)
590
+ useEffect(() => {
591
+ if (previewErr === null) return;
592
+ const t = window.setTimeout(() => setPreviewErr(null), 6000);
593
+ return () => window.clearTimeout(t);
594
+ }, [previewErr]);
589
595
  // [2026-08-21] API Key 明文/密文切换(眼睛图标)
590
596
  const [showKeys, setShowKeys] = useState({});
591
597
  // [2026-08-21] 本地 TTS 一键安装命令
@@ -727,8 +733,18 @@ window.__ModuleLoader__.load({
727
733
  const audio = new Audio("data:" + d.mediaType + ";base64," + d.data);
728
734
  previewRef.current = audio;
729
735
  audio.onended = () => { if (previewTagRef.current === curTag) setPreviewing(null); };
730
- audio.onerror = () => { if (previewTagRef.current === curTag) setPreviewing(null); };
731
- audio.play().catch(() => { if (previewTagRef.current === curTag) setPreviewing(null); });
736
+ audio.onerror = () => {
737
+ if (previewTagRef.current === curTag) {
738
+ setPreviewing(null);
739
+ setPreviewErr("音频加载/播放失败(服务可能返回了无效音频)");
740
+ }
741
+ };
742
+ audio.play().catch(() => {
743
+ if (previewTagRef.current === curTag) {
744
+ setPreviewing(null);
745
+ setPreviewErr("音频加载/播放失败(服务可能返回了无效音频)");
746
+ }
747
+ });
732
748
  })
733
749
  .catch((e) => { if (previewTagRef.current === curTag) setPreviewing(null); setPreviewErr(String(e?.message ?? e)); });
734
750
  };
@@ -893,9 +909,16 @@ window.__ModuleLoader__.load({
893
909
  // 分区标题(语音图标已移到各服务商卡片前)
894
910
  h("div", { style: { display: "flex", alignItems: "center", gap: "8px", fontSize: "15px", fontWeight: 700, color: "var(--dsw-alias-label-primary,#e6e9ef)" } },
895
911
  "语音服务"),
896
- // [2026-08-21] 试听失败错误横幅(原来静默无提示)
897
- previewErr !== null ? h("div", { style: { fontSize: "12.5px", lineHeight: "1.6", color: "#e5484d", border: "1px solid rgba(229,72,77,.4)", borderRadius: "8px", padding: "8px 10px", background: "rgba(229,72,77,.08)", whiteSpace: "pre-wrap" } },
898
- "试听失败:" + previewErr) : null,
912
+ // [2026-08-21] 试听失败错误提示;[2026-08-22] 改为 fixed 顶部弹窗 Toast(醒目,6s 自动消失)
913
+ previewErr !== null ? h("div", {
914
+ style: {
915
+ position: "fixed", top: "24px", left: "50%", transform: "translateX(-50%)", zIndex: 9999,
916
+ background: "rgba(229,72,77,.95)", color: "#fff", borderRadius: "10px",
917
+ padding: "10px 18px", fontSize: "13px", lineHeight: "1.5",
918
+ boxShadow: "0 6px 24px rgba(0,0,0,.45)", maxWidth: "440px", whiteSpace: "pre-wrap",
919
+ pointerEvents: "none",
920
+ },
921
+ }, "试听失败:" + previewErr) : null,
899
922
  // [2026-08-21] 语音能力状态面板(安装即用 vs dsh 原生契约支持)
900
923
  caps !== null ? h("div", { style: { border: "1px solid var(--dsw-alias-border-l1,#333a45)", borderRadius: "10px", padding: "10px 12px", display: "flex", flexDirection: "column", gap: "6px", background: "rgba(128,128,128,.05)", fontSize: "12.5px", lineHeight: "1.5" } },
901
924
  h("div", { style: { fontSize: "12px", fontWeight: 600, opacity: .8 } }, "语音能力"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oadank/dsh-input-tools",
3
- "version": "0.3.14",
3
+ "version": "0.3.15",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "lib/index.js",