@ch4acko3/dsh-turn-fold 0.5.0 → 0.5.2

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
@@ -36,10 +36,9 @@ short open/close transition that unmounts the activity after it closes.
36
36
 
37
37
  Three shape-guarded Source Patches run in memory against the compiled browser
38
38
  bundle of `@deepseek-ai/dsh-client-ui-conversation` (`lib/client.js`) from
39
- `0.1.0-rc.8` up to, but not including, the `0.2.0` prerelease line; installed
40
- DSH files are never modified. Every selector must still match exactly once, so
41
- an incompatible compiled shape fails closed instead of modifying an uncertain
42
- target.
39
+ `0.1.0-rc.8` through `0.1.1-rc.2`; installed DSH files are never modified.
40
+ Every selector must still match exactly once, so an incompatible compiled shape
41
+ fails closed instead of modifying an uncertain target.
43
42
 
44
43
  | Patch | Selector (expect 1) | Effect |
45
44
  | --- | --- | --- |
package/README.zh-CN.md CHANGED
@@ -16,7 +16,7 @@ https://github.com/user-attachments/assets/3c9dfdcf-a454-4750-9edf-76771ed5a9a6
16
16
 
17
17
  ## 工作原理
18
18
 
19
- 三个带形状校验的 Source Patch 会在内存中修改 `@deepseek-ai/dsh-client-ui-conversation` `>=0.1.0-rc.8 <0.2.0-0` 的编译后浏览器包(`lib/client.js`),不会修改已安装的 DSH 文件。每条选择器仍必须恰好命中一次,因此遇到不兼容的编译形状时会停止应用,而不会修改不确定的目标。
19
+ 三个带形状校验的 Source Patch 会在内存中修改 `@deepseek-ai/dsh-client-ui-conversation` 从 DSH `0.1.0-rc.8` 至 `0.1.1-rc.2` 的编译后浏览器包(`lib/client.js`),不会修改已安装的 DSH 文件。每条选择器仍必须恰好命中一次,因此遇到不兼容的编译形状时会停止应用,而不会修改不确定的目标。
20
20
 
21
21
  | Patch | 选择器(预期命中 1 次) | 作用 |
22
22
  | --- | --- | --- |
package/inline-source.cjs CHANGED
@@ -1207,7 +1207,14 @@ function __ch4acko3DshTurnFoldRender(props) {
1207
1207
  loc = node.location;
1208
1208
  var isTurn = loc !== void 0 && (loc.kind === "turn" || loc.kind === "step");
1209
1209
  plan = isTurn ? plans.get(loc.turn.turn) : void 0;
1210
- var foldable = plan !== void 0 && plan.status === "closed" && (plan.endReason === "completed" || plan.endReason === "aborted" || plan.endReason === "interrupted") && !plan.hasError && !plan.branchUnavailable && !plan.hasAfterClosing && plan.closingKey !== void 0 && (plan.activity.length > 0 || plan.closingReasoning.length > 0) && !plan.activity.some(function (activityKey) { return interactionKeys.has(activityKey); });
1210
+ var turnFoldKey = plan === void 0 ? null : String(sessionId) + ":" + plan.turn;
1211
+ // Preserve an in-progress selection only when folding would newly hide one
1212
+ // of its rows. Text already visible inside an open disclosure, or promoted
1213
+ // image results that stay outside it, must not dismantle the fold on rerender.
1214
+ var interactionBlocksFold = plan !== void 0 && turnFoldKey !== null && !__ch4acko3DshTurnFoldOpenKeys.has(turnFoldKey) && plan.activity.some(function (activityKey) {
1215
+ return interactionKeys.has(activityKey) && !__ch4acko3DshTurnFoldIsPromotableImageResult(nodeStore.get(activityKey));
1216
+ });
1217
+ var foldable = plan !== void 0 && plan.status === "closed" && (plan.endReason === "completed" || plan.endReason === "aborted" || plan.endReason === "interrupted") && !plan.hasError && !plan.branchUnavailable && !plan.hasAfterClosing && plan.closingKey !== void 0 && (plan.activity.length > 0 || plan.closingReasoning.length > 0) && !interactionBlocksFold;
1211
1218
  if (foldable && FOLD_KINDS[node.kind] === true && key !== plan.closingKey) continue;
1212
1219
  var summaryAnchor = plan === void 0 ? void 0 : plan.closingKey !== void 0 && (plan.firstActivityOrder < 0 || plan.closingOrder < plan.firstActivityOrder) ? plan.closingKey : plan.activity[0];
1213
1220
  if (plan !== void 0 && !foldable && summaryAnchor !== void 0 && key === summaryAnchor) {
@@ -1232,7 +1239,7 @@ function __ch4acko3DshTurnFoldRender(props) {
1232
1239
  orderPositions: orderPositions,
1233
1240
  sessionId: sessionId,
1234
1241
  termination: plan.endReason === "aborted" || plan.endReason === "interrupted" ? plan.endReason : void 0,
1235
- foldKey: String(sessionId) + ":" + plan.turn,
1242
+ foldKey: turnFoldKey,
1236
1243
  renderNode: renderNode,
1237
1244
  t: props.t
1238
1245
  }, "ch4acko3-dsh-turn-fold-" + String(sessionId) + "-" + plan.turn) });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ch4acko3/dsh-turn-fold",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "Codex-style turn folding for the DSH WebUI conversation, implemented as a dsh-harmony provider.",
5
5
  "main": "./index.cjs",
6
6
  "engines": {
@@ -55,15 +55,26 @@
55
55
  "@deepseek-ai/schemastery": "^3.18.1"
56
56
  },
57
57
  "peerDependencies": {
58
- "@deepseek-ai/dsh-client-ui-conversation": "^0.1.0-rc.8 || ^0.1.1-0",
59
- "@deepseek-ai/dsh-settings": "^0.1.0-rc.8 || ^0.1.1-0",
60
- "dsh-harmony": "^0.7.0 || ^0.8.0"
58
+ "@deepseek-ai/dsh-client-ui-conversation": ">=0.1.0-rc.8 <=0.1.1-rc.2",
59
+ "@deepseek-ai/dsh-settings": ">=0.1.0-rc.8 <=0.1.1-rc.2",
60
+ "dsh-harmony": "^0.8.10"
61
+ },
62
+ "peerDependenciesMeta": {
63
+ "@deepseek-ai/dsh-client-ui-conversation": {
64
+ "optional": true
65
+ },
66
+ "@deepseek-ai/dsh-settings": {
67
+ "optional": true
68
+ },
69
+ "dsh-harmony": {
70
+ "optional": true
71
+ }
61
72
  },
62
73
  "devDependencies": {
63
- "@deepseek-ai/dsh-client-ui-conversation": "0.1.0-rc.8",
64
- "@deepseek-ai/dsh-settings": "0.1.0-rc.8",
74
+ "@deepseek-ai/dsh-client-ui-conversation": "0.1.1-rc.2",
75
+ "@deepseek-ai/dsh-settings": "0.1.1-rc.2",
65
76
  "@phenomnomnominal/tsquery": "^6.2.0",
66
- "dsh-harmony": "^0.8.0",
77
+ "dsh-harmony": "^0.8.10",
67
78
  "react": "18.3.1",
68
79
  "react-test-renderer": "18.3.1",
69
80
  "semver": "^7.8.5",
package/patch.cjs CHANGED
@@ -4,15 +4,6 @@
4
4
  // bundle of @deepseek-ai/dsh-client-ui-conversation (lib/client.js). They never
5
5
  // modify the installed package.
6
6
  //
7
- // 1. inject-turn-fold-runtime — injects the fold renderer + disclosure UI
8
- // into the module factory, immediately before the ChatView component.
9
- // 2. rewrite-node-render-loop — replaces the `order.map(...)` node render
10
- // loop with a call to the injected renderer, which groups a completed
11
- // turn's agent activity into a collapsible disclosure while keeping the
12
- // final answer (turn-tail.closing.finalNode) and the turn tail visible.
13
- // 3. install-turn-fold-services — registers the plugin's native DSH locale
14
- // namespace and binds its native settings scope during conversation boot.
15
- //
16
7
  // All three selectors use an exact `expect: 1` inside a bounded target-version
17
8
  // range, so a compiled-shape drift still fails loudly in `dsh harmony status`.
18
9
 
@@ -20,7 +11,7 @@ const INLINE = require('./inline-source.cjs')
20
11
 
21
12
  const TARGET = {
22
13
  package: '@deepseek-ai/dsh-client-ui-conversation',
23
- version: '>=0.1.0-rc.8 <0.2.0-0',
14
+ version: '>=0.1.0-rc.8 <=0.1.1-rc.2',
24
15
  file: 'lib/client.js',
25
16
  }
26
17