@kangyishuai/dsh-next-step 0.4.0 → 0.4.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 +18 -18
- package/README.zh-CN.md +16 -16
- package/lib/client.js +5 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -66,7 +66,7 @@ Re-run `pnpm pack` + `add` after changing the code. The plugin has a host half,
|
|
|
66
66
|
|
|
67
67
|
**Keyboard.** While the card is interactive, the composer is empty and the session is idle, `⌘↵` / `Ctrl+↵` sends the primary pill (same path as a click). When the composer holds a draft, an attachment, an open `@`/`/` menu, or a turn is running, the combination keeps its host Queue/Steer meaning — the plugin does not steal it.
|
|
68
68
|
|
|
69
|
-
**When no card appears.**
|
|
69
|
+
**When no card appears.** A turn can end up without a visible card for two different reasons: the model graded it `no` (or `could` while your tier is Strict), in which case the card **already exists but is withheld**; or generation was skipped/failed (paused, messages queued, budget, timeout, bad output), in which case there is no candidate at all. In both cases a small “Generate a next-step card” button appears under the latest answer. For a withheld card, clicking it **reveals the stored candidate — instantly, with no second model call**; only when there is no candidate does it actually call the model again. So when you think a card should have appeared: check “Last skipped” in the settings diagnostics, and click that button.
|
|
70
70
|
|
|
71
71
|
**The ghost hint.** Turn the ghost face on in the plugin settings. With an empty, idle composer you see the latest card's next prompt in grey, aligned with the host placeholder. `Tab` or `→` accepts it — the text lands in the draft and stays undoable. `Esc` clears it for this suggestion, and the first typed character hides it. It only ever edits the draft: it does not send, and it does not bind Enter.
|
|
72
72
|
|
|
@@ -83,7 +83,7 @@ The section opens with **three rows** — enable, **card frequency** (strict / b
|
|
|
83
83
|
- **Cadence** — “Pause for 1 hour” / “Resume”.
|
|
84
84
|
- **Per session, at most N cards** — the budget (`maxCardsPerSession`, clamped to 0–1000, default 120). It only counts cards that were _shown_; withheld candidates do not consume it.
|
|
85
85
|
- **Review** — the four numbers that matter (card rate / click-through / ignore rate / misses), a one-line verdict when the sample is big enough, and a **“Generate report”** button that writes `report-YYYYMMDD-HHmmss.md` next to the log.
|
|
86
|
-
- **Diagnostics** — generated (with how many were withheld) / failed / aborted / skipped / in-flight counters, the **reason the last card was skipped** (model judged unnecessary / queued / paused / budget / failure / timeout / cancelled, with the model's own sentence), the last error, the runtime **version + build hash**, and a Refresh button. `nextStep/diagnostics` returns the same `version` / `buildHash` / `buildFiles` / `packagePath`, so a running build can be matched against `dsh plugin list` or the npm tarball without digging through startup logs.
|
|
86
|
+
- **Diagnostics** — generated (with how many were withheld) / failed / aborted / skipped / in-flight counters, the **reason the last card was skipped** (model judged unnecessary / queued / paused / budget / failure / timeout / cancelled, with the model's own sentence), the last error, the runtime **version + build hash**, and a Refresh button. `nextStep/diagnostics` returns the same `version` / `buildHash` / `buildFiles` / `packagePath`, so a running build can be matched against `dsh plugin list` or the npm tarball without digging through startup logs. Caveat: `buildHash` covers `package.json`, and pnpm rewrites it during a `file:` install — in that case compare against the installed copy, not the repo (see [docs/testing §4.5](../../docs/testing/next-step.md)).
|
|
87
87
|
|
|
88
88
|
Turning the global switch off **hides every dependent row** (card / ghost / pause / budget / diagnostics) and leaves just the switch plus one line of explanation — off means off, nothing looks like it still runs, and re-enabling restores the previous switch values.
|
|
89
89
|
|
|
@@ -91,30 +91,30 @@ The row writes the same `$DSH_HOME/next-step.settings.json` that the host re-rea
|
|
|
91
91
|
|
|
92
92
|
## When no card appears
|
|
93
93
|
|
|
94
|
-
| Situation | What happens
|
|
95
|
-
| ------------------------------------------------------------------------------------------------- |
|
|
96
|
-
| The turn was stopped, errored, or produced no text | No card: only normally completed turns are eligible.
|
|
97
|
-
| Subagent session | No card, by design.
|
|
98
|
-
| Global switch off | No request is made at all; existing cards remain in the transcript.
|
|
99
|
-
| Paused, or the session's card budget (`maxCardsPerSession`) used up | No new card; existing cards stay.
|
|
100
|
-
| A card or a decision already exists for that turn | One card per turn; no duplicates.
|
|
101
|
-
| The model
|
|
102
|
-
| Model call failed, was rate-limited, bad JSON | Silent; only a diagnostics counter goes up.
|
|
103
|
-
| The generation **timed out (20 s) or was cancelled** | Counted in `aborted`; “Last skipped” says which, and the generate button reports it. No dialog.
|
|
104
|
-
| The reply is still streaming | Nothing is rendered for the turn until it ends.
|
|
105
|
-
| The composer already has a draft | The card is visible but the pills are disabled until the draft is cleared.
|
|
106
|
-
| Ghost face on, but the composer is not plain (draft, attachment, `@`, `/`, or a non-idle session) | The hint stays hidden.
|
|
94
|
+
| Situation | What happens |
|
|
95
|
+
| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
|
|
96
|
+
| The turn was stopped, errored, or produced no text | No card: only normally completed turns are eligible. |
|
|
97
|
+
| Subagent session | No card, by design. |
|
|
98
|
+
| Global switch off | No request is made at all; existing cards remain in the transcript. |
|
|
99
|
+
| Paused, or the session's card budget (`maxCardsPerSession`) used up | No new card; existing cards stay. |
|
|
100
|
+
| A card or a decision already exists for that turn | One card per turn; no duplicates. |
|
|
101
|
+
| The model grades the turn `no`, or grades it `could` while your tier is Strict (`shown: false`) | The candidate is stored but hidden; the generate button **reveals it for free**. “Last skipped” shows the model's reason. |
|
|
102
|
+
| Model call failed, was rate-limited, bad JSON | Silent; only a diagnostics counter goes up. |
|
|
103
|
+
| The generation **timed out (20 s) or was cancelled** | Counted in `aborted`; “Last skipped” says which, and the generate button reports it. No dialog. |
|
|
104
|
+
| The reply is still streaming | Nothing is rendered for the turn until it ends. |
|
|
105
|
+
| The composer already has a draft | The card is visible but the pills are disabled until the draft is cleared. |
|
|
106
|
+
| Ghost face on, but the composer is not plain (draft, attachment, `@`, `/`, or a non-idle session) | The hint stays hidden. |
|
|
107
107
|
|
|
108
108
|
## Known limitations
|
|
109
109
|
|
|
110
110
|
- **The card sits under the answer** (`conversation.chat.turnTail`), not in the composer area. It is right below the last answer after the turn completes, so it needs no scrolling; cards from earlier turns scroll with the transcript (see ADR 0009 §4).
|
|
111
111
|
- **No card while messages are queued.** If you already have 2+ messages waiting to be sent, the plugin skips generation for that turn (the official action cards use the same limit); nothing is queued or sent by the plugin itself.
|
|
112
|
-
- **
|
|
112
|
+
- **One or two proposals.** Options must point in different (mutually exclusive) directions; a one-option card means the next step is obvious, not that the card is incomplete.
|
|
113
113
|
- **`⌘↵` / `Ctrl+↵` is only taken over when the composer is clean, the session is idle and a card is interactive.** Otherwise the combination keeps its host Queue/Steer complementary-send meaning; the plugin never steals it.
|
|
114
114
|
- **No cross-device sync.** Cards and decisions live in the local session log of the machine that generated them.
|
|
115
115
|
- **No cards in subagent sessions**, and none for interrupted or empty turns.
|
|
116
116
|
- **The ghost only offers the latest card's next prompt**, and only when the composer is empty and idle.
|
|
117
|
-
- **The card text is model output.** The plugin validates the shape (
|
|
117
|
+
- **The card text is model output.** The plugin validates the shape (1–2 options, distinct stances, a 2–20 character label that names a concrete object from the conversation) and drops only the individual options that fail; it never rewrites the wording.
|
|
118
118
|
- **A click sends exactly the pill's text** — there is no hidden “short label, long instruction behind it” layer. A `text` field left over in card records written by older versions is ignored.
|
|
119
119
|
|
|
120
120
|

|
|
@@ -122,7 +122,7 @@ The row writes the same `$DSH_HOME/next-step.settings.json` that the host re-rea
|
|
|
122
122
|
## Compatibility
|
|
123
123
|
|
|
124
124
|
| DSH version | Status |
|
|
125
|
-
| 0.2.2-rc.3 | **0.4.0** (2026-11-14): the card face becomes tunable and measurable. The model grades a turn on three levels (`must` / `could` / `no`) instead of a boolean, and a setting picks which levels are shown (**strict / balanced (default) / eager**). A withheld card still stores its candidate and one click **reveals** it — no second model call; only a turn without any candidate regenerates. Parsing is tolerant (over-long text is clipped, a bad single option is dropped) with one repair call, so one over-long field can no longer delete a whole card. Every eligible turn appends one line to `<dataRoot>/next-step/events.jsonl` (gate, grade, latency, usage, what you did with the card, whether it entered the viewport; never your message text, local only, can be switched off), and the settings section writes a Markdown report with Wilson 95% intervals that refuses to give verdicts below 80 turns / 25 cards. Three deterministic losses are gone: the budget (30 → 120) only counts _shown_ cards, the short-answer gate now requires "few chars **and** no tool calls", and a bad field no longer voids the card. Settings moved to a 3-row first screen plus a "More settings" disclosure; the settings file is v2 (`schemaVersion` / `cardThreshold` / `telemetry`) and only migrates values equal to the old default. Verified:
|
|
125
|
+
| 0.2.2-rc.3 | **0.4.0** (2026-11-14): the card face becomes tunable and measurable. The model grades a turn on three levels (`must` / `could` / `no`) instead of a boolean, and a setting picks which levels are shown (**strict / balanced (default) / eager**). A withheld card still stores its candidate and one click **reveals** it — no second model call; only a turn without any candidate regenerates. Parsing is tolerant (over-long text is clipped, a bad single option is dropped) with one repair call, so one over-long field can no longer delete a whole card. Every eligible turn appends one line to `<dataRoot>/next-step/events.jsonl` (gate, grade, latency, usage, what you did with the card, whether it entered the viewport; never your message text, local only, can be switched off), and the settings section writes a Markdown report with Wilson 95% intervals that refuses to give verdicts below 80 turns / 25 cards. Three deterministic losses are gone: the budget (30 → 120) only counts _shown_ cards, the short-answer gate now requires "few chars **and** no tool calls", and a bad field no longer voids the card. Settings moved to a 3-row first screen plus a "More settings" disclosure; the settings file is v2 (`schemaVersion` / `cardThreshold` / `telemetry`) and only migrates values equal to the old default. Verified: 170 unit tests + `pnpm probe:runtime` + web `pnpm smoke:next-step` **71/71** (real host, real model calls, including the withheld→reveal path and the event log) + desktop read-only regression. |
|
|
126
126
|
| ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
127
127
|
| 0.2.2-rc.3 | **0.3.1** (2026-11-14): makes an aborted generation diagnosable. A 20 s timeout or a cancellation used to leave **no trace at all** — no counter, no “Last skipped” entry, no session record — so a “no card appeared” incident was impossible to attribute after the fact. Now aborts increment a separate `aborted` counter (shown in the settings row as “已中止 N”), write a labelled “Last skipped” reason (`generation timeout after 20s` / `cancelled`), stay out of `failed` / `lastError`, and the generate button says “生成超时或被取消,请重试” instead of the generic failure text. Verified: 103 unit tests (4 new) + `pnpm probe:runtime` 72/72 + web `pnpm smoke:next-step` **59/59** (real host + real model call, re-run after the change) + desktop read-only regression **10 PASS + 2 SKIP**; `smoke:next-step` also gained the ability to print the plugin-reported reason and to keep its throwaway `DSH_HOME` when an assertion fails. |
|
|
128
128
|
| 0.2.2-rc.2 | **0.3.0** (2026-11-14): pill labels tightened to 2–20 characters and must name a concrete object (generic pills are dropped), 1–2 options instead of exactly 2, summaries must state checkable facts, two new cheap gates (previous turn errored / answer under 80 characters), ghost hint capped at 150 characters and degraded when it disagrees with the recommended pill; settings moved to their own "Settings → Next-step suggestions" section. Verified: 58 unit tests (50 prompt + 8 gates) + `pnpm probe:runtime` 72/72 + web `pnpm smoke:next-step` **59/59** (real host, real model call). The settings section was also checked on a live desktop build via read-only CDP; the desktop read-only regression reports **10 PASS + 2 SKIP** (the SKIPs are "no card in this session" and "read-only mode does not create cards"); `--deep` card interaction reports **23 PASS + 2 SKIP** (real model call — the one-sentence fixture is blocked by the new "answer under 80 characters" gate, so the run exercises the generate-now fallback, which also verifies that gate). |
|
package/README.zh-CN.md
CHANGED
|
@@ -66,7 +66,7 @@ dsh plugin --profile desktop add /tmp/kangyishuai-dsh-next-step-*.tgz
|
|
|
66
66
|
|
|
67
67
|
**键盘。** 卡片可交互、输入框为空、会话空闲时,按 `⌘↵` / `Ctrl+↵` 直接发送 primary 胶囊(和鼠标点击走同一条链)。输入框里有草稿、附件、`@`/`/` 菜单开着或已有回合在跑时,这个键仍归宿主的 Queue/Steer 语义,插件不抢。
|
|
68
68
|
|
|
69
|
-
**没出卡怎么办。**
|
|
69
|
+
**没出卡怎么办。** 没出卡有两种不同的原因:一种是被档位拦下(模型判 `no`,或判 `could` 而你选的是严格档)——这时卡片**已经算好了,只是没显示**;另一种是压根没生成(暂停、排队、预算、超时、输出不合法)——这时没有任何候选。两种情况下最新回答下方都会出现一行「生成下一步建议」:被档位拦下的,点它就是**揭示已有候选,瞬时出卡、不再调模型**;只有没有候选时才会真的重新调一次模型。所以「我觉得该出卡却没出」时:先看设置页诊断的「最近跳过」;想立刻要一张,直接点那个按钮。
|
|
70
70
|
|
|
71
71
|
**幽灵提示。** 在 设置 → **下一步建议** 里打开 ghost 面。输入框空且空闲时,最新一张卡的「下一句提示」以灰色出现,和宿主 placeholder 对齐。`Tab` 或 `→` 接受——文本进入草稿,仍可撤销。`Esc` 清除本次建议,输入第一个字符也会让它消失。它只改草稿:不发送,也不抢 Enter。
|
|
72
72
|
|
|
@@ -83,7 +83,7 @@ dsh plugin --profile desktop add /tmp/kangyishuai-dsh-next-step-*.tgz
|
|
|
83
83
|
- **生成节奏** —— 「暂停 1 小时」/「恢复生成」。
|
|
84
84
|
- **每会话最多 N 张卡** —— 预算(`maxCardsPerSession`,夹在 0–1000,默认 120)。只统计**出过**的卡,被抑制的候选不占预算。
|
|
85
85
|
- **回顾** —— 四个关键数字(出卡率 / 点击率 / 忽略率 / 漏判)+ 样本够时的一句话判读 + **「生成报告」**按钮,报告写在日志旁边。
|
|
86
|
-
- **诊断** —— 已生成(含未显示数)/ 失败 / 已中止 / 跳过 / 在途计数、**最近一次没出卡的原因**(模型判断不需要 / 排队 / 暂停 / 预算 / 失败 / 超时 / 取消,附模型给的理由)、最近错误、**运行时版本 + 构建哈希**、刷新按钮。`nextStep/diagnostics` 同样返回 `version` / `buildHash` / `buildFiles` / `packagePath` 与 `lastSkip`,所以运行中的构建可以和 `dsh plugin list` 或 npm 上的 tarball
|
|
86
|
+
- **诊断** —— 已生成(含未显示数)/ 失败 / 已中止 / 跳过 / 在途计数、**最近一次没出卡的原因**(模型判断不需要 / 排队 / 暂停 / 预算 / 失败 / 超时 / 取消,附模型给的理由)、最近错误、**运行时版本 + 构建哈希**、刷新按钮。`nextStep/diagnostics` 同样返回 `version` / `buildHash` / `buildFiles` / `packagePath` 与 `lastSkip`,所以运行中的构建可以和 `dsh plugin list` 或 npm 上的 tarball 对照,不需要翻启动日志。注意:`buildHash` 覆盖 `package.json`,而 pnpm 在 `file:` 安装时会重写它——那种情况要和 **profile 里已安装的那一份**比,别拿仓库的哈希去对(详见 [docs/testing §4.5](../../docs/testing/next-step.md))。
|
|
87
87
|
|
|
88
88
|
关闭总开关后,卡片 / 幽灵 / 暂停 / 预算 / 诊断这些依赖项会**整段隐藏**,只留总开关和一行说明——关掉就是关掉,不会让人以为还有东西在跑;重新启用时这些开关的取值都还在。
|
|
89
89
|
|
|
@@ -91,19 +91,19 @@ dsh plugin --profile desktop add /tmp/kangyishuai-dsh-next-step-*.tgz
|
|
|
91
91
|
|
|
92
92
|
## 什么情况下不出卡
|
|
93
93
|
|
|
94
|
-
| 情况
|
|
95
|
-
|
|
|
96
|
-
| 回合被停止、报错,或没有文本
|
|
97
|
-
| 子代理会话
|
|
98
|
-
| 全局开关关闭
|
|
99
|
-
| 已暂停,或用完该会话的卡片预算(`maxCardsPerSession`)
|
|
100
|
-
| 该轮已经有 card 或 decision 记录
|
|
101
|
-
|
|
|
102
|
-
| 模型调用失败、限流、JSON 不合法
|
|
103
|
-
| 生成**超时(20 秒)或被取消**
|
|
104
|
-
| 回答还在流式输出
|
|
105
|
-
| 输入框里已有草稿
|
|
106
|
-
| ghost 开着,但草稿、附件、`@`、`/` 或输入状态不满足条件
|
|
94
|
+
| 情况 | 表现 |
|
|
95
|
+
| ------------------------------------------------------------ | -------------------------------------------------------------------------- |
|
|
96
|
+
| 回合被停止、报错,或没有文本 | 不出卡:只有正常结束的回合才有资格。 |
|
|
97
|
+
| 子代理会话 | 按设计不出卡。 |
|
|
98
|
+
| 全局开关关闭 | 完全不发请求;已有卡片仍然留在对话里。 |
|
|
99
|
+
| 已暂停,或用完该会话的卡片预算(`maxCardsPerSession`) | 不出新卡;已有卡片保留。 |
|
|
100
|
+
| 该轮已经有 card 或 decision 记录 | 一轮最多一张卡,不重复。 |
|
|
101
|
+
| 模型判 `no`,或判 `could` 而你选的是严格档(`shown: false`) | 候选已落库但不显示;点补生成按钮**免费揭示**。诊断里「最近跳过」写明理由。 |
|
|
102
|
+
| 模型调用失败、限流、JSON 不合法 | 静默;只有诊断计数增加。 |
|
|
103
|
+
| 生成**超时(20 秒)或被取消** | 计入 `aborted`;「最近跳过」写明是哪一种,补生成按钮也会显示。不弹框。 |
|
|
104
|
+
| 回答还在流式输出 | 该轮结束前槽位不渲染。 |
|
|
105
|
+
| 输入框里已有草稿 | 卡片照常显示,但胶囊禁用,直到清空草稿。 |
|
|
106
|
+
| ghost 开着,但草稿、附件、`@`、`/` 或输入状态不满足条件 | 提示隐藏。 |
|
|
107
107
|
|
|
108
108
|
## 已知限制
|
|
109
109
|
|
|
@@ -123,7 +123,7 @@ dsh plugin --profile desktop add /tmp/kangyishuai-dsh-next-step-*.tgz
|
|
|
123
123
|
## 兼容性
|
|
124
124
|
|
|
125
125
|
| DSH 版本 | 状态 |
|
|
126
|
-
| 0.2.2-rc.3 | **0.4.0**(2026-11-14):卡片这一面变成**可调**且**可度量**。模型不再用一个 boolean,而是把回合打成三档(`must` / `could` / `no`),设置里选出卡频率(**严格 / 平衡(默认)/ 积极**)。被档位拦下的卡仍会存下候选,点一下**揭示**它——不再第二次调模型;只有压根没有候选的回合才真的重新生成。解析变宽容(超长文本截断、单条不合格只丢这一条)+ 一次修复调用,一个字段超长不再让整张卡消失。每个合格回合往 `<dataRoot>/next-step/events.jsonl` 追加一行(闸门、三档判定、耗时、token、你后来对卡做了什么、有没有进过视口;不写消息原文、只在本机、可关),设置页还能生成带 Wilson 95% 区间的 Markdown 报告,样本少于 80 回合 / 25 张卡时拒绝给判读。三处确定性丢失也修了:预算(30 → 120)只统计**出过**的卡、短答闸改成「字数少**且**没有工具调用」、单个字段超长不再废掉整张卡。设置页收敛成首屏 3 行 +「更多设置」折叠;设置文件升级到 v2(`schemaVersion` / `cardThreshold` / `telemetry`),只迁移等于旧默认值的字段。验证:单测
|
|
126
|
+
| 0.2.2-rc.3 | **0.4.0**(2026-11-14):卡片这一面变成**可调**且**可度量**。模型不再用一个 boolean,而是把回合打成三档(`must` / `could` / `no`),设置里选出卡频率(**严格 / 平衡(默认)/ 积极**)。被档位拦下的卡仍会存下候选,点一下**揭示**它——不再第二次调模型;只有压根没有候选的回合才真的重新生成。解析变宽容(超长文本截断、单条不合格只丢这一条)+ 一次修复调用,一个字段超长不再让整张卡消失。每个合格回合往 `<dataRoot>/next-step/events.jsonl` 追加一行(闸门、三档判定、耗时、token、你后来对卡做了什么、有没有进过视口;不写消息原文、只在本机、可关),设置页还能生成带 Wilson 95% 区间的 Markdown 报告,样本少于 80 回合 / 25 张卡时拒绝给判读。三处确定性丢失也修了:预算(30 → 120)只统计**出过**的卡、短答闸改成「字数少**且**没有工具调用」、单个字段超长不再废掉整张卡。设置页收敛成首屏 3 行 +「更多设置」折叠;设置文件升级到 v2(`schemaVersion` / `cardThreshold` / `telemetry`),只迁移等于旧默认值的字段。验证:单测 170 项 + `pnpm probe:runtime` + web `pnpm smoke:next-step` **71/71**(真实宿主、真实模型调用,含「抑制 → 揭示」链路与事件文件)+ 桌面只读回归。 |
|
|
127
127
|
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
128
128
|
| 0.2.2-rc.3 | **0.3.1**(2026-11-14):让被中止的生成可诊断。此前 20 秒超时或被取消**完全无痕**——不计数、不写「最近跳过」、也不落会话日志——所以一次「卡片没出来」事后无法归因。现在中止会计入独立的 `aborted` 计数(设置页显示「已中止 N」)、写带标签的「最近跳过」原因(`generation timeout after 20s` / `cancelled`)、不再混进 `failed` / `lastError`,补生成按钮的文案也从笼统的失败文案改为「生成超时或被取消,请重试」。已验证:103 项单测(新增 4)+ `pnpm probe:runtime` 72/72 + web `pnpm smoke:next-step` **59/59**(真实宿主 + 真实模型调用,改动后重跑)+ 桌面只读回归 **10 PASS + 2 SKIP**;`smoke:next-step` 同时补了「打印插件自报原因」与「断言失败自动保留临时 `DSH_HOME`」。 |
|
|
129
129
|
| 0.2.2-rc.2 | **0.3.0**(2026-11-14):胶囊文案收紧到 2–20 字且必须含具体对象(泛化按钮直接丢弃)、选项 1–2 条、摘要要求写事实、新增「上轮报错 / 回答 < 80 字」两道便宜闸、幽灵提示 150 字上限 + 与推荐项一致性退化;设置搬到「设置 → 下一步建议」分节。已验证:单测 58(prompt 50 + gates 8)+ `pnpm probe:runtime` 72/72 + web `pnpm smoke:next-step` **59/59**(真实宿主 + 真实模型调用)。设置分节另有真机只读 CDP 核验;桌面只读回归 **10 PASS + 2 SKIP**(SKIP 是「当前会话没有决策卡」与「只读模式不造卡」);`--deep` 造卡交互 **23 PASS + 2 SKIP**(真实模型调用;一句话提示词会被「回答 < 80 字」闸挡住,走的是补生成按钮那条兜底,顺带验证了闸)。 |
|
package/lib/client.js
CHANGED
|
@@ -865,6 +865,9 @@ window.__ModuleLoader__.load({
|
|
|
865
865
|
};
|
|
866
866
|
|
|
867
867
|
// 卡片快捷键桥:只有「这一步真的能点」时才登记,键盘观察者据此决定是否接管 ⌘/Ctrl+Enter。
|
|
868
|
+
// 注意:登记的时机与「卡片是否已经到达」无关——卡片是**投影晚到**的(宿主在回合结束后
|
|
869
|
+
// 才生成),回合尾部先挂载、status 先变成 interactive,卡片数据随后才进来。若登记只在
|
|
870
|
+
// status/sessionId 变化时重跑,晚到的卡片永远登记不上,⌘↵ 会静默失效(点击仍然正常)。
|
|
868
871
|
let sendPillRef = React.useRef(/** @type {(index: number) => void} */ (() => {}));
|
|
869
872
|
sendPillRef.current = sendPill;
|
|
870
873
|
let gateRef = React.useRef({ ready: false });
|
|
@@ -894,7 +897,8 @@ window.__ModuleLoader__.load({
|
|
|
894
897
|
return () => {
|
|
895
898
|
if (cardEntries.get(sessionId) === entry) cardEntries.delete(sessionId);
|
|
896
899
|
};
|
|
897
|
-
|
|
900
|
+
// 可见性(而不是卡片对象本身)必须进依赖:卡片晚到时这个 effect 要再跑一次。
|
|
901
|
+
}, [sessionId, status, visibleCard === null, options.length]);
|
|
898
902
|
|
|
899
903
|
// 曝光:卡片**真正进入视口**才上报(挂载 ≠ 被看见)。只在最新一轮的可交互卡上观察,
|
|
900
904
|
// 历史卡滚动回来不上报(它们的曝光在第一眼就该记过一次了)。
|
package/package.json
CHANGED