@jingyi0605/codingns4dsh 0.2.2-beta.3 → 0.2.2-beta.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.
Files changed (86) hide show
  1. package/README.en.md +4 -4
  2. package/README.md +4 -4
  3. package/data/build/dist/client/bundle.js +75 -36
  4. package/data/build/dist/client/bundle.js.map +1 -1
  5. package/data/build/dist/client/features/magpie-management-page.d.ts.map +1 -1
  6. package/data/build/dist/client/features/magpie-management-page.js +8 -1
  7. package/data/build/dist/client/features/magpie-management-page.js.map +1 -1
  8. package/data/build/dist/client/peer-host-workspace-tab.d.ts +3 -2
  9. package/data/build/dist/client/peer-host-workspace-tab.d.ts.map +1 -1
  10. package/data/build/dist/client/peer-host-workspace-tab.js +3 -2
  11. package/data/build/dist/client/peer-host-workspace-tab.js.map +1 -1
  12. package/data/build/dist/client/quick-phrase-slot.d.ts.map +1 -1
  13. package/data/build/dist/client/quick-phrase-slot.js +11 -3
  14. package/data/build/dist/client/quick-phrase-slot.js.map +1 -1
  15. package/data/build/dist/client/session-translation-chat.d.ts.map +1 -1
  16. package/data/build/dist/client/session-translation-chat.js +15 -5
  17. package/data/build/dist/client/session-translation-chat.js.map +1 -1
  18. package/data/build/dist/client/subscription-slot.d.ts.map +1 -1
  19. package/data/build/dist/client/subscription-slot.js +9 -8
  20. package/data/build/dist/client/subscription-slot.js.map +1 -1
  21. package/data/build/dist/dsh-capabilities/client/message-presentation-adapter.d.ts +2 -0
  22. package/data/build/dist/dsh-capabilities/client/message-presentation-adapter.d.ts.map +1 -1
  23. package/data/build/dist/dsh-capabilities/client/message-presentation-adapter.js +10 -0
  24. package/data/build/dist/dsh-capabilities/client/message-presentation-adapter.js.map +1 -1
  25. package/data/build/dist/dsh-capabilities/client/session-performance-adapter.d.ts.map +1 -1
  26. package/data/build/dist/dsh-capabilities/client/session-performance-adapter.js +4 -3
  27. package/data/build/dist/dsh-capabilities/client/session-performance-adapter.js.map +1 -1
  28. package/data/build/dist/host/cli-adapters/claude-driver.d.ts.map +1 -1
  29. package/data/build/dist/host/cli-adapters/claude-driver.js +58 -1
  30. package/data/build/dist/host/cli-adapters/claude-driver.js.map +1 -1
  31. package/data/build/dist/host/cli-adapters/codex-driver.d.ts.map +1 -1
  32. package/data/build/dist/host/cli-adapters/codex-driver.js +82 -2
  33. package/data/build/dist/host/cli-adapters/codex-driver.js.map +1 -1
  34. package/data/build/dist/host/cli-adapters/feature.d.ts.map +1 -1
  35. package/data/build/dist/host/cli-adapters/feature.js +76 -5
  36. package/data/build/dist/host/cli-adapters/feature.js.map +1 -1
  37. package/data/build/dist/host/cli-adapters/grok-performance-projection.js +1 -1
  38. package/data/build/dist/host/cli-adapters/grok-performance-projection.js.map +1 -1
  39. package/data/build/dist/host/cli-adapters/json-rpc-process.d.ts.map +1 -1
  40. package/data/build/dist/host/cli-adapters/json-rpc-process.js +6 -1
  41. package/data/build/dist/host/cli-adapters/json-rpc-process.js.map +1 -1
  42. package/data/build/dist/host/cli-adapters/legacy-session-adapter.d.ts.map +1 -1
  43. package/data/build/dist/host/cli-adapters/legacy-session-adapter.js +9 -3
  44. package/data/build/dist/host/cli-adapters/legacy-session-adapter.js.map +1 -1
  45. package/data/build/dist/host/cli-adapters/magpie-detection.d.ts +4 -3
  46. package/data/build/dist/host/cli-adapters/magpie-detection.d.ts.map +1 -1
  47. package/data/build/dist/host/cli-adapters/magpie-detection.js +13 -7
  48. package/data/build/dist/host/cli-adapters/magpie-detection.js.map +1 -1
  49. package/data/build/dist/host/cli-adapters/magpie-usage.d.ts.map +1 -1
  50. package/data/build/dist/host/cli-adapters/magpie-usage.js +87 -16
  51. package/data/build/dist/host/cli-adapters/magpie-usage.js.map +1 -1
  52. package/data/build/dist/host/cli-adapters/opencode-v2-protocol.d.ts +1 -0
  53. package/data/build/dist/host/cli-adapters/opencode-v2-protocol.d.ts.map +1 -1
  54. package/data/build/dist/host/cli-adapters/opencode-v2-protocol.js +29 -4
  55. package/data/build/dist/host/cli-adapters/opencode-v2-protocol.js.map +1 -1
  56. package/data/build/dist/host/cli-adapters/pi-driver.d.ts.map +1 -1
  57. package/data/build/dist/host/cli-adapters/pi-driver.js +51 -12
  58. package/data/build/dist/host/cli-adapters/pi-driver.js.map +1 -1
  59. package/data/build/dist/host/cli-adapters/pi-performance-projection.d.ts +90 -0
  60. package/data/build/dist/host/cli-adapters/pi-performance-projection.d.ts.map +1 -0
  61. package/data/build/dist/host/cli-adapters/pi-performance-projection.js +7 -0
  62. package/data/build/dist/host/cli-adapters/pi-performance-projection.js.map +1 -0
  63. package/data/build/dist/host/cli-adapters/pi-performance.d.ts +15 -0
  64. package/data/build/dist/host/cli-adapters/pi-performance.d.ts.map +1 -0
  65. package/data/build/dist/host/cli-adapters/pi-performance.js +94 -0
  66. package/data/build/dist/host/cli-adapters/pi-performance.js.map +1 -0
  67. package/data/build/dist/host/native-session-bridge.d.ts +7 -0
  68. package/data/build/dist/host/native-session-bridge.d.ts.map +1 -1
  69. package/data/build/dist/host/native-session-bridge.js.map +1 -1
  70. package/data/build/dist/host/settings.js +16 -1
  71. package/data/build/dist/host/settings.js.map +1 -1
  72. package/data/build/dist/shared/contracts/subscription.d.ts +4 -0
  73. package/data/build/dist/shared/contracts/subscription.d.ts.map +1 -1
  74. package/data/build/dist/shared/contracts/subscription.js.map +1 -1
  75. package/data/build/dist/shared/contracts/version.d.ts +1 -1
  76. package/data/build/dist/shared/contracts/version.js +1 -1
  77. package/data/build/dist/shared/request-performance.d.ts +2 -1
  78. package/data/build/dist/shared/request-performance.d.ts.map +1 -1
  79. package/data/build/dist/shared/request-performance.js +1 -0
  80. package/data/build/dist/shared/request-performance.js.map +1 -1
  81. package/dsh.bundle.patch +2 -10
  82. package/package.json +1 -1
  83. package/profile/README.md +2 -2
  84. package/profile/package.json +2 -2
  85. package/profile/version.json +1 -1
  86. package/version.json +1 -1
package/README.en.md CHANGED
@@ -11,7 +11,7 @@
11
11
 
12
12
  [简体中文](README.md) · **English**
13
13
 
14
- **Current release `@jingyi0605/codingns4dsh@0.2.2-beta.3`** · DSH minimum **`0.2.1-alpha.2`** (tested with `0.2.2-rc.1`; newer versions warn but do not block installation or operation) · Node **`>= 24.9`** · macOS / Linux / Windows
14
+ **Current release `@jingyi0605/codingns4dsh@0.2.2-beta.5`** · DSH minimum **`0.2.1-alpha.2`** (tested with `0.2.2-rc.1`; newer versions warn but do not block installation or operation) · Node **`>= 24.9`** · macOS / Linux / Windows
15
15
 
16
16
  **[GitHub](https://github.com/jingyi0605/Codingns4DSH)** · **[npm](https://www.npmjs.com/package/@jingyi0605/codingns4dsh)** · **QQ group 1092985965** · **[WeChat / QQ QR codes](#community)**
17
17
 
@@ -225,7 +225,7 @@ The account menu shows login status, access method, connection latency and Host
225
225
  ### Use the Built-in Web Profile
226
226
 
227
227
  ```bash
228
- dsh plugin --profile web add @jingyi0605/codingns4dsh@0.2.2-beta.3
228
+ dsh plugin --profile web add @jingyi0605/codingns4dsh@0.2.2-beta.5
229
229
  dsh web
230
230
  ```
231
231
 
@@ -235,7 +235,7 @@ Create a separate environment from the built-in Web profile:
235
235
 
236
236
  ```bash
237
237
  dsh codingns --from-default-profile web --dump-config
238
- dsh plugin --profile codingns add @jingyi0605/codingns4dsh@0.2.2-beta.3
238
+ dsh plugin --profile codingns add @jingyi0605/codingns4dsh@0.2.2-beta.5
239
239
  dsh codingns
240
240
  ```
241
241
 
@@ -284,7 +284,7 @@ The WeChat and QQ groups are for questions, feedback and release announcements
284
284
  </table>
285
285
  </div>
286
286
 
287
- The WeChat QR code is generated dynamically by WeChat and is **valid for 7 days** (this image was captured on 2026-10-21 and states it expires on October 28); re-open the group's share page for a fresh code once it lapses, or ask in [GitHub Issues](https://github.com/jingyi0605/Codingns4DSH/issues). The QQ group QR code and group number do not expire.
287
+ The WeChat QR code is generated dynamically by WeChat and is **valid for 7 days** (this image was captured on 2026-11-06 and states it expires on November 13); re-open the group's share page for a fresh code once it lapses, or ask in [GitHub Issues](https://github.com/jingyi0605/Codingns4DSH/issues). The QQ group QR code and group number do not expire.
288
288
 
289
289
  ---
290
290
 
package/README.md CHANGED
@@ -11,7 +11,7 @@
11
11
 
12
12
  **简体中文** · [English](README.en.md)
13
13
 
14
- **当前版本 `@jingyi0605/codingns4dsh@0.2.2-beta.3`** · DSH 最低版本 **`0.2.1-alpha.2`**(已验证 `0.2.2-rc.1`;更新版本仅告警,不阻止安装或运行)· Node **`>= 24.9`** · macOS / Linux / Windows
14
+ **当前版本 `@jingyi0605/codingns4dsh@0.2.2-beta.5`** · DSH 最低版本 **`0.2.1-alpha.2`**(已验证 `0.2.2-rc.1`;更新版本仅告警,不阻止安装或运行)· Node **`>= 24.9`** · macOS / Linux / Windows
15
15
 
16
16
  **[GitHub](https://github.com/jingyi0605/Codingns4DSH)** · **[npm](https://www.npmjs.com/package/@jingyi0605/codingns4dsh)** · **QQ 群 1092985965** · **[微信群 / QQ 群二维码](#交流群)**
17
17
 
@@ -244,7 +244,7 @@ DSH 原生会话的翻译默认关闭,可在会话模型选择菜单中开启
244
244
  ### 使用内置 Web 配置
245
245
 
246
246
  ```bash
247
- dsh plugin --profile web add @jingyi0605/codingns4dsh@0.2.2-beta.3
247
+ dsh plugin --profile web add @jingyi0605/codingns4dsh@0.2.2-beta.5
248
248
  dsh web
249
249
  ```
250
250
 
@@ -254,7 +254,7 @@ dsh web
254
254
 
255
255
  ```bash
256
256
  dsh codingns --from-default-profile web --dump-config
257
- dsh plugin --profile codingns add @jingyi0605/codingns4dsh@0.2.2-beta.3
257
+ dsh plugin --profile codingns add @jingyi0605/codingns4dsh@0.2.2-beta.5
258
258
  dsh codingns
259
259
  ```
260
260
 
@@ -303,7 +303,7 @@ dsh codingns
303
303
  </table>
304
304
  </div>
305
305
 
306
- 微信群二维码由微信动态生成,**7 天内有效**(本图截取自 2026-10-21,标注「10 月 28 日前」有效),过期后重新进入群分享页会得到新码,也可在 [GitHub Issues](https://github.com/jingyi0605/Codingns4DSH/issues) 留言索取;QQ 群二维码与群号长期有效。
306
+ 微信群二维码由微信动态生成,**7 天内有效**(本图截取自 2026-11-06,标注「11 月 13 日前」有效),过期后重新进入群分享页会得到新码,也可在 [GitHub Issues](https://github.com/jingyi0605/Codingns4DSH/issues) 留言索取;QQ 群二维码与群号长期有效。
307
307
 
308
308
  ---
309
309
 
@@ -5704,7 +5704,7 @@ window.__ModuleLoader__.load({
5704
5704
  return /^0\.1\.5(?:-|$)/u.test(version);
5705
5705
  }
5706
5706
  /** Codingns4DSH 插件自身的 npm 版本。 */
5707
- const CODINGNS_VERSION = "0.2.2-beta.3";
5707
+ const CODINGNS_VERSION = "0.2.2-beta.5";
5708
5708
  /** Accept any valid host version at or above the supported minimum. */
5709
5709
  function isDshVersionCompatible(version) {
5710
5710
  return isDshVersionAtLeast(version, minimumSupportedDshVersion());
@@ -21288,6 +21288,7 @@ window.__ModuleLoader__.load({
21288
21288
  return {
21289
21289
  kind: "legacy",
21290
21290
  mount: (register) => register(),
21291
+ mountAssistant: (register) => register(),
21291
21292
  projectText: exports.projectUserText,
21292
21293
  userContent: () => null,
21293
21294
  images: (owner, props) => owner.renderMessageImages(props)
@@ -21299,6 +21300,11 @@ window.__ModuleLoader__.load({
21299
21300
  return {
21300
21301
  kind: "factory",
21301
21302
  mount: (register) => slots.inject("conversation.user.text.node", () => slots.inject("conversation.chat.user.images", register)),
21303
+ mountAssistant: (register) => {
21304
+ const registry = slots;
21305
+ if (typeof registry.entries !== "function" || typeof registry.subscribe !== "function") return register();
21306
+ return followPresentationEntry(registry, "conversation.chat.node", (entry) => entry.options.key === "assistant-step" && (entry.options.priority ?? 0) >= 0, (entry) => register(entry.inject));
21307
+ },
21302
21308
  projectText: () => null,
21303
21309
  userContent: (owner, content, facts) => owner.renderFactorySlot("conversation.chat.user.content", {
21304
21310
  content,
@@ -21859,6 +21865,7 @@ window.__ModuleLoader__.load({
21859
21865
  const CLAUDE_PERFORMANCE_PROJECTION = "codingnsClaudeStats";
21860
21866
  const GROK_PERFORMANCE_PROJECTION = "codingnsGrokStats";
21861
21867
  const GROK_CONTEXT_PROJECTION = "codingnsGrokContext";
21868
+ const PI_PERFORMANCE_PROJECTION = "codingnsPiStats";
21862
21869
  // src/dsh-capabilities/client/composer-slot-selectors.ts
21863
21870
  /** Keep DOM consumers aligned with the context presentation's owned child slots. */
21864
21871
  function contextComposerSlotName(name) {
@@ -21960,8 +21967,8 @@ window.__ModuleLoader__.load({
21960
21967
  useProjection: (key, ...args) => {
21961
21968
  const original = props.useProjection(key, ...args);
21962
21969
  if (key !== "sessionStats") return original;
21963
- const value = props.useProjection(adapter === "grok" ? GROK_PERFORMANCE_PROJECTION : adapter === "claude-code" ? CLAUDE_PERFORMANCE_PROJECTION : CODEX_PERFORMANCE_PROJECTION, ...args);
21964
- if (adapter !== "codex" && adapter !== "grok" && adapter !== "claude-code") return original;
21970
+ const value = props.useProjection(adapter === "grok" ? GROK_PERFORMANCE_PROJECTION : adapter === "claude-code" ? CLAUDE_PERFORMANCE_PROJECTION : adapter === "pi" ? PI_PERFORMANCE_PROJECTION : CODEX_PERFORMANCE_PROJECTION, ...args);
21971
+ if (adapter !== "codex" && adapter !== "grok" && adapter !== "claude-code" && adapter !== "pi") return original;
21965
21972
  return value ?? {
21966
21973
  turns: 0,
21967
21974
  steps: 0,
@@ -29239,7 +29246,14 @@ window.__ModuleLoader__.load({
29239
29246
  .codingns-magpie-page{--mp-topbar-pad-x:16px;--mp-topbar-pad-y:0px;--mp-leading-inset:0px;padding-left:var(--dsh-frame-leading-clearance,0px)}
29240
29247
  .codingns-magpie-topbar{padding-right:var(--mp-topbar-pad-x);padding-left:calc(var(--mp-topbar-pad-x) + var(--mp-leading-inset))}
29241
29248
  html[data-codingns-mobile-sidebar="on"] .codingns-magpie-page{padding-left:0;--mp-leading-inset:max(0px,calc(var(--dsh-frame-leading-clearance,0px) - 20px))}
29242
- @media(max-width:900px){.codingns-magpie-topbar{--mp-topbar-pad-x:14px;--mp-topbar-pad-y:9px}.codingns-magpie-topbar-left{margin-left:calc(-1 * var(--mp-leading-inset))}}
29249
+ /* DSH 0.2.2 narrow-screen drawer mode: the sidebar is an overlay drawer, and DSH pads a
29250
+ global panel's top by 48px (minus the window top clearance) so content starts below its
29251
+ floating toggle button. Instead of leaving that strip empty, pull the page up into it so
29252
+ the tab bar shares the toggle button's row, and start that row after the button via the
29253
+ leading clearance DSH publishes (--mp-leading-inset = clearance - topbar padding). The
29254
+ page is not indented as a whole. Kept after the rule above (same specificity) so it wins
29255
+ when both modes are active. */
29256
+ html [data-sidebar-drawer] .codingns-magpie-page{--mp-pull:max(0px,calc(48px - var(--dsh-frame-top-clearance,0px)));--mp-leading-inset:max(0px,calc(var(--dsh-frame-leading-clearance,0px) - 12px));padding-left:0;margin-top:calc(-1 * var(--mp-pull));height:calc(100% + var(--mp-pull))}@media(max-width:900px){.codingns-magpie-topbar{--mp-topbar-pad-x:14px;--mp-topbar-pad-y:9px}.codingns-magpie-topbar-left{margin-left:calc(-1 * var(--mp-leading-inset))}}
29243
29257
  @media(max-width:650px){.codingns-magpie-topbar{--mp-topbar-pad-x:12px;--mp-topbar-pad-y:8px}.codingns-magpie-icon-button{width:36px;height:36px}.codingns-magpie-toolbar:not(.has-tabs){display:none}.codingns-magpie-view{padding:14px 12px 30px}.codingns-magpie-statstrip{grid-template-columns:repeat(2,minmax(0,1fr))}.codingns-magpie-statcell{padding:13px;border-left:0}.codingns-magpie-statcell:nth-child(2n){border-left:.5px solid var(--mp-line)}.codingns-magpie-statcell:nth-child(n+3){border-top:.5px solid var(--mp-line)}.codingns-magpie-statcell:last-child:nth-child(odd){grid-column:1/-1}.codingns-magpie-statcell-value{font-size:${uiFontSize(22)}}.codingns-magpie-barchart-plot{height:132px}.codingns-magpie-barchart-axis{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:0;overflow:hidden;font-size:${uiFontSize(9)}}.codingns-magpie-barchart-tick{overflow:hidden;text-overflow:clip}}
29244
29258
  .codingns-magpie-reqlist{display:none}
29245
29259
  .codingns-magpie-reqcard{display:flex;flex-direction:column;gap:5px;padding:11px 14px;border-top:.5px solid var(--mp-line)}
@@ -32193,7 +32207,7 @@ html[data-codingns-mobile-sidebar="on"] .codingns-magpie-page{padding-left:0;--m
32193
32207
  sessionId: props.sessionId?.trim() ?? "",
32194
32208
  adapterId,
32195
32209
  ...providerId === null ? {} : { providerId }
32196
- }) : await require_magpie_model_tag.callCliRpc(props.rpc, "magpie/usage/reset", { user: resetTargetUser });
32210
+ }) : await callMagpieRpc(props.rpc, "usage/reset", { user: resetTargetUser });
32197
32211
  if (result === null) throw new Error(t("usage.resetFailed"));
32198
32212
  setResetResult(result.outcome);
32199
32213
  if (adapterId !== null) invalidateSubscriptionUsageCache(subscriptionUsageCache, adapterId, providerId);
@@ -32216,7 +32230,7 @@ html[data-codingns-mobile-sidebar="on"] .codingns-magpie-page{padding-left:0;--m
32216
32230
  const key = `${user}:${policy}`;
32217
32231
  if (magpiePolicyPending !== null) return;
32218
32232
  setMagpiePolicyPending(key);
32219
- require_magpie_model_tag.callCliRpc(props.rpc, "magpie/usage/account/update", {
32233
+ callMagpieRpc(props.rpc, "usage/account/update", {
32220
32234
  user,
32221
32235
  policy,
32222
32236
  enabled
@@ -32417,7 +32431,7 @@ html[data-codingns-mobile-sidebar="on"] .codingns-magpie-page{padding-left:0;--m
32417
32431
  [t("usage.magpieCacheReadTokens"), formatMagpieTokenCount(usage.aggregate.cacheReadTokens) ?? t("usage.upstreamNotProvided")],
32418
32432
  [t("usage.magpieCacheWriteTokens"), formatMagpieTokenCount(usage.aggregate.cacheWriteTokens) ?? t("usage.upstreamNotProvided")],
32419
32433
  [t("usage.magpieTotalTokens"), formatMagpieTokenCount(sumKnownCounts(usage.aggregate.inputTokens, usage.aggregate.outputTokens))],
32420
- [t("usage.magpieCacheHitRate"), formatMagpieCacheHitRate(usage.aggregate.inputTokens, usage.aggregate.cacheReadTokens) ?? t("usage.upstreamNotProvided")],
32434
+ [t("usage.magpieCacheHitRate"), formatMagpieCacheHitRate(usage.aggregate.inputTokens, usage.aggregate.cacheReadTokens, usage.aggregate.cacheWriteTokens, usage.aggregate.cacheUnknownTokens) ?? t("usage.upstreamNotProvided")],
32421
32435
  [t("usage.magpieCost"), formatMagpieCost(usage.aggregate.costUsd)]
32422
32436
  ];
32423
32437
  const sessionRows = usage.session === null ? [] : [
@@ -32428,7 +32442,7 @@ html[data-codingns-mobile-sidebar="on"] .codingns-magpie-page{padding-left:0;--m
32428
32442
  [t("usage.magpieCacheReadTokens"), formatMagpieTokenCount(usage.session.cacheReadTokens) ?? t("usage.upstreamNotProvided")],
32429
32443
  [t("usage.magpieCacheWriteTokens"), formatMagpieTokenCount(usage.session.cacheWriteTokens) ?? t("usage.upstreamNotProvided")],
32430
32444
  [t("usage.magpieTotalTokens"), formatMagpieTokenCount(sumKnownCounts(usage.session.inputTokens, usage.session.outputTokens))],
32431
- [t("usage.magpieCacheHitRate"), formatMagpieCacheHitRate(usage.session.inputTokens, usage.session.cacheReadTokens) ?? t("usage.upstreamNotProvided")],
32445
+ [t("usage.magpieCacheHitRate"), formatMagpieCacheHitRate(usage.session.inputTokens, usage.session.cacheReadTokens, usage.session.cacheWriteTokens, usage.session.cacheUnknownTokens) ?? t("usage.upstreamNotProvided")],
32432
32446
  [t("usage.magpieCost"), formatMagpieCost(usage.session.costUsd)]
32433
32447
  ];
32434
32448
  const quotas = usage.quotas ?? [];
@@ -32845,9 +32859,9 @@ html[data-codingns-mobile-sidebar="on"] .codingns-magpie-page{padding-left:0;--m
32845
32859
  function formatMagpieCost(value) {
32846
32860
  return value === null ? null : `$${value.toFixed(value >= .01 ? 2 : 4)}`;
32847
32861
  }
32848
- function formatMagpieCacheHitRate(inputTokens, cacheReadTokens) {
32849
- if (inputTokens === null || cacheReadTokens === null) return null;
32850
- const totalPromptTokens = inputTokens + cacheReadTokens;
32862
+ function formatMagpieCacheHitRate(inputTokens, cacheReadTokens, cacheWriteTokens, cacheUnknownTokens) {
32863
+ if (inputTokens === null || cacheReadTokens === null || cacheWriteTokens === null || cacheUnknownTokens === null) return null;
32864
+ const totalPromptTokens = inputTokens + cacheReadTokens + cacheWriteTokens - (cacheUnknownTokens ?? 0);
32851
32865
  return totalPromptTokens <= 0 ? null : formatSub2ApiPercent(cacheReadTokens / totalPromptTokens * 100);
32852
32866
  }
32853
32867
  function sumKnownCounts(left, right) {
@@ -34831,7 +34845,7 @@ html[data-codingns-mobile-sidebar="on"] .codingns-magpie-page{padding-left:0;--m
34831
34845
  stroke: "currentColor",
34832
34846
  strokeWidth: 2,
34833
34847
  "aria-hidden": true
34834
- }, (0, react.createElement)("path", { d: "M7 8h10" }), (0, react.createElement)("path", { d: "M7 12h8" }), (0, react.createElement)("path", { d: "M7 16h5" }), (0, react.createElement)("path", { d: "M5 5h14v14H9l-4 4V5z" }))), open && (0, react.createElement)("div", {
34848
+ }, (0, react.createElement)("path", { d: "M7 8h10" }), (0, react.createElement)("path", { d: "M7 12h8" }), (0, react.createElement)("path", { d: "M7 16h5" }), (0, react.createElement)("path", { d: "M5 5h14v14H9l-4 4V5z" }))), open && renderInBody((0, react.createElement)("div", {
34835
34849
  className: "codingns4dsh-quick-phrase-overlay",
34836
34850
  role: "dialog",
34837
34851
  "aria-label": t("workspace.quickPhrasesDialogLabel"),
@@ -34907,7 +34921,7 @@ html[data-codingns-mobile-sidebar="on"] .codingns-magpie-page{padding-left:0;--m
34907
34921
  title: t("workspace.quickPhrasesDelete"),
34908
34922
  onClick: () => removePhrase(phrase.id),
34909
34923
  style: quickPhraseDeleteStyle
34910
- }, "×")))))), addOpen && (0, react.createElement)("div", {
34924
+ }, "×"))))))), addOpen && renderInBody((0, react.createElement)("div", {
34911
34925
  className: "codingns4dsh-quick-phrase-overlay",
34912
34926
  role: "dialog",
34913
34927
  "aria-label": t("workspace.quickPhrasesAddDialogLabel"),
@@ -34956,7 +34970,14 @@ html[data-codingns-mobile-sidebar="on"] .codingns-magpie-page{padding-left:0;--m
34956
34970
  disabled: saving || newPhrase.trim() === "",
34957
34971
  onClick: addPhrase,
34958
34972
  style: quickPhraseAddButtonStyle
34959
- }, t("workspace.quickPhrasesAdd"))))));
34973
+ }, t("workspace.quickPhrasesAdd")))))));
34974
+ }
34975
+ /**
34976
+ * 弹层挂到 body 下。宿主工具栏行带 `container-type: inline-size`(布局包含),
34977
+ * 会让 position:fixed 的后代相对该行定位而不是视口,导致弹层位置漂移。
34978
+ */
34979
+ function renderInBody(node) {
34980
+ return typeof document === "undefined" ? node : (0, import_react_dom.createPortal)(node, document.body);
34960
34981
  }
34961
34982
  function findAddButton(root) {
34962
34983
  let scope = root.parentElement;
@@ -60603,8 +60624,9 @@ button[${ACCOUNT_ATTRIBUTE}]:focus-visible{outline:2px solid ${dshThemeColor.lab
60603
60624
  /**
60604
60625
  * 在 DSH 原生"添加工作区"对话框里追加一个"远程 HOST"标签页。
60605
60626
  *
60606
- * 原生对话框由 `@deepseek-ai/dsh-client-ui-directory-picker-browse` 通过
60607
- * `sidebar.workspaces.directoryFlow`(single 插槽)渲染。single 插槽只能有一个
60627
+ * When the adaptive picker resolves to the browse surface,
60628
+ * `@deepseek-ai/dsh-client-ui-directory-picker-browse` renders the dialog through
60629
+ * `sidebar.workspaces.directoryFlow` (the single slot). That slot can have only one
60608
60630
  * 胜出者,抢占它等于整个替换原生组件——而用户要的是**原生主体保持不变**,只多
60609
60631
  * 一个入口。因此这里不碰插槽,改为在原生对话框的 DOM 上就地追加标签页:
60610
60632
  *
@@ -64952,7 +64974,8 @@ button[${ACCOUNT_ATTRIBUTE}]:focus-visible{outline:2px solid ${dshThemeColor.lab
64952
64974
  } : void 0;
64953
64975
  const mentions = fileOwner === void 0 || typeof props.fileMentions !== "function" ? void 0 : props.fileMentions(fileOwner);
64954
64976
  const turnProcess = props.turnProcess;
64955
- const reasoningHidden = turnProcess !== void 0 && turnProcess.foldable === true && turnProcess.spec?.answerStep === data.step && turnProcess.spec?.inlineReasoning === true && turnProcess.open !== true;
64977
+ const keepReplies = props.usePresentation?.((policy) => policy.foldedReplies === "all") === true;
64978
+ const reasoningHidden = turnProcess !== void 0 && turnProcess.foldable === true && (keepReplies ? props.groupPart !== "reasoning" : turnProcess.spec?.answerStep === data.step && turnProcess.spec?.inlineReasoning === true) && turnProcess.open !== true;
64956
64979
  const rendered = [];
64957
64980
  const last = blocks.length - 1;
64958
64981
  const messageId = `turn-${data.turn}-step-${data.step}`;
@@ -64995,6 +65018,7 @@ button[${ACCOUNT_ATTRIBUTE}]:focus-visible{outline:2px solid ${dshThemeColor.lab
64995
65018
  hidden: reasoningHidden,
64996
65019
  reveal: () => turnProcess?.setOpen?.(true),
64997
65020
  useGroupAction: props.useGroupAction,
65021
+ useDisclosure: props.useDisclosure,
64998
65022
  renderFactorySlot: props.renderFactorySlot,
64999
65023
  markdownLabels,
65000
65024
  pathImages,
@@ -65074,7 +65098,7 @@ button[${ACCOUNT_ATTRIBUTE}]:focus-visible{outline:2px solid ${dshThemeColor.lab
65074
65098
  }));
65075
65099
  }
65076
65100
  function AssistantReasoningBlock(props) {
65077
- const [expanded, setExpanded] = (0, react.useState)(false);
65101
+ const { expanded, toggle } = (props.useDisclosure ?? useReasoningDisclosure)();
65078
65102
  const groupRef = props.useGroupAction?.(props.hidden, props.reveal);
65079
65103
  const { record } = useOutputTranslation({
65080
65104
  ...props,
@@ -65093,7 +65117,7 @@ button[${ACCOUNT_ATTRIBUTE}]:focus-visible{outline:2px solid ${dshThemeColor.lab
65093
65117
  expandable: true,
65094
65118
  expandOnRowClick: true,
65095
65119
  running: props.running,
65096
- onToggle: () => setExpanded((value) => !value),
65120
+ onToggle: toggle,
65097
65121
  collapsedContent: (0, react.createElement)("span", { style: {
65098
65122
  minWidth: 0,
65099
65123
  overflow: "hidden",
@@ -65119,6 +65143,13 @@ button[${ACCOUNT_ATTRIBUTE}]:focus-visible{outline:2px solid ${dshThemeColor.lab
65119
65143
  ...props.renderFactorySlot === void 0 ? {} : { renderFactorySlot: props.renderFactorySlot }
65120
65144
  }) : null));
65121
65145
  }
65146
+ function useReasoningDisclosure() {
65147
+ const [expanded, setExpanded] = (0, react.useState)(false);
65148
+ return {
65149
+ expanded,
65150
+ toggle: () => setExpanded((value) => !value)
65151
+ };
65152
+ }
65122
65153
  /**
65123
65154
  * 思考块展开后的正文。
65124
65155
  *
@@ -65212,20 +65243,13 @@ button[${ACCOUNT_ATTRIBUTE}]:focus-visible{outline:2px solid ${dshThemeColor.lab
65212
65243
  };
65213
65244
  const presentation = resolution.value;
65214
65245
  const removeRenderers = presentation.mount(() => {
65215
- const renderers = [
65216
- ["user", (props) => UserMessageNodeView({
65217
- ...props,
65218
- presentation
65219
- })],
65220
- ["steering", (props) => UserMessageNodeView({
65221
- ...props,
65222
- presentation
65223
- })],
65224
- ["assistant-step", (props) => AssistantTranslationNodeView({
65225
- ...props,
65226
- presentation
65227
- })]
65228
- ];
65246
+ const renderers = [["user", (props) => UserMessageNodeView({
65247
+ ...props,
65248
+ presentation
65249
+ })], ["steering", (props) => UserMessageNodeView({
65250
+ ...props,
65251
+ presentation
65252
+ })]];
65229
65253
  const removers = [];
65230
65254
  try {
65231
65255
  for (const [key, component] of renderers) removers.push(slots.inject("conversation.chat.node", () => slots.register({
@@ -65239,6 +65263,21 @@ button[${ACCOUNT_ATTRIBUTE}]:focus-visible{outline:2px solid ${dshThemeColor.lab
65239
65263
  translationT
65240
65264
  })
65241
65265
  }, component)));
65266
+ removers.push(presentation.mountAssistant((nativeInject) => slots.inject("conversation.chat.node", () => slots.register({
65267
+ name: "conversation.chat.node",
65268
+ key: "assistant-step",
65269
+ priority: -100,
65270
+ locale: "chat",
65271
+ inject: (sessionId) => ({
65272
+ hooks: nativeInject?.(sessionId).hooks,
65273
+ services,
65274
+ sessionId,
65275
+ translationT
65276
+ })
65277
+ }, (props) => AssistantTranslationNodeView({
65278
+ ...props,
65279
+ presentation
65280
+ })))));
65242
65281
  } catch (error) {
65243
65282
  for (const remove of removers.reverse()) remove();
65244
65283
  throw error;
@@ -67398,7 +67437,7 @@ button.${settingsPromoClass.version}:focus-visible{${focusRing}}
67398
67437
  return (0, react.createElement)("aside", {
67399
67438
  className: settingsPromoClass.root,
67400
67439
  "aria-label": t("settings.promo.sectionLabel")
67401
- }, (0, react.createElement)("div", { className: settingsPromoClass.row }, (0, react.createElement)("div", { className: settingsPromoClass.brand }, (0, react.createElement)("div", { className: settingsPromoClass.headline }, (0, react.createElement)(StarBurstIcon, { className: settingsPromoClass.logo }), (0, react.createElement)("h3", { className: settingsPromoClass.title }, t("common.brand"))), versionControl ?? (0, react.createElement)("span", { className: settingsPromoClass.version }, t("settings.promo.version", { version: "0.2.2-beta.3" }))), (0, react.createElement)("p", { className: settingsPromoClass.text }, t("settings.promo.starHint"), (0, react.createElement)("span", {
67440
+ }, (0, react.createElement)("div", { className: settingsPromoClass.row }, (0, react.createElement)("div", { className: settingsPromoClass.brand }, (0, react.createElement)("div", { className: settingsPromoClass.headline }, (0, react.createElement)(StarBurstIcon, { className: settingsPromoClass.logo }), (0, react.createElement)("h3", { className: settingsPromoClass.title }, t("common.brand"))), versionControl ?? (0, react.createElement)("span", { className: settingsPromoClass.version }, t("settings.promo.version", { version: "0.2.2-beta.5" }))), (0, react.createElement)("p", { className: settingsPromoClass.text }, t("settings.promo.starHint"), (0, react.createElement)("span", {
67402
67441
  className: settingsPromoClass.hand,
67403
67442
  "aria-hidden": true
67404
67443
  }, "👉")), (0, react.createElement)("a", {
@@ -67455,7 +67494,7 @@ button.${settingsPromoClass.version}:focus-visible{${focusRing}}
67455
67494
  };
67456
67495
  }
67457
67496
  // src/client/update-store.ts
67458
- const DEFAULT_PLUGIN_UPDATE_CHANNEL = "0.2.2-beta.3".includes("-") ? "next" : "latest";
67497
+ const DEFAULT_PLUGIN_UPDATE_CHANNEL = "0.2.2-beta.5".includes("-") ? "next" : "latest";
67459
67498
  var PluginUpdateStore = class {
67460
67499
  rpc;
67461
67500
  snapshot = {
@@ -80576,5 +80615,5 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
80576
80615
  });
80577
80616
 
80578
80617
  })();
80579
- // codingns-client-revision: d7fd015acf2d836861bd6b30c51a1e95a0599cbafa97f7df0d821837435e8b72
80618
+ // codingns-client-revision: e627b9da29c6eef291a1bf042b69358125f84bfd58198b49aac81bead77fce87
80580
80619
  //# sourceMappingURL=bundle.js.map