dsh-packycode-api 1.0.6 → 1.0.7
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 +5 -0
- package/README.en.md +3 -2
- package/README.md +3 -2
- package/lib/index.js +37 -8
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.0.7
|
|
4
|
+
|
|
5
|
+
- A `gpt-6-astra` session's title now runs on `gpt-6.1-sol`, in the same way a Claude session's title runs on `claude-haiku-5-5`. DSH sends each title request to the session's own model, so Astra was titling its own sessions. The reroute applies only to requests with `purpose: 'session-title'`, on both the prepared and direct dispatch paths, and both models need the same Codex group. Verified live through the real host adapter with the gateway request observed: the title request went to `gpt-6.1-sol` ("为 PackyCode 添加 GPT-6 Astra并发布"), and an ordinary turn stayed on `gpt-6-astra`.
|
|
6
|
+
- `claude-haiku-5-5` now declares a 1,000,000-token context window and 128,000 output tokens (it declared 200,000 and 64,000), matching Anthropic's [Claude Haiku 5.5 overview](https://platform.claude.com/docs/en/models/haiku-5-5/overview) and the other Claude 5.5 models. The protocol, base URL, and effort levels are unchanged. Haiku runs through the local Claude Code CLI, which manages its own context. These figures set what DSH shows and how it budgets the session, such as when it compacts.
|
|
7
|
+
|
|
3
8
|
## 1.0.6
|
|
4
9
|
|
|
5
10
|
- New model `gpt-6-astra` (GPT-6 Astra), on the same route as `gpt-6.1-sol`: `openai-responses` at `https://cf.api.fan/v1`, text and image input, 1,050,000-token context, 128,000 output tokens, and `reasoning.effort` `low` / `medium` / `high` / `xhigh` / `max` (reasoning cannot be turned off). All of these are from OpenAI's [model page](https://developers.openai.com/api/docs/models/gpt-6-astra). The gateway lists it in `/v1/models` as `gpt-6-astra`, and it needs a key whose group covers Codex (`codex`, `codex-sale`). Verified live through the built bundle: `live-check` answered `ok` from it alongside `deepseek-flash` and `gpt-6.1-sol`, and each of the five effort levels answered `ok`. One `medium` request first hit a transient `Connection error` and answered on retry.
|
package/README.en.md
CHANGED
|
@@ -42,7 +42,7 @@ Open the desktop application's **Plugins** page, click **Add plugin**, and enter
|
|
|
42
42
|
dsh-packycode-api
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
Choose the **official** install source, then click **Install**. To pin a version, enter `dsh-packycode-api@1.0.
|
|
45
|
+
Choose the **official** install source, then click **Install**. To pin a version, enter `dsh-packycode-api@1.0.7`.
|
|
46
46
|
|
|
47
47
|
Then **manually restart the desktop application**. Refreshing the page does not reload the plugin inside the Host process.
|
|
48
48
|
|
|
@@ -61,7 +61,7 @@ Choose a model from the `PackyCode` group. `deepseek-flash`, `gpt-6.1-sol`, and
|
|
|
61
61
|
|
|
62
62
|
The **Plugins** page shows the installed state and version, and is also where you enable, disable, or uninstall.
|
|
63
63
|
|
|
64
|
-
**For non-desktop profiles only:** `dsh plugin --profile <name> add dsh-packycode-api@1.0.
|
|
64
|
+
**For non-desktop profiles only:** `dsh plugin --profile <name> add dsh-packycode-api@1.0.7`. Do not use it for `desktop` — the CLI refuses it (`profile "desktop" is managed exclusively by the Electron application`).
|
|
65
65
|
|
|
66
66
|
A local checkout can be linked with `dsh plugin --profile <name> add link:/path/to/dsh-packycode-api`.
|
|
67
67
|
|
|
@@ -114,6 +114,7 @@ A model in the list does not mean the current token group allows it. When changi
|
|
|
114
114
|
- The conversation and its images reach the CLI over stdin (`--input-format stream-json`), not argv: a Windows command line is length-limited and cannot carry an image. Images in the conversation are sent to Claude as images, at the HTTP route's request size (at most 2048×2048, about 1 MiB each; at most 20 images and 20 MiB per turn, dropping the oldest first). An image left out is named with its read-only local copy, which the CLI can open with Read.
|
|
115
115
|
- Every run carries `--append-system-prompt` (the delegation note). In `-p` mode the official CLI introduces itself as "You are Claude Code, Anthropic's official CLI for Claude …" when it has appended instructions and as "You are a Claude agent, built on Anthropic's Claude Agent SDK." when it has none; the latter was refused upstream as not coming from the official CLI (403 `only accepts requests from the official Claude Code CLI`). That is the official CLI's own behavior; the plugin does not rewrite its system prompt.
|
|
116
116
|
- While the session model is a Claude model, titles are generated with `claude-haiku-5-5`, read-only, in a temporary directory, instead of a full Opus turn.
|
|
117
|
+
- While the session model is `gpt-6-astra`, titles are generated with `gpt-6.1-sol` (same Codex group); the turns themselves stay on Astra. Other models title their own sessions.
|
|
117
118
|
- The `claude_code` tool can delegate one task to the local CLI while the session model is `gpt-6.1-sol`, `gpt-6-astra`, or `deepseek-flash`. The requested `mode` cannot exceed what the session preset allows.
|
|
118
119
|
- An effort level the model does not support is rejected before the request is sent. Do not edit a model's effort map casually.
|
|
119
120
|
|
package/README.md
CHANGED
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
dsh-packycode-api
|
|
43
43
|
```
|
|
44
44
|
|
|
45
|
-
在**安装源**中选择**官方源**,然后点击**安装**。需要固定版本时填入 `dsh-packycode-api@1.0.
|
|
45
|
+
在**安装源**中选择**官方源**,然后点击**安装**。需要固定版本时填入 `dsh-packycode-api@1.0.7`。
|
|
46
46
|
|
|
47
47
|
完成后**手动重启桌面应用**。仅刷新页面不会重新加载 Host 里的插件。
|
|
48
48
|
|
|
@@ -61,7 +61,7 @@ dsh-packycode-api
|
|
|
61
61
|
|
|
62
62
|
桌面应用的**插件**页可以看到已安装状态与版本,也可以在那里启用、停用或卸载。
|
|
63
63
|
|
|
64
|
-
**仅用于非 desktop profile:** `dsh plugin --profile <name> add dsh-packycode-api@1.0.
|
|
64
|
+
**仅用于非 desktop profile:** `dsh plugin --profile <name> add dsh-packycode-api@1.0.7`。不要对 `desktop` 使用它 —— CLI 会直接拒绝(`profile "desktop" is managed exclusively by the Electron application`)。
|
|
65
65
|
|
|
66
66
|
本地开发可以用绝对路径:`dsh plugin --profile <name> add link:/path/to/dsh-packycode-api`。
|
|
67
67
|
|
|
@@ -114,6 +114,7 @@ dsh-packycode-api
|
|
|
114
114
|
- 对话记录和图片通过 stdin 交给 CLI(`--input-format stream-json`),不走命令行参数:Windows 命令行长度有上限,而且命令行带不了图片。对话里的图片会以图片形式发给 Claude(与 HTTP 路由相同的压缩规格:每张不超过 2048×2048、约 1 MiB;一回合最多 20 张、合计 20 MiB,超出时先舍弃最早的)。没随消息发出的图片会写明本机只读副本的路径,CLI 需要时可以用 Read 读取。
|
|
115
115
|
- 每次运行都带 `--append-system-prompt`(委派说明)。在 `-p` 模式下,官方 CLI 有追加说明时会以 "You are Claude Code, Anthropic's official CLI for Claude …" 自我介绍,没有时是 "You are a Claude agent, built on Anthropic's Claude Agent SDK.";后者曾被上游当成非官方 CLI 拒绝(403 `only accepts requests from the official Claude Code CLI`)。这是官方 CLI 自己的行为,插件没有改写它的系统提示词。
|
|
116
116
|
- 会话跑在 Claude 模型上时,生成标题改用 `claude-haiku-5-5`,只读、临时目录,避免为起标题跑一整轮 Opus。
|
|
117
|
+
- 会话跑在 `gpt-6-astra` 上时,标题改由 `gpt-6.1-sol` 生成(同一个 Codex 分组);对话本身仍然用 Astra。其它模型的标题由会话模型自己生成。
|
|
117
118
|
- 另有 `claude_code` 工具:当前模型是 `gpt-6.1-sol`、`gpt-6-astra` 或 `deepseek-flash` 时,可以把一个任务委派给本机 Claude Code。请求的 `mode` 不会超过会话权限允许的上限。
|
|
118
119
|
- 声明了模型不支持的推理档位会被 harness 在发请求前拒绝,不要随手改档位映射。
|
|
119
120
|
|
package/lib/index.js
CHANGED
|
@@ -562,6 +562,13 @@ const CLI_BACKED_MODEL_IDS = Object.freeze([
|
|
|
562
562
|
]);
|
|
563
563
|
/** The model a session title is generated with when the session runs on the CLI. */
|
|
564
564
|
const TITLE_MODEL_ID = "claude-haiku-5-5";
|
|
565
|
+
/**
|
|
566
|
+
* HTTP models whose session titles run on another model of the same route.
|
|
567
|
+
* A title is a few words, so the flagship `gpt-6-astra` hands it to
|
|
568
|
+
* `gpt-6.1-sol`, which the same Codex group serves; the session's own turns
|
|
569
|
+
* are untouched.
|
|
570
|
+
*/
|
|
571
|
+
const TITLE_MODEL_ROUTES = Object.freeze({ "gpt-6-astra": "gpt-6.1-sol" });
|
|
565
572
|
/** How much of the conversation a delegated prompt carries. */
|
|
566
573
|
const MAX_PROMPT_CHARS$1 = 48e3;
|
|
567
574
|
const MAX_BLOCK_CHARS = 8e3;
|
|
@@ -1025,14 +1032,24 @@ async function cliCall(options, { titleModel, cwdOf, modeOf, attachmentsOf, imag
|
|
|
1025
1032
|
* Wrap an adapter so the CLI-backed models run through the local CLI.
|
|
1026
1033
|
*
|
|
1027
1034
|
* @param options - the inner adapter, the CLI runner, the CLI-backed model ids,
|
|
1028
|
-
* the model session titles run on, the
|
|
1029
|
-
*
|
|
1035
|
+
* the model session titles run on, the HTTP models whose titles run on
|
|
1036
|
+
* another model, the mode and working directory each turn runs with, and the
|
|
1037
|
+
* attachment store images are read from.
|
|
1030
1038
|
* @returns an adapter with the same provider surface.
|
|
1031
1039
|
*/
|
|
1032
|
-
function createClaudeCliAdapter({ inner, runner, modelIds = CLI_BACKED_MODEL_IDS, titleModel = TITLE_MODEL_ID, resolveMode, resolveCwd, resolveAttachments, imageLimits = CLI_IMAGE_LIMITS }) {
|
|
1040
|
+
function createClaudeCliAdapter({ inner, runner, modelIds = CLI_BACKED_MODEL_IDS, titleModel = TITLE_MODEL_ID, titleRoutes = TITLE_MODEL_ROUTES, resolveMode, resolveCwd, resolveAttachments, imageLimits = CLI_IMAGE_LIMITS }) {
|
|
1033
1041
|
if (inner === void 0 || inner === null) throw new Error("the CLI adapter needs an inner adapter");
|
|
1034
1042
|
if (runner === void 0 || runner === null) throw new Error("the CLI adapter needs a runner");
|
|
1035
1043
|
const cliModels = new Set(modelIds);
|
|
1044
|
+
/** The model a title request for `model` runs on, when it is rerouted. */
|
|
1045
|
+
const titleRouteOf = (options) => options?.purpose === "session-title" && !cliModels.has(options.model) ? Object.hasOwn(titleRoutes, options.model) ? titleRoutes[options.model] : void 0 : void 0;
|
|
1046
|
+
/** Run a rerouted title on its own model, bound to that model's generation. */
|
|
1047
|
+
async function* reroutedTitle(options, model) {
|
|
1048
|
+
yield* (await inner.prepareCall(options.provider, model, options.signal)).stream({
|
|
1049
|
+
...options,
|
|
1050
|
+
model
|
|
1051
|
+
});
|
|
1052
|
+
}
|
|
1036
1053
|
/** The mode is read per turn so a settings change applies without a reload. */
|
|
1037
1054
|
const modeOf = () => typeof resolveMode === "function" ? resolveMode() : void 0;
|
|
1038
1055
|
const cwdOf = () => typeof resolveCwd === "function" ? resolveCwd() : void 0;
|
|
@@ -1156,14 +1173,26 @@ function createClaudeCliAdapter({ inner, runner, modelIds = CLI_BACKED_MODEL_IDS
|
|
|
1156
1173
|
return inner.resolveModel(provider, model, signal);
|
|
1157
1174
|
}
|
|
1158
1175
|
async prepareCall(provider, model, signal) {
|
|
1159
|
-
if (!cliModels.has(model))
|
|
1176
|
+
if (!cliModels.has(model)) {
|
|
1177
|
+
const prepared = await inner.prepareCall(provider, model, signal);
|
|
1178
|
+
if (!Object.hasOwn(titleRoutes, model)) return prepared;
|
|
1179
|
+
return {
|
|
1180
|
+
...prepared,
|
|
1181
|
+
stream: (options) => {
|
|
1182
|
+
const routed = titleRouteOf(options);
|
|
1183
|
+
return routed === void 0 ? prepared.stream(options) : reroutedTitle(options, routed);
|
|
1184
|
+
}
|
|
1185
|
+
};
|
|
1186
|
+
}
|
|
1160
1187
|
return {
|
|
1161
1188
|
model: await inner.resolveModel(provider, model, signal),
|
|
1162
1189
|
stream: (options) => cliStream(options)
|
|
1163
1190
|
};
|
|
1164
1191
|
}
|
|
1165
1192
|
stream(options) {
|
|
1166
|
-
|
|
1193
|
+
if (cliModels.has(options.model)) return cliStream(options);
|
|
1194
|
+
const routed = titleRouteOf(options);
|
|
1195
|
+
return routed === void 0 ? inner.stream(options) : reroutedTitle(options, routed);
|
|
1167
1196
|
}
|
|
1168
1197
|
}();
|
|
1169
1198
|
}
|
|
@@ -3154,8 +3183,8 @@ const PACKYCODE_MODELS = Object.freeze([
|
|
|
3154
3183
|
reasoning: true,
|
|
3155
3184
|
input: Object.freeze(["text", "image"]),
|
|
3156
3185
|
cost: NO_COST,
|
|
3157
|
-
contextWindow:
|
|
3158
|
-
maxTokens:
|
|
3186
|
+
contextWindow: 1e6,
|
|
3187
|
+
maxTokens: 128e3,
|
|
3159
3188
|
thinkingLevelMap: ALWAYS_THINKING_LEVELS,
|
|
3160
3189
|
compat: Object.freeze({
|
|
3161
3190
|
forceAdaptiveThinking: true,
|
|
@@ -3780,4 +3809,4 @@ function apply(ctx, config) {
|
|
|
3780
3809
|
});
|
|
3781
3810
|
}
|
|
3782
3811
|
//#endregion
|
|
3783
|
-
export { AUTO_CLAUDE_MODE, CHANNEL, CLAUDE_CLI_MODES, CLAUDE_INSTALL_COMMAND, CLAUDE_MISSING_MESSAGE, CLAUDE_NPM_PACKAGE, CLI_BACKED_MODEL_IDS, CLI_IMAGE_LIMITS, Config, DEFAULT_API_HOST, DEFAULT_APPEND_SYSTEM_PROMPT, DEFAULT_STATUS_HOST, DISPLAY_NAME, LEGACY_STATUS_HOSTS, PACKYCODE_MODELS, PACKYCODE_MODEL_IDS, PLUGIN_ID, PROVIDER, PackyCodeKeyRing, SETTINGS_NAMESPACE, TITLE_MODEL_ID, accountHostOrder, apply, assertApiKey, buildClaudeArgs, buildClaudeEnvironment, buildClaudeInput, buildDelegatedContent, capClaudeMode, classifyClientPolicy, classifyGatewayFailure, claudeBinaryCandidates, claudeModeFor, claudeModeForSession, createBalanceReader, createClaudeCliAdapter, createClaudeCliManager, createClaudeRunner, createPackyCodeProfile, createPackyCodeProvider, createPackyCodeRpc, delegationInstructions, explainCliClientPolicyFailure, explainClientPolicyFailure, explainNpmFailure, findClaudeBinary, guardKeyRotation, inject, locateClaudeBinary, locateNpm, name, normalizeFailureMessage, normalizeHost, npmCandidates, parseBillingSubscription, parseBillingUsage, parseClaudeResult, parseClaudeVersion, parseTokenUsage, readClaudeStreamEvents, renderAuxiliaryPrompt, renderDelegatedPrompt, resolveSpawnCommand, statusHostOrder, summarizeToolUse };
|
|
3812
|
+
export { AUTO_CLAUDE_MODE, CHANNEL, CLAUDE_CLI_MODES, CLAUDE_INSTALL_COMMAND, CLAUDE_MISSING_MESSAGE, CLAUDE_NPM_PACKAGE, CLI_BACKED_MODEL_IDS, CLI_IMAGE_LIMITS, Config, DEFAULT_API_HOST, DEFAULT_APPEND_SYSTEM_PROMPT, DEFAULT_STATUS_HOST, DISPLAY_NAME, LEGACY_STATUS_HOSTS, PACKYCODE_MODELS, PACKYCODE_MODEL_IDS, PLUGIN_ID, PROVIDER, PackyCodeKeyRing, SETTINGS_NAMESPACE, TITLE_MODEL_ID, TITLE_MODEL_ROUTES, accountHostOrder, apply, assertApiKey, buildClaudeArgs, buildClaudeEnvironment, buildClaudeInput, buildDelegatedContent, capClaudeMode, classifyClientPolicy, classifyGatewayFailure, claudeBinaryCandidates, claudeModeFor, claudeModeForSession, createBalanceReader, createClaudeCliAdapter, createClaudeCliManager, createClaudeRunner, createPackyCodeProfile, createPackyCodeProvider, createPackyCodeRpc, delegationInstructions, explainCliClientPolicyFailure, explainClientPolicyFailure, explainNpmFailure, findClaudeBinary, guardKeyRotation, inject, locateClaudeBinary, locateNpm, name, normalizeFailureMessage, normalizeHost, npmCandidates, parseBillingSubscription, parseBillingUsage, parseClaudeResult, parseClaudeVersion, parseTokenUsage, readClaudeStreamEvents, renderAuxiliaryPrompt, renderDelegatedPrompt, resolveSpawnCommand, statusHostOrder, summarizeToolUse };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-packycode-api",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"packageManager": "pnpm@10.32.1",
|
|
5
5
|
"description": "Use a PackyCode (PackyAPI) API key in DeepSeek Harness through a built-in multi-protocol model route with key rotation and balance display",
|
|
6
6
|
"type": "module",
|