dsh-packycode-api 1.2.1 → 1.2.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.2.2
4
+
5
+ - Fixed the remaining missing-gallery bug in 1.2.1. Real native `tool/result` and nested `tool/ptc-dispatch` records do not have `data.turn`; keying image contexts by that missing field separated image evidence from the actual `turn/end` context. Image contexts now use the tool call ID (or CLI message sequence) and obtain the owning turn and completion boundary from DSH's engine-provided Match Location. Results appear as soon as available and stay visible when history later supplies missing boundaries.
6
+ - Removed fabricated turn/step fields from the runtime regression fixture. Added the real DSH 0.2 Chat snapshot builder and grouping to the built-client path, plus multi-turn, interleaved-session and older-page-prepend regressions. A React/ReactDOM browser replay (`scripts/image-preview-check.mjs`) reproduces the published 1.2.1 bundle showing zero main-chat images while tool details can load the PNG; the corrected build displays both native/PTC image cards with details collapsed and retains them after history reload. No new paid generation or existing-session modification is needed.
7
+ - Validation, 2026-10-15: 381 offline tests, both bundles and the 1.2.2 tarball. Browser comparison used the published 1.2.1 client and the corrected client against the same raw native/PTC events and real DSH 0.2.0-rc.2 Chat assembly/grouping: the old client rendered zero main-chat images with a loadable tool-detail image; the new client rendered both PNGs with details collapsed and after history reload. The final browser replay uses React, ReactDOM and the JSX runtime with no console errors. The colleague's physical Intel Mac still needs an update-and-retest; no DSH process was restarted and no paid image request was made for this verification.
8
+
3
9
  ## 1.2.1
4
10
 
5
11
  - **Generated image visible only inside tool details.** DSH 0.2 treats custom Turn/Step nodes as foldable process content, so the chat gallery disappeared when completed work was collapsed. PTC also logs successful child images as `tool/ptc-dispatch` without root presentation metadata, which the gallery previously ignored. The gallery now recognizes this plugin's successful native/PTC/CLI results and renders a Session-level card anchored beside its owning answer, independent of process folding. Stored conversations replay the same image references; no log rewrite or paid regeneration is needed. Duplicate results for the same call are projected once. Tool instructions also tell models to use automatic image presentation instead of inventing Markdown image links to host paths or attachment IDs.
package/README.en.md CHANGED
@@ -51,7 +51,7 @@ Open the desktop application's **Plugins** page, click **Add plugin**, and enter
51
51
  dsh-packycode-api
52
52
  ```
53
53
 
54
- Choose the **official** install source, then click **Install**. To pin a version, enter `dsh-packycode-api@1.2.1`.
54
+ Choose the **official** install source, then click **Install**. To pin a version, enter `dsh-packycode-api@1.2.2`.
55
55
 
56
56
  A **first install requires no DSH restart**: open **Settings → PackyCode** and add a key immediately. When updating an already loaded older version, follow the restart guidance in the **Plugin version** card.
57
57
 
@@ -70,7 +70,7 @@ Choose a model from the `PackyCode` group. `deepseek-flash`, `gpt-6.1-sol`, `gpt
70
70
 
71
71
  The **Plugins** page shows the installed state and version, and is also where you enable, disable, or uninstall.
72
72
 
73
- **For non-desktop profiles only:** `dsh plugin --profile <name> add dsh-packycode-api@1.2.1`. Do not use it for `desktop` — the CLI refuses it (`profile "desktop" is managed exclusively by the Electron application`).
73
+ **For non-desktop profiles only:** `dsh plugin --profile <name> add dsh-packycode-api@1.2.2`. Do not use it for `desktop` — the CLI refuses it (`profile "desktop" is managed exclusively by the Electron application`).
74
74
 
75
75
  For a local checkout, keep the `link:` prefix: `dsh plugin --profile <name> add link:/path/to/dsh-packycode-api`. **Do not pass a bare path or `file:`** — that install copies the whole checkout, `node_modules` included, into the profile, where it then shadows the packages the DSH installation itself provides and the plugin looks uninstalled; see the FAQ. If you already installed that way, uninstall first and reinstall as above.
76
76
 
package/README.md CHANGED
@@ -51,7 +51,7 @@
51
51
  dsh-packycode-api
52
52
  ```
53
53
 
54
- 在**安装源**中选择**官方源**,然后点击**安装**。需要固定版本时填入 `dsh-packycode-api@1.2.1`。
54
+ 在**安装源**中选择**官方源**,然后点击**安装**。需要固定版本时填入 `dsh-packycode-api@1.2.2`。
55
55
 
56
56
  首次安装后**无需重启 DSH**,可直接打开**设置 → PackyCode** 添加 Key。更新已加载的旧版时,按「插件版本」卡片的重启提示操作。
57
57
 
@@ -70,7 +70,7 @@ dsh-packycode-api
70
70
 
71
71
  桌面应用的**插件**页可以看到已安装状态与版本,也可以在那里启用、停用或卸载。
72
72
 
73
- **仅用于非 desktop profile:** `dsh plugin --profile <name> add dsh-packycode-api@1.2.1`。不要对 `desktop` 使用它 —— CLI 会直接拒绝(`profile "desktop" is managed exclusively by the Electron application`)。
73
+ **仅用于非 desktop profile:** `dsh plugin --profile <name> add dsh-packycode-api@1.2.2`。不要对 `desktop` 使用它 —— CLI 会直接拒绝(`profile "desktop" is managed exclusively by the Electron application`)。
74
74
 
75
75
  本地开发要加 `link:` 前缀:`dsh plugin --profile <name> add link:/path/to/dsh-packycode-api`。**不要直接写路径(或 `file:`)** —— 那样的安装会把整个仓库目录(连同 `node_modules`)复制进 profile,之后它会在 profile 内部挡住 DSH 自带的包,插件看起来像没装,见「常见问题」。已经那样装过的话,先卸载再按上面的方式重装。
76
76
 
package/lib/client.js CHANGED
@@ -518,23 +518,26 @@ window.__ModuleLoader__.load({
518
518
  kind: IMAGE_CHAT_KIND,
519
519
  target: "chat",
520
520
  match(event) {
521
- return event.type === "turn/end" || successfulImages(event).length > 0 ? {
522
- id: String(event.data.turn),
521
+ const images = successfulImages(event);
522
+ if (images.length === 0) return null;
523
+ const id = event.type === "assistant/message" ? `cli:${event.seq}` : event.data?.subCallId ?? event.data?.message?.source?.callId ?? images[0].toolCallId ?? `event:${event.seq}`;
524
+ return {
525
+ id: String(id),
523
526
  role: "update"
524
- } : null;
527
+ };
525
528
  },
526
- start: () => void 0,
527
- update: (context) => context.state,
529
+ start: () => ({}),
530
+ update: (context) => context.state ?? {},
528
531
  buildViewNode(context) {
529
- const finished = context.matches.find((match) => match.event.type === "turn/end");
530
- if (finished === void 0) return null;
531
532
  const results = context.matches.filter((match) => successfulImages(match.event).length > 0);
532
533
  if (results.length === 0) return null;
534
+ const turn = (results.find((match) => match.location?.kind === "turn" || match.location?.kind === "step")?.location)?.turn;
535
+ const finished = turn?.end;
533
536
  const blocks = [...new Map(results.flatMap(({ event }) => successfulImages(event).map((block) => [block.toolCallId, {
534
537
  ...block,
535
538
  kind: "tool-result"
536
539
  }]))).values()];
537
- const answerSeq = finished.location.turn?.steps?.at(-1)?.data.get("assistant-step")?.finalNode?.seq;
540
+ const answerSeq = turn?.steps?.at(-1)?.data.get("assistant-step")?.finalNode?.seq;
538
541
  const lastImageSeq = Math.max(...results.map((match) => match.event.seq));
539
542
  return {
540
543
  key: context.key,
@@ -543,9 +546,9 @@ window.__ModuleLoader__.load({
543
546
  target: "chat",
544
547
  location: { kind: "session" },
545
548
  visibility: "visible",
546
- anchorSeq: answerSeq > lastImageSeq ? answerSeq + .025 : finished.event.seq - .025,
549
+ anchorSeq: answerSeq > lastImageSeq ? answerSeq + .025 : finished === void 0 ? lastImageSeq + .025 : finished.seq - .025,
547
550
  data: {
548
- turn: finished.event.data.turn,
551
+ ...turn === void 0 ? {} : { turn: turn.turn },
549
552
  blocks
550
553
  }
551
554
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-packycode-api",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "Use PackyCode API keys in DeepSeek Harness with multi-protocol models, image generation and editing, separate key rings, and balance display",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",
@@ -99,6 +99,7 @@
99
99
  "@earendil-works/pi-ai": "0.85.1",
100
100
  "packycode-host-v020-fixture": "file:tests/fixtures/host-v020",
101
101
  "react": "18.3.1",
102
+ "react-dom": "18.3.1",
102
103
  "tsdown": "0.22.2",
103
104
  "yaml": "2.9.1"
104
105
  },