dsh-packycode-api 1.4.0 → 1.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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.4.1
4
+
5
+ - **Session titles on `cc` keys name the conversation again.** From 1.4.0 Claude Code was asked to name an empty conversation, so cc sessions were titled "Untitled Session", "Empty Session", "Greeting" or "空白会话". DSH's title providers put the user's messages, as a JSON array, in one user message whose source is `dsh-session-title-llm`, and the cc route passes Claude Code only the text of messages with the user's own sources (`src/claude-user-text.js`). That message was dropped. The route's own naming instruction has the source `user`, so the request did not count as empty, and Haiku got DSH's title rules and the instruction with nothing between them. A title request now keeps its messages. Nothing of DSH's agent comes with them: DSH builds the input only from `user/message` events whose source is `user`. The input is no longer cut to 2,000 characters per message either. DSH bounds it (`maxInputBytes`, 4,096 bytes by default) and HTTP sends it whole, while the cut dropped the latest prompts from a refresh by DSH's experimental all-prompts provider. HTTP keys and other models were not affected.
6
+ - **Tests and live checks ask for titles as DSH does.** `tests/fixtures/dsh-session-title.mjs` copies the system prompt and the framing of DSH 0.2.1's title providers (`@deepseek-ai/dsh-session-title-first-prompt-llm`, and `@deepseek-ai/dsh-session-title-all-prompts-llm` with its current title) and the request `executeSessionTitleLlm` builds from them. The CLI, HTTP and title-model tests and the title checks of `scripts/claude-check.mjs` and `scripts/claude-agent-check.mjs` send it. Before, they sent the prompt as the user's own message, which is why 1.4.0's checks passed. The agent check's title must now name the request.
7
+ - Validation, 2026-10-26:
8
+ - **Offline:** 535 tests, both rebuilt bundles and the versioned tarball. On 1.4.0's transport the CLI title test fails at "the conversation to name reaches Claude Code", and its refresh case fails on the 2,000-character cut.
9
+ - **Live, on the cc route with the test key and Claude Code 2.1.295:** DSH's own title request for a Chinese warehouse-shipping prompt on each Claude model, all answered by Haiku. On 1.4.0 all 3 failed, titled "Greeting", "空白会话" and "空白会话". With the fix 9 of 9 passed over three rounds ("仓库发货安排核对", "仓库发货安排与缺货采购" and the like), with 0 client-anomaly refusals in 9 requests. The agent check's read scenario still passed on Haiku. Not yet checked in the desktop app.
10
+
3
11
  ## 1.4.0
4
12
 
5
13
  - **Claude sessions on `cc` keys are carried out by Claude Code itself, which ends the "客户端存在异常" refusals.** PackyCode's `cc` group judges each request's content, not the program that sends it. From 1.3.4 the official CLI carried DSH's own agent: its tools were off (`--tools ""`), DSH's system prompt ("You are an AI agent powered by DeepSeek Harness…") was appended, and DSH's tools were attached over a local MCP bridge. Users got 本轮运行失败 "我们检测到您的客户端存在异常…请避免任何基于我方 API 二次分发的 API 转接接入", and updating the CLI did not help.
package/README.en.md CHANGED
@@ -48,10 +48,10 @@ You need **DeepSeek Harness** and a **PackyCode (PackyAPI) API key**. For DSH se
48
48
  Open the desktop application's **Plugins** page, click **Add plugin**, and enter the package name **with a version** as the **package name or address**:
49
49
 
50
50
  ```text
51
- dsh-packycode-api@1.4.0
51
+ dsh-packycode-api@1.4.1
52
52
  ```
53
53
 
54
- Choose the **official** install source, then click **Install**. `1.4.0` was the latest release when this was written; the [npm page](https://www.npmjs.com/package/dsh-packycode-api) shows the current one.
54
+ Choose the **official** install source, then click **Install**. `1.4.1` was the latest release when this was written; the [npm page](https://www.npmjs.com/package/dsh-packycode-api) shows the current one.
55
55
 
56
56
  > **Always include the version.** With a bare `dsh-packycode-api`, the install prompt shows the newest version on npm, but DSH's bundled pnpm by default installs only versions published at least 24 hours ago, so you can end up several releases behind with no sign of it in the prompt. With an exact version, pnpm installs that version and adds it to the profile's `minimumReleaseAgeExclude` itself. Afterwards, check **Current version** under **Settings → PackyCode → Plugin version**.
57
57
 
@@ -72,7 +72,7 @@ Choose a model from the `PackyCode` group. All ten models use the plugin’s HTT
72
72
 
73
73
  The **Plugins** page shows the installed state and version, and is also where you enable, disable, or uninstall.
74
74
 
75
- **For non-desktop profiles only:** `dsh plugin --profile <name> add dsh-packycode-api@1.4.0`. Do not use it for `desktop` — the CLI refuses it (`profile "desktop" is managed exclusively by the Electron application`).
75
+ **For non-desktop profiles only:** `dsh plugin --profile <name> add dsh-packycode-api@1.4.1`. Do not use it for `desktop` — the CLI refuses it (`profile "desktop" is managed exclusively by the Electron application`).
76
76
 
77
77
  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.
78
78
 
@@ -268,9 +268,9 @@ DeepSeek Flash uses the gateway's Responses endpoint (`/api/pricing` lists `open
268
268
 
269
269
  ## Update and uninstall
270
270
 
271
- > **Upgrading from 1.3.2 or earlier:** install `dsh-packycode-api@1.4.0` on the Plugins page instead of clicking **Update plugin** in the old settings card. The old button bypasses pnpm's release-age policy: if the version it installs is less than 24 hours old, the profile refuses every other plugin install until that version is 24 hours old. After the install and a restart, the button is the fixed one, and later updates can use it.
271
+ > **Upgrading from 1.3.2 or earlier:** install `dsh-packycode-api@1.4.1` on the Plugins page instead of clicking **Update plugin** in the old settings card. The old button bypasses pnpm's release-age policy: if the version it installs is less than 24 hours old, the profile refuses every other plugin install until that version is 24 hours old. After the install and a restart, the button is the fixed one, and later updates can use it.
272
272
 
273
- **Update:** open **Settings → PackyCode** and, when a newer version is listed, click **Update plugin**. It installs that exact version into the owning profile with DSH's bundled pnpm and reads `package.json` back before reporting success. The install keeps pnpm's release-age policy instead of overriding it: by default pnpm installs the version at once and records it in the profile's `minimumReleaseAgeExclude`; under a stricter pnpm policy the button says when the update can run. The newer version is read from npm, while pnpm downloads it from the profile's own install source: right after a release that source (a regional mirror in particular) may not have it yet, and the button asks you to update again in a few minutes; when the source cannot be reached, it asks you to check the network or proxy. A local `link:` checkout does not get the button. Then quit and reopen the desktop application. A page refresh does not reload the Host. Reinstalling from the **Plugins** page works too, again with the version in the package name (for example `dsh-packycode-api@1.4.0`); without it you may get a version that is merely the newest one published at least 24 hours ago.
273
+ **Update:** open **Settings → PackyCode** and, when a newer version is listed, click **Update plugin**. It installs that exact version into the owning profile with DSH's bundled pnpm and reads `package.json` back before reporting success. The install keeps pnpm's release-age policy instead of overriding it: by default pnpm installs the version at once and records it in the profile's `minimumReleaseAgeExclude`; under a stricter pnpm policy the button says when the update can run. The newer version is read from npm, while pnpm downloads it from the profile's own install source: right after a release that source (a regional mirror in particular) may not have it yet, and the button asks you to update again in a few minutes; when the source cannot be reached, it asks you to check the network or proxy. A local `link:` checkout does not get the button. Then quit and reopen the desktop application. A page refresh does not reload the Host. Reinstalling from the **Plugins** page works too, again with the version in the package name (for example `dsh-packycode-api@1.4.1`); without it you may get a version that is merely the newest one published at least 24 hours ago.
274
274
 
275
275
  **Coming back from a local-path install, uninstall first.** An update is a `pnpm add`: it rewrites the files inside the package directory and leaves a `node_modules` that an earlier local-path install left there. That older tree keeps shadowing the packages the DSH installation provides, so the plugin row fails to load with no visible reason. **Uninstall** runs `pnpm remove`, which deletes the package directory outright — only a reinstall after that is clean. `node scripts/install-check.mjs` reports whether a profile is in that state.
276
276
 
@@ -286,7 +286,7 @@ ls ~/.dsh/profiles/desktop/node_modules/dsh-packycode-api/node_modules
286
286
 
287
287
  Output means a leftover tree: a registry install ships no `node_modules`, so this one usually comes from an earlier local-path install (`file:`, or a bare path instead of `link:`). It sits inside the profile directory, and DSH resolves a plugin's imports from inside the profile first, so the plugin gets those old copies — for example `@deepseek-ai/schemastery` 3.18.2, which has no `Schema.volatile()`, so the module throws while it is imported. When an import fails the Loader creates no fiber for that row and no client bundle is composed either, so the model route, the RPC channel, and the settings panel all stay absent.
288
288
 
289
- Recovery: **uninstall** the plugin on the **Plugins** page, **install** it again with the version in the package name (for example `dsh-packycode-api@1.4.0`), then quit and reopen the desktop application. Uninstall runs `pnpm remove` and deletes the whole package directory; reinstalling or clicking **Update** only rewrites files and keeps the leftover tree. Deleting that `node_modules` by hand and restarting works too.
289
+ Recovery: **uninstall** the plugin on the **Plugins** page, **install** it again with the version in the package name (for example `dsh-packycode-api@1.4.1`), then quit and reopen the desktop application. Uninstall runs `pnpm remove` and deletes the whole package directory; reinstalling or clicking **Update** only rewrites files and keeps the leftover tree. Deleting that `node_modules` by hand and restarting works too.
290
290
 
291
291
  **Right after a first install, every card in Settings shows `transport failure for /packycode-api/…: HTTP 405`?** The installed version is 1.1.6 or earlier, usually because only the bare package name was entered: the install prompt shows the newest version, but pnpm installs the newest one published at least 24 hours ago (see **Install the plugin**). Those older versions can register their settings channel only after DSH restarts and rebuilds its `connection` service. So right after a first install `/packycode-api` does not exist yet, requests fall through to the static page, and it answers 405; the model route and the settings panel itself load normally. From 1.1.7 on, a first install needs no restart. Check which version was installed:
292
292
 
package/README.md CHANGED
@@ -48,10 +48,10 @@
48
48
  打开桌面应用的**插件**页,点击**添加插件**,在**包名或地址**中填入**带版本号**的包名:
49
49
 
50
50
  ```text
51
- dsh-packycode-api@1.4.0
51
+ dsh-packycode-api@1.4.1
52
52
  ```
53
53
 
54
- 在**安装源**中选择**官方源**,然后点击**安装**。`1.4.0` 是写这份说明时的最新版,当前最新版本号以 [npm 页面](https://www.npmjs.com/package/dsh-packycode-api) 为准。
54
+ 在**安装源**中选择**官方源**,然后点击**安装**。`1.4.1` 是写这份说明时的最新版,当前最新版本号以 [npm 页面](https://www.npmjs.com/package/dsh-packycode-api) 为准。
55
55
 
56
56
  > **一定要带版本号。** 只填 `dsh-packycode-api` 时,安装前的提示显示的是 npm 上的最新版,但 DSH 自带的 pnpm 默认只安装发布满 24 小时的版本,实际装上的可能是好几个版本之前的旧版,而安装提示里看不出这一点。填写精确版本时,pnpm 会直接安装这个版本,并自动把它加入 profile 的 `minimumReleaseAgeExclude`。装好后可以在 **设置 → PackyCode → 插件版本** 核对「当前版本」。
57
57
 
@@ -72,7 +72,7 @@ dsh-packycode-api@1.4.0
72
72
 
73
73
  桌面应用的**插件**页可以看到已安装状态与版本,也可以在那里启用、停用或卸载。
74
74
 
75
- **仅用于非 desktop profile:** `dsh plugin --profile <name> add dsh-packycode-api@1.4.0`。不要对 `desktop` 使用它 —— CLI 会直接拒绝(`profile "desktop" is managed exclusively by the Electron application`)。
75
+ **仅用于非 desktop profile:** `dsh plugin --profile <name> add dsh-packycode-api@1.4.1`。不要对 `desktop` 使用它 —— CLI 会直接拒绝(`profile "desktop" is managed exclusively by the Electron application`)。
76
76
 
77
77
  本地开发要加 `link:` 前缀:`dsh plugin --profile <name> add link:/path/to/dsh-packycode-api`。**不要直接写路径(或 `file:`)** —— 那样的安装会把整个仓库目录(连同 `node_modules`)复制进 profile,之后它会在 profile 内部挡住 DSH 自带的包,插件看起来像没装,见「常见问题」。已经那样装过的话,先卸载再按上面的方式重装。
78
78
 
@@ -268,9 +268,9 @@ DeepSeek Flash 走网关的 Responses 接口(`/api/pricing` 列出 `openai-res
268
268
 
269
269
  ## 更新与卸载
270
270
 
271
- > **从 1.3.2 或更早版本升级:** 请在插件页填写 `dsh-packycode-api@1.4.0` 安装,不要点旧版设置页里的「更新插件」。旧按钮安装时会绕过 pnpm 的发布冷却期:装到的版本如果发布还不满 24 小时,这个 profile 在它满 24 小时之前就装不了其他插件。装好并重启后,按钮就换成了修好的版本,以后直接点即可。
271
+ > **从 1.3.2 或更早版本升级:** 请在插件页填写 `dsh-packycode-api@1.4.1` 安装,不要点旧版设置页里的「更新插件」。旧按钮安装时会绕过 pnpm 的发布冷却期:装到的版本如果发布还不满 24 小时,这个 profile 在它满 24 小时之前就装不了其他插件。装好并重启后,按钮就换成了修好的版本,以后直接点即可。
272
272
 
273
- **更新:** 打开 **设置 → PackyCode**,有新版本时点「更新插件」。它会在当前 profile 目录里用 DSH 自带的 pnpm 安装精确版本,并读回 `package.json` 确认版本落地。安装遵守 pnpm 的发布冷却策略,不会绕过它:默认情况下 pnpm 会直接装上这个版本,并把它记进 profile 的 `minimumReleaseAgeExclude`;如果你给 pnpm 配了更严格的策略,按钮会提示什么时候可以更新。新版本号是从 npm 读到的,pnpm 却从 profile 配置的安装源下载:刚发布的版本,安装源(尤其是国内镜像)可能还没同步到,这时按钮会提示过几分钟再更新;连不上安装源时,会提示检查网络或代理。本地 `link:` 开发安装不会出现这个按钮。完成后完全退出并重新打开桌面应用。只刷新页面不会重载 Host。也可以在**插件**页重新安装,同样要填写带版本号的包名(例如 `dsh-packycode-api@1.4.0`),否则装上的可能是发布满 24 小时的旧版。
273
+ **更新:** 打开 **设置 → PackyCode**,有新版本时点「更新插件」。它会在当前 profile 目录里用 DSH 自带的 pnpm 安装精确版本,并读回 `package.json` 确认版本落地。安装遵守 pnpm 的发布冷却策略,不会绕过它:默认情况下 pnpm 会直接装上这个版本,并把它记进 profile 的 `minimumReleaseAgeExclude`;如果你给 pnpm 配了更严格的策略,按钮会提示什么时候可以更新。新版本号是从 npm 读到的,pnpm 却从 profile 配置的安装源下载:刚发布的版本,安装源(尤其是国内镜像)可能还没同步到,这时按钮会提示过几分钟再更新;连不上安装源时,会提示检查网络或代理。本地 `link:` 开发安装不会出现这个按钮。完成后完全退出并重新打开桌面应用。只刷新页面不会重载 Host。也可以在**插件**页重新安装,同样要填写带版本号的包名(例如 `dsh-packycode-api@1.4.1`),否则装上的可能是发布满 24 小时的旧版。
274
274
 
275
275
  **从本地路径安装切回官方源时,必须先卸载。** 「更新」是 `pnpm add`,它只重写包目录里的文件,不会删除更早一次本地路径安装留在包目录内的 `node_modules`;那份旧依赖会继续挡住 DSH 自带的包,插件行加载失败且看不出原因。「卸载」执行的是 `pnpm remove`,会删掉整个包目录,重装才是干净的。用 `node scripts/install-check.mjs` 可以确认当前 profile 是否处于这个状态。
276
276
 
@@ -286,7 +286,7 @@ ls ~/.dsh/profiles/desktop/node_modules/dsh-packycode-api/node_modules
286
286
 
287
287
  有输出就是残留:从 npm 安装的包不会自带 `node_modules`,这一份通常来自更早一次「本地路径」安装(`file:` 或直接写路径,而不是 `link:`)。它位于 profile 目录内部,而 DSH 解析插件导入时优先使用 profile 内的副本,所以插件拿到的仍是那份旧依赖 —— 例如 `@deepseek-ai/schemastery` 3.18.2 没有 `Schema.volatile()`,模块在导入阶段就抛错。导入失败时 Loader 不会为这一行创建 fiber,客户端 bundle 也不会被组合,于是模型路由、RPC 通道和设置页全都不会出现。
288
288
 
289
- 修复:到**插件**页**卸载**本插件,再用带版本号的包名重新**安装**(例如 `dsh-packycode-api@1.4.0`),然后完全退出并重新打开桌面应用。卸载执行的是 `pnpm remove`,会删掉整个包目录;直接重装或点「更新」只重写文件,不会清掉这份残留。也可以手动删掉上面那个 `node_modules` 再重启。
289
+ 修复:到**插件**页**卸载**本插件,再用带版本号的包名重新**安装**(例如 `dsh-packycode-api@1.4.1`),然后完全退出并重新打开桌面应用。卸载执行的是 `pnpm remove`,会删掉整个包目录;直接重装或点「更新」只重写文件,不会清掉这份残留。也可以手动删掉上面那个 `node_modules` 再重启。
290
290
 
291
291
  **首次安装后,设置页每张卡片都显示 `transport failure for /packycode-api/…: HTTP 405`?** 实际装上的是 1.1.6 或更早的版本,通常是因为安装时只填了包名:安装提示显示的是最新版,pnpm 实际装的却是发布满 24 小时的旧版(见「安装插件」)。这些旧版要等 DSH 重启、重建它的 `connection` 服务之后,才能注册设置通道。所以首次安装后 `/packycode-api` 通道还不存在,请求落到静态页面,返回 405;模型路由和设置页本身照常加载。1.1.7 起首次安装不需要重启。先确认装上的版本:
292
292
 
package/lib/index.js CHANGED
@@ -5790,14 +5790,15 @@ function compactionSummary(messages) {
5790
5790
  /**
5791
5791
  * The user message a session-title process receives: DSH's title rules, the
5792
5792
  * conversation to name, and the route's closing instruction, all as the
5793
- * user's words; nothing is added to Claude Code's own system prompt.
5793
+ * user's words; nothing is added to Claude Code's own system prompt. DSH
5794
+ * bounds its title input itself, so it is passed on whole, as over HTTP.
5794
5795
  * @param request - the described title request.
5795
5796
  * @returns the message text.
5796
5797
  */
5797
5798
  function titlePrompt(request) {
5798
5799
  const messages = request.messages;
5799
5800
  const instruction = textOf(messages.at(-1));
5800
- const conversation = messages.slice(0, -1).map((message) => `${message?.role === "assistant" ? "助手" : "用户"}:${textOf(message).slice(0, 2e3)}`).filter((line) => !/^(?:用户|助手):$/u.test(line));
5801
+ const conversation = messages.slice(0, -1).map((message) => `${message?.role === "assistant" ? "助手" : "用户"}:${textOf(message)}`).filter((line) => !/^(?:用户|助手):$/u.test(line));
5801
5802
  return [
5802
5803
  request.system,
5803
5804
  "要命名的对话:",
@@ -6032,11 +6033,12 @@ function createClaudeCliTransport({ binary, configDir = DEFAULT_CLAUDE_CONFIG_DI
6032
6033
  if (closed) throw new Error("the Claude Code CLI transport is closed");
6033
6034
  const body = JSON.parse(typeof init?.body === "string" ? init.body : "{}");
6034
6035
  const baseUrl = baseUrlOf(input);
6036
+ const userText = meta.purpose === "session-title" ? void 0 : meta.userText;
6035
6037
  const request = describeRequest(body, {
6036
6038
  apiKey: meta.apiKey,
6037
6039
  baseUrl,
6038
6040
  cwd: meta.cwd,
6039
- userText: meta.userText
6041
+ userText
6040
6042
  });
6041
6043
  const context = {
6042
6044
  ...meta,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-packycode-api",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
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",