dsh-better-ask-user 0.3.4 → 0.3.5

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
@@ -42,13 +42,19 @@
42
42
 
43
43
  ```sh
44
44
  # 只安装这个插件
45
- dsh plugin --profile <profile> add dsh-better-ask-user@0.3.4 dsh-better-ptc@0.2.1
45
+ dsh plugin --profile <profile> add dsh-better-ask-user@0.3.5 dsh-better-ptc@0.2.1
46
46
 
47
47
  # 或安装 Better DSH(会自动带上所有独立插件)
48
- dsh plugin --profile <profile> add dsh-better-dsh@0.10.0
48
+ dsh plugin --profile <profile> add dsh-better-dsh@0.11.5
49
49
  ```
50
50
 
51
- > 安装 / 升级 / 换包后必须重启对应 profile;只刷新网页不够。
51
+ > 安装 / 升级 / 换包后必须重启对应 profile;Desktop 必须完全退出后重新打开,只刷新网页不够。
52
+
53
+ ### 提问卡片不出现
54
+
55
+ - 先完整重启 Desktop;刷新页面、HMR 或只重装客户端 bundle 不会重建客户端模块图。
56
+ - 在 WebView devtools 检查 `globalThis.__DSH_BOOT__.entries` 是否包含 `dsh-better-ask-user`。若没有,客户端半没有加载,优先检查 client-modules 依赖/安装日志并重启。
57
+ - 若客户端半已加载,PTC 嵌套提问在等待期间仍需要客户端实时认领;超时转 pending 后由 `userQuestions` 投影恢复 continued 卡片。两种路径都失败时,工具行会显示“等待提问界面/已中断”,不会再提供必然失败的“打开”。
52
58
 
53
59
  ## 它拥有什么
54
60
 
@@ -57,7 +63,7 @@ dsh plugin --profile <profile> add dsh-better-dsh@0.10.0
57
63
  | 稳定行 id | `dsh-better-ask-user` |
58
64
  | 入口 / 工具 | `ask_user_question` · 问题卡片 / 等待时间线 · 提问设置页 |
59
65
  | 设置 | 等待时长、输入续期、普通 / Goal 超时行为 |
60
- | npm 包 | `dsh-better-ask-user@0.3.4` |
66
+ | npm 包 | `dsh-better-ask-user@0.3.5` |
61
67
  | 仓库 | https://github.com/omdsh-dev/dsh-better-ask-user |
62
68
 
63
69
  ## 设置
package/lib/client.js CHANGED
@@ -598,7 +598,7 @@ function AskHistoryRow({
598
598
  const record = questions !== void 0 && phase === "result" ? { questions, answers } : void 0;
599
599
  const live = useQuestionPanelLive(callId, (present) => present === true);
600
600
  const errorCode = "kind" in block ? block.error?.code : void 0;
601
- const status = live ? void 0 : errorCode === "ASK_ABORTED" || errorCode === "interrupted" ? t("history.interrupted") : errorCode === "ASK_CANCELLED" ? t("history.cancelled") : void 0;
601
+ const status = live ? void 0 : errorCode === "ASK_ABORTED" || errorCode === "interrupted" ? t("history.interrupted") : errorCode === "ASK_CANCELLED" ? t("history.cancelled") : phase === "start" ? t("history.waiting") : void 0;
602
602
  const summary = questions?.[0]?.question.split("\n").find((line) => line.trim() !== "")?.trim() ?? t("history.title");
603
603
  const action = live ? () => revealPanel(callId) : record === void 0 ? void 0 : () => reviewPanel(callId, record);
604
604
  const review = !live && record !== void 0;
@@ -1714,6 +1714,7 @@ var zh = {
1714
1714
  "history.reopen": "\u6253\u5F00",
1715
1715
  "history.interrupted": "\u5DF2\u4E2D\u65AD",
1716
1716
  "history.cancelled": "\u5DF2\u53D6\u6D88",
1717
+ "history.waiting": "\u7B49\u5F85\u63D0\u95EE\u754C\u9762\u2026",
1717
1718
  "history.unavailable": "\u8FD9\u4E2A\u95EE\u9898\u5DF2\u7ED3\u675F\uFF0C\u65E0\u6CD5\u6253\u5F00\u3002",
1718
1719
  "reply.copyFailed": "\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5\u3002",
1719
1720
  "wait.takeTime": "\u6162\u6162\u56DE\u7B54",
@@ -1759,6 +1760,7 @@ var en = {
1759
1760
  "history.reopen": "Open",
1760
1761
  "history.interrupted": "Interrupted",
1761
1762
  "history.cancelled": "Cancelled",
1763
+ "history.waiting": "Waiting for the question UI\u2026",
1762
1764
  "history.unavailable": "This question has ended and cannot be reopened.",
1763
1765
  "reply.copyFailed": "Copy failed. Try again.",
1764
1766
  "wait.takeTime": "Take time",
@@ -2391,8 +2393,11 @@ var QuestionCards = class {
2391
2393
  }
2392
2394
  };
2393
2395
  async function answerQuestion(ctx, owner, request, next, cards) {
2394
- const sessionId = ctx.sessions.scopeOf(owner);
2395
- if (sessionId === void 0) return next();
2396
+ const sessionId = ctx.sessions.scopeOf(owner) ?? (request.agent === void 0 ? void 0 : ctx.sessions.scopeOf(request.agent));
2397
+ if (sessionId === void 0) {
2398
+ ctx.logger?.warn?.(`Better Ask User: could not resolve the Session for ${request.wait?.callId ?? "a question without a call id"}; the question card cannot be created`);
2399
+ return next();
2400
+ }
2396
2401
  const callId = request.wait?.callId;
2397
2402
  const better = request.better;
2398
2403
  const card = cards.ensure(sessionId, request.questions, callId, better);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-better-ask-user",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "description": "Independent ask_user_question plugin: configurable wait, input-extended countdown, markdown/mobile card, native or default timeout behavior, and PTC deadline exemption.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -57,8 +57,7 @@
57
57
  "@deepseek-ai/dsh-client-ui-conversation",
58
58
  "@deepseek-ai/dsh-client-ui-renderer",
59
59
  "@deepseek-ai/dsh-client-ui-session",
60
- "@deepseek-ai/dsh-client-ui-chat",
61
- "@deepseek-ai/dsh-client-ui-settings"
60
+ "@deepseek-ai/dsh-client-ui-chat"
62
61
  ]
63
62
  }
64
63
  },
@@ -126,7 +126,9 @@ export function AskHistoryRow({
126
126
  ? t('history.interrupted')
127
127
  : errorCode === 'ASK_CANCELLED'
128
128
  ? t('history.cancelled')
129
- : undefined
129
+ : phase === 'start'
130
+ ? t('history.waiting')
131
+ : undefined
130
132
  const summary = questions?.[0]?.question.split('\n').find(line => line.trim() !== '')?.trim() ?? t('history.title')
131
133
  const action = live
132
134
  ? () => revealPanel(callId)
@@ -257,7 +257,11 @@ async function answerQuestion(
257
257
  cards: QuestionCards,
258
258
  ): Promise<ClientQuestionAnswer> {
259
259
  const sessionId = ctx.sessions.scopeOf(owner)
260
- if (sessionId === undefined) return next()
260
+ ?? (request.agent === undefined ? undefined : ctx.sessions.scopeOf(request.agent as unknown as ClientContext))
261
+ if (sessionId === undefined) {
262
+ ctx.logger?.warn?.(`Better Ask User: could not resolve the Session for ${request.wait?.callId ?? 'a question without a call id'}; the question card cannot be created`)
263
+ return next()
264
+ }
261
265
  const callId = request.wait?.callId
262
266
  const better = (request as { better?: BetterAskConfig }).better
263
267
  const card = cards.ensure(sessionId, request.questions, callId, better)
@@ -12,6 +12,7 @@ export const zh = {
12
12
  'history.reopen': '打开',
13
13
  'history.interrupted': '已中断',
14
14
  'history.cancelled': '已取消',
15
+ 'history.waiting': '等待提问界面…',
15
16
  'history.unavailable': '这个问题已结束,无法打开。',
16
17
  'reply.copyFailed': '复制失败,请重试。',
17
18
  'wait.takeTime': '慢慢回答',
@@ -62,6 +63,7 @@ export const en = {
62
63
  'history.reopen': 'Open',
63
64
  'history.interrupted': 'Interrupted',
64
65
  'history.cancelled': 'Cancelled',
66
+ 'history.waiting': 'Waiting for the question UI…',
65
67
  'history.unavailable': 'This question has ended and cannot be reopened.',
66
68
  'reply.copyFailed': 'Copy failed. Try again.',
67
69
  'wait.takeTime': 'Take time',