dsh-gpt-adapter 0.2.5 → 0.2.6
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 +7 -7
- package/README.zh-CN.md +7 -7
- package/THIRD_PARTY_NOTICES.md +7 -3
- package/dist/src/client/context-window-preset.d.ts +11 -0
- package/dist/src/client/native-context-settings.d.ts +3 -0
- package/lib/client.js +5178 -54
- package/package.json +1 -1
- package/scripts/build.mjs +36 -0
- package/scripts/native-context-settings.mjs +139 -0
package/README.md
CHANGED
|
@@ -12,7 +12,7 @@ Install one plugin to reuse local Codex instructions, skills, enabled plugin res
|
|
|
12
12
|
|
|
13
13
|
- Discover upstream models with `GET /models` and retain stale entries until explicit cleanup.
|
|
14
14
|
- Provide the GPT reasoning preset `low / medium / high / xhigh / max / ultra` through the native Models page and conversation menu.
|
|
15
|
-
- Reuse the native per-model context field
|
|
15
|
+
- Reuse the native per-model context field with Default / 516K / 1M / Custom choices; show a value input only for Custom.
|
|
16
16
|
- Offer independent Standard and Fast speed choices. Fast sends `service_tier: "priority"`; Ultrafast requires an explicit upstream declaration or override.
|
|
17
17
|
- Preserve optional function arguments on GPT Responses requests by setting missing `strict` values to `false`.
|
|
18
18
|
- Read Codex instruction files and refresh them at the next model step without repeating unchanged baselines.
|
|
@@ -23,14 +23,14 @@ Reasoning and speed presets are requests to the configured gateway, not guarante
|
|
|
23
23
|
|
|
24
24
|
## Compatibility and installation
|
|
25
25
|
|
|
26
|
-
The native integration targets DSH `0.2.2-rc.1`, Cordis `4.1.0`, and the pinned adapter source hash. The development dependency uses Pi AI `1.3.0`. Installed third-party package files are never edited. The package version is `dsh-gpt-adapter@0.2.
|
|
26
|
+
The native integration targets DSH `0.2.2-rc.1`, Cordis `4.1.0`, and the pinned adapter source hash. The development dependency uses Pi AI `1.3.0`. Installed third-party package files are never edited. The package version is `dsh-gpt-adapter@0.2.6`.
|
|
27
27
|
|
|
28
28
|
Requires Node.js `>=24.9.0` and DSH. Source builds also require pnpm.
|
|
29
29
|
|
|
30
30
|
Install the published package in the web profile:
|
|
31
31
|
|
|
32
32
|
```sh
|
|
33
|
-
dsh plugin --profile web add dsh-gpt-adapter@0.2.
|
|
33
|
+
dsh plugin --profile web add dsh-gpt-adapter@0.2.6
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
Restart the DSH host after installing or upgrading. Configure GPT connections under **Settings → Models**; Codex environment reuse is enabled by default. The plugin extends the existing native settings and conversation controls.
|
|
@@ -43,7 +43,7 @@ cd dsh-gpt-adapter
|
|
|
43
43
|
pnpm install --frozen-lockfile
|
|
44
44
|
mkdir -p artifacts
|
|
45
45
|
pnpm pack --pack-destination artifacts
|
|
46
|
-
dsh plugin --profile web add ./artifacts/dsh-gpt-adapter-0.2.
|
|
46
|
+
dsh plugin --profile web add ./artifacts/dsh-gpt-adapter-0.2.6.tgz
|
|
47
47
|
```
|
|
48
48
|
|
|
49
49
|
`pnpm pack` runs the production build.
|
|
@@ -128,15 +128,15 @@ Capability precedence is user override, explicit upstream metadata, external cat
|
|
|
128
128
|
|
|
129
129
|
### Context windows
|
|
130
130
|
|
|
131
|
-
Under **Settings → Models → Custom settings → Model catalog**,
|
|
131
|
+
Under **Settings → Models → Custom settings → Model catalog**, use the original **Context window** field. For GPT models, it offers **Default / 516K / 1M / Custom**. Default restores automatic resolution; 516K and 1M save `516000` and `1000000` tokens. Only Custom shows an input, accepting a token count or decimal K/M suffix. Use the native Save or Cancel action; no separate context editor is added.
|
|
132
132
|
|
|
133
133
|
Inherited model rows and provider defaults participate in edit detection and final budget validation. A failed legacy cleanup restores the previous native capacity while preserving unrelated edits.
|
|
134
134
|
|
|
135
|
-
|
|
135
|
+
Default leaves the native context value unset for automatic resolution. Automatic capacities stay in the effective model information; the editable draft contains manual values only, including existing legacy overrides. An explicit preset or custom value equal to the current automatic capacity is still saved as a manual value. Empty or invalid custom input prevents saving.
|
|
136
136
|
|
|
137
137
|
Capacity suffixes use decimal units. Automatic resolution uses a distinguishable explicit provider default, upstream model metadata, the configured capability catalog, the shipped exact-model preset, then the native catalog/DSH fallback. Shipped presets are dated data, not a live fetch from OpenAI: `gpt-6-astra`, `gpt-6.1-sol`, `gpt-6.1-terra`, `gpt-6-luna`, and `gpt-5.4` use `1050000`; `gpt-4.1` uses `1047576`; `gpt-4o` uses `128000`. Only documented snapshot aliases share these presets. References and verification dates are in [the preset table](src/context-window.ts).
|
|
138
138
|
|
|
139
|
-
Existing native per-model values, including catalog `modelOverrides`, and legacy JSON context overrides remain effective until deliberately edited. Editing the native context field clears only that model's legacy context override;
|
|
139
|
+
Existing native per-model values, including catalog `modelOverrides`, and legacy JSON context overrides remain effective until deliberately edited. Editing the native context field clears only that model's legacy context override; selecting Default removes its manual context values while retaining provider defaults and other settings. Saving unrelated settings or discovering models does not turn automatic values into manual overrides. Identical model IDs on different providers are independent.
|
|
140
140
|
|
|
141
141
|
Providers using native catalog `modelOverrides` keep their catalog configuration during synchronization. Discovery and stale cleanup update the plugin snapshot without creating an incompatible explicit `models` list or deleting native overrides.
|
|
142
142
|
|
package/README.zh-CN.md
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
- 通过 `GET /models` 发现上游模型;失效模型保留到用户主动清理。
|
|
14
14
|
- 在原生模型设置页和对话菜单中提供 `low / medium / high / xhigh / max / ultra` 六档思考预设。
|
|
15
|
-
-
|
|
15
|
+
- 在原生逐模型上下文字段中选择「默认 / 516K / 1M / 自定义」,仅在选择「自定义」时显示输入框。
|
|
16
16
|
- 提供独立的 Standard 和 Fast 速度选择。Fast 发送 `service_tier: "priority"`;Ultrafast 由上游明确声明或用户覆盖提供。
|
|
17
17
|
- 为 GPT Responses 函数工具补齐缺失的 `strict: false`,保留可选参数。
|
|
18
18
|
- 读取 Codex 指令,在下一模型步骤更新;内容不变时不重复注入。
|
|
@@ -23,14 +23,14 @@
|
|
|
23
23
|
|
|
24
24
|
## 兼容性与安装
|
|
25
25
|
|
|
26
|
-
原生集成面向 DSH `0.2.2-rc.1`、Cordis `4.1.0`,并校验适配器源码指纹。开发依赖固定 Pi AI `1.3.0`。插件不会修改已安装的第三方包文件。插件版本为 `dsh-gpt-adapter@0.2.
|
|
26
|
+
原生集成面向 DSH `0.2.2-rc.1`、Cordis `4.1.0`,并校验适配器源码指纹。开发依赖固定 Pi AI `1.3.0`。插件不会修改已安装的第三方包文件。插件版本为 `dsh-gpt-adapter@0.2.6`。
|
|
27
27
|
|
|
28
28
|
需要 Node.js `>=24.9.0` 和 DSH。源码构建另外需要 pnpm。
|
|
29
29
|
|
|
30
30
|
在 `web` 配置档(profile)中安装已发布的 npm 包:
|
|
31
31
|
|
|
32
32
|
```sh
|
|
33
|
-
dsh plugin --profile web add dsh-gpt-adapter@0.2.
|
|
33
|
+
dsh plugin --profile web add dsh-gpt-adapter@0.2.6
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
安装或升级后重启 DSH 宿主。在「设置 → 模型」中配置 GPT 连接;Codex 环境复用默认开启。插件扩展现有原生设置与对话控件。
|
|
@@ -43,7 +43,7 @@ cd dsh-gpt-adapter
|
|
|
43
43
|
pnpm install --frozen-lockfile
|
|
44
44
|
mkdir -p artifacts
|
|
45
45
|
pnpm pack --pack-destination artifacts
|
|
46
|
-
dsh plugin --profile web add ./artifacts/dsh-gpt-adapter-0.2.
|
|
46
|
+
dsh plugin --profile web add ./artifacts/dsh-gpt-adapter-0.2.6.tgz
|
|
47
47
|
```
|
|
48
48
|
|
|
49
49
|
`pnpm pack` 会自动执行生产构建。
|
|
@@ -128,15 +128,15 @@ codexCompatibility:
|
|
|
128
128
|
|
|
129
129
|
### 上下文窗口
|
|
130
130
|
|
|
131
|
-
在「设置 → 模型 → 自定义设置 →
|
|
131
|
+
在「设置 → 模型 → 自定义设置 → 模型目录」中,复用原来的「上下文窗口」位置。GPT 模型在这里选择「默认 / 516K / 1M / 自定义」:「默认」恢复自动解析;516K 和 1M 分别保存 `516000` 和 `1000000` 词元。只有选择「自定义」时才显示输入框,可输入完整词元数或十进制 K/M 后缀。继续使用原生的保存、取消操作,不增加独立编辑入口。
|
|
132
132
|
|
|
133
133
|
编辑前后状态比较和最终预算校验会纳入继承模型及提供商默认值。旧覆盖清理失败时,恢复原生容量并保留无关修改。
|
|
134
134
|
|
|
135
|
-
|
|
135
|
+
选择「默认」时不保存模型的手动上下文值,由系统自动解析。自动容量保留在模型有效信息中,编辑草稿只包含手动值(包括已有旧版覆盖);明确选择与当前自动容量相同的预设或自定义数值,也会保存为手动值。自定义输入为空或无效时不能保存。
|
|
136
136
|
|
|
137
137
|
容量后缀使用十进制单位。自动解析依次采用可辨识的显式提供商默认值、上游模型元数据、已配置的能力目录、插件内置的精确模型预设、原生目录或 DSH 后备值。内置预设是带核验日期的数据,不会实时抓取 OpenAI 页面:`gpt-6-astra`、`gpt-6.1-sol`、`gpt-6.1-terra`、`gpt-6-luna`、`gpt-5.4` 为 `1050000`,`gpt-4.1` 为 `1047576`,`gpt-4o` 为 `128000`;仅为有文档依据的快照别名复用预设。参考页面和核验日期见[预设表](src/context-window.ts)。
|
|
138
138
|
|
|
139
|
-
已有原生模型数值(包括目录模型的 `modelOverrides`)和旧版 JSON
|
|
139
|
+
已有原生模型数值(包括目录模型的 `modelOverrides`)和旧版 JSON 上下文覆盖继续生效,直到用户主动编辑。编辑原生上下文字段时,仅清除该模型的旧版上下文覆盖;选择「默认」会删除该模型的手动上下文数值,保留提供商默认值和其他设置。保存无关设置或发现模型不会把自动值固化为手动覆盖。同名模型在不同提供商下独立设置。
|
|
140
140
|
|
|
141
141
|
使用原生目录 `modelOverrides` 的提供商在同步时保留目录配置。模型发现和失效清理只更新插件快照,不会生成不兼容的显式 `models` 列表,也不会删除原生覆盖。
|
|
142
142
|
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -6,9 +6,13 @@ from the pinned `@deepseek-ai/dsh-llm-pi-ai`,
|
|
|
6
6
|
`@deepseek-ai/dsh-client-ui-settings-models`, and `@deepseek-ai/dsh-mcp-client` version `0.2.2-rc.1` packages.
|
|
7
7
|
Original project: https://github.com/deepseek-ai/deepseek-harness
|
|
8
8
|
|
|
9
|
-
The build records native source hashes
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
The build records native source hashes, reads native Models CSS class names,
|
|
10
|
+
and adapts the pinned native Models renderer to add a preset selector at the
|
|
11
|
+
original GPT context-window field. The runtime retains the original settings
|
|
12
|
+
entry, controller, child slots, and save/cancel operations, and restores its
|
|
13
|
+
renderer when unloaded. Other controls extend existing UI slots. MCP tool
|
|
14
|
+
filtering uses the pinned client's public tool-name encoding. Installed
|
|
15
|
+
third-party package files are never modified.
|
|
12
16
|
|
|
13
17
|
## DeepSeek Harness — MIT License
|
|
14
18
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const ContextWindowPresetScope: React.Context<boolean>;
|
|
3
|
+
type Props = {
|
|
4
|
+
inputProps: React.InputHTMLAttributes<HTMLInputElement>;
|
|
5
|
+
tokens: number | undefined;
|
|
6
|
+
onValueChange(value: string): void;
|
|
7
|
+
onCustomValueChange(value: string): void;
|
|
8
|
+
};
|
|
9
|
+
/** Reuse the native field callbacks and draft; only the field's UI changes. */
|
|
10
|
+
export declare function ContextWindowPreset({ inputProps, tokens, onValueChange, onCustomValueChange, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { SlotRegistry } from '@deepseek-ai/dsh-client-ui-renderer/client';
|
|
2
|
+
/** Keep the native entry, controller, stores, child slots, and save operations. */
|
|
3
|
+
export declare function installNativeContextPresets(slots: Pick<SlotRegistry, 'entries' | 'subscribe' | 'provideRoot'>): () => void;
|