@infinity_cheng/dsh-prompt-editor 0.2.0 → 0.2.1

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
@@ -38,6 +38,12 @@ dsh plugin --profile web add @infinity_cheng/dsh-prompt-editor
38
38
  dsh web
39
39
  ```
40
40
 
41
+ ### 升级后必须重启 Host
42
+
43
+ Client 可以热更新,但 Host 的 JavaScript 模块换代必须**完全退出并重新打开** DeepSeek Harness。
44
+
45
+ 如果按钮能打开预览、但提交时提示 `HTTP 404` 或「Host 路由未加载」,说明 Client 已经是新版本、Host 还是旧模块。`Cmd+Q` 退出后重新打开即可;只关窗口不算。
46
+
41
47
  ## 输入框按钮(Phase 1)
42
48
 
43
49
  1. 在输入框里输入草稿,或选中其中一段。
@@ -208,6 +214,11 @@ Safari 验证结果。
208
214
  - Host + Client 两半;Client 是 lazy-CJS bundle,无独立构建步骤
209
215
  - Client 槽位:`conversation.input.right`、`settings.section`
210
216
 
217
+ ### 0.2.1 修复
218
+
219
+ - 404 不再只显示 `HTTP 404`,而是提示“Host 路由未加载,请完全退出并重新打开”。
220
+ - README 增加升级/404 排查说明。
221
+
211
222
  ### 0.2.0 Phase 1 验证
212
223
 
213
224
  - 在 DSH `0.2.2-rc.5` 的隔离 profile 中加载真实 Web UI:按钮出现在输入框右侧,空草稿禁用,输入后启用。
package/client.js CHANGED
@@ -49,6 +49,7 @@ window.__ModuleLoader__.load({
49
49
  'dialog.unchangedShort': '无需修改',
50
50
  'dialog.loading': '正在改写…',
51
51
  'dialog.failed': '未生成结果',
52
+ 'dialog.hostMissing': 'Host 路由未加载(HTTP 404)。请完全退出并重新打开 DeepSeek Harness,让 Host 加载 0.2.x。',
52
53
  'dialog.error': '改写失败:{message}',
53
54
  'dialog.stale': '草稿已变化,请重新打开。',
54
55
  'dialog.warnings': '校验提示',
@@ -412,10 +413,12 @@ window.__ModuleLoader__.load({
412
413
  signal: controller.signal,
413
414
  })
414
415
  if (!response.ok) {
415
- let message = `HTTP ${response.status}`
416
+ let message = response.status === 404
417
+ ? text('dialog.hostMissing')
418
+ : `HTTP ${response.status}`
416
419
  try {
417
420
  const body = await response.json()
418
- if (typeof body?.error === 'string') message = body.error
421
+ if (response.status !== 404 && typeof body?.error === 'string') message = body.error
419
422
  } catch {
420
423
  // Keep the status message.
421
424
  }
@@ -454,7 +457,7 @@ window.__ModuleLoader__.load({
454
457
  loading: false,
455
458
  })
456
459
  }
457
- }, [props.sessionId])
460
+ }, [props.sessionId, text])
458
461
 
459
462
  const openDialog = useCallback(() => {
460
463
  if (inputActions === undefined || typeof inputActions.captureInsertion !== 'function') return
package/locale/en.json CHANGED
@@ -27,7 +27,8 @@
27
27
  "replaceWhole": "Replace draft",
28
28
  "fallback": "The rewrite failed validation; the original draft was kept.",
29
29
  "fallbackShort": "Rewrite failed",
30
- "done": "Rewrite complete ({count} checks)"
30
+ "done": "Rewrite complete ({count} checks)",
31
+ "hostMissing": "Host route is not loaded (HTTP 404). Fully quit and reopen DeepSeek Harness so the Host loads 0.2.x."
31
32
  },
32
33
  "settings": {
33
34
  "nav": "Prompt editor",
package/locale/zh.json CHANGED
@@ -27,7 +27,8 @@
27
27
  "replaceWhole": "替换全文",
28
28
  "fallback": "改写未通过校验,已保留原文。",
29
29
  "fallbackShort": "改写未通过",
30
- "done": "改写完成({count} 条提示)"
30
+ "done": "改写完成({count} 条提示)",
31
+ "hostMissing": "Host 路由未加载(HTTP 404)。请完全退出并重新打开 DeepSeek Harness,让 Host 加载 0.2.x。"
31
32
  },
32
33
  "settings": {
33
34
  "nav": "提示词增强",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infinity_cheng/dsh-prompt-editor",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Rewrite a rough prompt draft into a clear, executable prompt in DeepSeek Harness: streaming preview, selection-aware replace, and fact-preservation checks.",
5
5
  "icon": "icon.svg",
6
6
  "type": "module",