dsh-opencode-go 0.1.7 → 0.1.8

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.en.md CHANGED
@@ -4,18 +4,36 @@
4
4
 
5
5
  Use OpenCode Go subscription models in [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness), with streaming replies, tool calls, and image input.
6
6
 
7
- The plugin adds the session headers required by OpenCode Go, reads the gateway model catalog, and displays subscription usage.
7
+ The plugin automatically adds the session headers required by OpenCode Go, reads the gateway model catalog, and displays subscription usage. There is no need to configure model protocols, modalities, context windows, or maximum output tokens manually.
8
+
9
+ ## Features
10
+
11
+ - **Session headers**: Every request includes the Harness User-Agent and `x-opencode-session`. A session keeps the same ID to maximize cache hits.
12
+ - **Streaming and history**: Supports streaming output, tool calls, and history replay through pi-ai.
13
+ - **Image input**: Supports models that advertise image capability in the catalog.
14
+ - **Model capacity overrides**: Override the context window and maximum output per model, with blank values inheriting the online catalog.
15
+ - **Prompt and caching**: The plugin does not add hidden system prompts; the session ID is used for gateway routing.
8
16
 
9
17
  ## Installation and usage
10
18
 
11
- Plugin `0.1.7` supports DSH `0.1.5-rc.1`, `0.1.5-rc.2`, `0.1.6-alpha.1`, `0.1.6-alpha.2`, and `0.1.7-alpha.1`.
19
+ Supported DSH versions: `0.1.5-rc.1`, `0.1.5-rc.2`, `0.1.6-alpha.1`, `0.1.6-alpha.2`, and `0.1.7-alpha.1`.
20
+
21
+ ### Install from DSH (recommended)
22
+
23
+ 1. Open the **Plugins** page in DSH and click **Add plugin** in the top-right corner.
24
+ 2. Enter `dsh-opencode-go` and click **Install**.
25
+ 3. If prompted after installation, click **Enable now**.
26
+
27
+ ![Add, install, and enable dsh-opencode-go from DSH (Chinese UI)](docs/assets/install-via-dsh.gif)
12
28
 
13
- To build from source and install locally, use `npm ci --legacy-peer-deps`, `npm pack`, then `dsh plugin --profile web add ./dsh-opencode-go-0.1.7.tgz`. The development dependency tree intentionally includes multiple DSH generations.
29
+ Then open **Settings → OpenCode Go**, enter and save your API key, and select an OpenCode Go model in a conversation.
14
30
 
15
- ### Web
31
+ If your DSH version does not have an **Add plugin** entry, use the command-line method below.
32
+
33
+ ### Command-line installation (alternative)
16
34
 
17
35
  ```sh
18
- dsh plugin --profile web add dsh-opencode-go@0.1.7
36
+ dsh plugin --profile web add dsh-opencode-go@0.1.8
19
37
  ```
20
38
 
21
39
  Start or restart `dsh web`, then:
@@ -29,7 +47,7 @@ Start or restart `dsh web`, then:
29
47
  Install the plugin into the Headless profile:
30
48
 
31
49
  ```sh
32
- dsh plugin --profile headless add dsh-opencode-go@0.1.7
50
+ dsh plugin --profile headless add dsh-opencode-go@0.1.8
33
51
  ```
34
52
 
35
53
  Save the following as `headless.patch.yml` to select a default model:
@@ -51,33 +69,15 @@ dsh --profile headless --patch ./headless.patch.yml "Hello"
51
69
 
52
70
  The model ID must be available in the current gateway catalog. Web and Headless use separate profiles, so install the plugin in each profile you use.
53
71
 
54
- ## Model capacity settings
55
-
56
- In Web, open **Settings → OpenCode Go → Model capacities** to override capacities per model. The section is collapsed by default and lets you:
57
-
58
- - Search by model name or ID.
59
- - Set the **context window** and **maximum output**.
60
- - See the catalog-advertised capacities as a reference.
61
- - Click **Use catalog** for one model or clear all overrides.
62
-
63
- Blank fields inherit the catalog values. Positive integers are passed directly to the adapter; the plugin does not clamp them to the provider's actual capabilities, so values above the upstream limit may be rejected by the gateway. Changes use the settings page's **Save** / **Discard** flow and take effect on the next request or model read without a restart.
72
+ To build from source and install a local package:
64
73
 
65
- Headless or profile patches can also configure `modelLimits` directly:
66
-
67
- ```yaml
68
- - id: opencode-go
69
- config:
70
- modelLimits:
71
- deepseek-v4.1-flash:
72
- contextWindow: 262144
73
- maxTokens: 32768
74
+ ```sh
75
+ npm ci --legacy-peer-deps
76
+ npm pack
77
+ dsh plugin --profile web add ./dsh-opencode-go-0.1.8.tgz
74
78
  ```
75
79
 
76
- Each model may set only one field. Omitted fields inherit existing configuration, falling back to the catalog when no override exists. `maxTokens` also caps explicit request budgets while preserving smaller budgets.
77
-
78
- Set a model entry or an individual field to `null` to explicitly select the catalog value even when a lower profile layer supplies an override. The Web reset and clear actions save this marker automatically. Changing limits preserves learned catalog metadata; the reference values always show the original catalog capacities.
79
-
80
- DSH `0.1.5` / `0.1.6` use the legacy settings interface; `0.1.7-alpha.1` uses profile configuration. Changes take effect without restarting on all five supported versions.
80
+ The development dependencies include real test packages from multiple DSH generations, so installation requires `--legacy-peer-deps`. For Headless, replace `web` with `headless`.
81
81
 
82
82
  ## Updating the plugin
83
83
 
@@ -95,20 +95,6 @@ Restart `dsh web` and refresh the browser afterwards. For Headless, replace `web
95
95
 
96
96
  ## FAQ
97
97
 
98
- ### Advanced settings after upgrading to DSH 0.1.7
99
-
100
- DSH `0.1.7` stores settings in the current profile’s `cordis.patch.yml`, using entry ID `opencode-go`. Older hosts use the `llm-opencode-go` section in `settings.yaml`. The upstream importer does not map these different names automatically. If advanced settings return to defaults, copy the relevant values from `settings.yaml.imported` (or `settings.yaml` before import) into the new settings page or the existing `opencode-go` profile entry. Preserve other profile entries and any custom `apiKeyEnv` value. API keys remain in the credentials service; Web and Headless configurations are now independent.
101
-
102
- ### DSH 0.1.5 cannot start after installing the plugin
103
-
104
- Plugin versions `0.1.0`–`0.1.4` used an image API introduced in DSH `0.1.6`. On an older DSH version this could produce an `IMAGE_OFFLOAD_REQUIRED_CODE` startup error for a missing export. Upgrade to plugin `0.1.5` or newer and restart:
105
-
106
- ```sh
107
- dsh plugin --profile web add dsh-opencode-go@0.1.7
108
- ```
109
-
110
- For Headless, replace `web` with `headless`. The fix preserves both host behaviors: DSH `0.1.5` turns the oldest image into placeholder text when the request exceeds the image budget, while DSH `0.1.6` continues to record and handle image offloading through the host.
111
-
112
98
  ### The `opencode-go` route is already in use
113
99
 
114
100
  Only one adapter in a profile can provide the `opencode-go` route. If another plugin or a generic pi-ai configuration already connects OpenCode Go, disable that configuration first. Other providers can continue to run.
@@ -125,14 +111,6 @@ A reasoning-capable model without adjustable reasoning levels (for example, `uni
125
111
 
126
112
  If the online configuration is temporarily unavailable, the plugin prefers a configuration fetched successfully earlier in the process and falls back to pi-ai's built-in metadata. If the gateway catalog is unavailable, existing requests can use the last catalog; a Settings refresh reports the failure instead of presenting stale data as current. `refreshMinutes` controls the cache lifetime for ongoing model requests, but does not prevent an explicit model-list read from fetching fresh data.
127
113
 
128
- ## Features
129
-
130
- - **Session headers**: Every request includes the Harness User-Agent and `x-opencode-session`. A session keeps one ID; requests without a session ID receive an independent random value.
131
- - **Streaming and history**: Supports streaming output, tool calls, and history replay through pi-ai.
132
- - **Image input**: Supports models that advertise image capability; the DSH attachment service is required.
133
- - **Model capacity overrides**: Override the context window and maximum output per model, with blank values inheriting the online catalog.
134
- - **Prompt and caching**: The plugin does not add hidden system prompts; the session ID is used for gateway routing.
135
-
136
114
  ## Uninstall
137
115
 
138
116
  Remove the plugin from the relevant profile and restart the application:
package/README.md CHANGED
@@ -2,29 +2,39 @@
2
2
 
3
3
  [English](README.en.md)
4
4
 
5
- 在 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 中使用 OpenCode Go 订阅模型,支持流式回复、工具调用和图片输入。
5
+ 功能:让你在 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 中完美使用 OpenCode Go 订阅模型,支持流式回复、工具调用和图片输入。
6
6
 
7
- 插件会自动添加 OpenCode Go 所需的会话请求头、读取网关模型目录,并显示订阅用量。
7
+ 插件会自动添加 OpenCode Go 所需的会话请求头、读取网关模型目录,并显示订阅用量,无需给模型配置协议、模态、上下文长度、最大输出token
8
+
9
+ ## 功能说明
10
+
11
+ - **会话请求头**:每次请求包含 Harness User-Agent 和 `x-opencode-session`。同一会话保持相同 ID,最佳缓存命中率。
12
+ - **流式与历史**:支持流式输出、工具调用及历史回放,协议请求由 pi-ai 执行。
13
+ - **图片输入**:支持目录中声明图片能力的模型。
14
+ - **模型容量覆盖**:可按模型覆盖上下文窗口和最大输出,空值继承在线目录。
15
+ - **提示与缓存**:插件不增加隐藏系统提示;会话 ID 用于网关路由。
8
16
 
9
17
  ## 安装与使用
10
18
 
11
- 插件 `0.1.7` 兼容 DSH `0.1.5-rc.1`、`0.1.5-rc.2`、`0.1.6-alpha.1`、`0.1.6-alpha.2` 和 `0.1.7-alpha.1`,旧版 DSH 用户无需升级宿主。
19
+ 兼容清单:
20
+ `0.1.5-rc.1`、`0.1.5-rc.2`、`0.1.6-alpha.1`、`0.1.6-alpha.2` 和 `0.1.7-alpha.1`
12
21
 
13
- 如需从源码构建并安装本地包:
22
+ ### 在 DSH 中安装(推荐)
14
23
 
15
- ```sh
16
- npm ci --legacy-peer-deps
17
- npm pack
18
- dsh plugin --profile web add ./dsh-opencode-go-0.1.7.tgz
19
- ```
24
+ 1. 打开 DSH 的 **插件** 页面,点击右上角 **添加插件**。
25
+ 2. 输入 `dsh-opencode-go`,点击 **安装**。
26
+ 3. 安装成功后,如果出现 **立即启用**,点击即可。
20
27
 
21
- 开发依赖包含多代 DSH 的真实测试包,安装时需要 `--legacy-peer-deps`。Headless 用户将 `web` 换成 `headless`。
28
+ ![在 DSH 插件页添加、安装并启用 dsh-opencode-go](docs/assets/install-via-dsh.gif)
22
29
 
30
+ 然后打开 **设置 → OpenCode Go**,填入 API Key 并保存,即可在会话中选择 OpenCode Go 模型。
23
31
 
24
- ### Web
32
+ 若当前 DSH 没有「添加插件」入口,可使用下面的命令行方式。
33
+
34
+ ### 命令行安装(备选)
25
35
 
26
36
  ```sh
27
- dsh plugin --profile web add dsh-opencode-go@0.1.7
37
+ dsh plugin --profile web add dsh-opencode-go@0.1.8
28
38
  ```
29
39
 
30
40
  安装后启动或重启 `dsh web`,然后:
@@ -33,12 +43,12 @@ dsh plugin --profile web add dsh-opencode-go@0.1.7
33
43
  2. 填入 OpenCode Go API Key 并保存。
34
44
  3. 在会话的模型选择器中选择 OpenCode Go 模型。
35
45
 
36
- ### Headless
46
+ ### 无头模式
37
47
 
38
48
  安装到 Headless profile:
39
49
 
40
50
  ```sh
41
- dsh plugin --profile headless add dsh-opencode-go@0.1.7
51
+ dsh plugin --profile headless add dsh-opencode-go@0.1.8
42
52
  ```
43
53
 
44
54
  将以下内容保存为 `headless.patch.yml`,选择默认模型:
@@ -60,33 +70,15 @@ dsh --profile headless --patch ./headless.patch.yml "你好"
60
70
 
61
71
  模型 ID 须在当前网关目录中可用。Web 和 Headless 使用各自的 profile,需要分别安装插件。
62
72
 
63
- ## 模型容量设置
64
-
65
- Web 用户可在 **设置 → OpenCode Go → 模型容量** 中按模型覆盖容量。该区域默认折叠,打开后可以:
66
-
67
- - 搜索模型名称或 ID。
68
- - 设置 **上下文窗口** 和 **最大输出**。
69
- - 查看目录公布的容量作为参考。
70
- - 对单个模型点击 **使用目录值**,或清除全部覆盖。
71
-
72
- 留空的字段会继承目录值。填写的正整数会直接传给适配器,不会被插件自动限制到提供方能力以内;超过上游真实能力的值可能被网关拒绝。修改会跟随设置页的 **Save** / **Discard** 流程,并在下一次请求或模型读取时生效,无需重启。
73
-
74
- Headless 或 profile patch 也可以直接配置 `modelLimits`:
73
+ 如需从源码构建并安装本地包:
75
74
 
76
- ```yaml
77
- - id: opencode-go
78
- config:
79
- modelLimits:
80
- deepseek-v4.1-flash:
81
- contextWindow: 262144
82
- maxTokens: 32768
75
+ ```sh
76
+ npm ci --legacy-peer-deps
77
+ npm pack
78
+ dsh plugin --profile web add ./dsh-opencode-go-0.1.8.tgz
83
79
  ```
84
80
 
85
- 每个模型可以只设置其中一个字段;没有设置的字段沿用已有配置,无已有配置时使用目录值。`maxTokens` 同时约束显式请求的输出预算,较小的请求预算会保留。
86
-
87
- 在分层配置中,将某个模型或字段设为 `null` 可明确恢复在线目录值,即使下层 profile 已有覆盖。Web 的清空和“使用目录值”操作会自动保存这个标记。容量修改保留已获取的原始目录缓存,目录参考值始终显示上游公布的容量。
88
-
89
- DSH `0.1.5` / `0.1.6` 通过旧设置接口保存;`0.1.7-alpha.1` 通过 profile 配置接口保存。五个受支持版本均无需重启即可生效。
81
+ 开发依赖包含多代 DSH 的真实测试包,安装时需要 `--legacy-peer-deps`。Headless 用户将 `web` 换成 `headless`。
90
82
 
91
83
  ## 升级插件
92
84
 
@@ -104,32 +96,6 @@ dsh plugin --profile web update dsh-opencode-go --latest
104
96
 
105
97
  ## 常见问题
106
98
 
107
- ### 升级到 DSH 0.1.7 后的高级设置
108
-
109
- DSH `0.1.7` 将设置改存到当前 profile 的 `cordis.patch.yml`,本插件的条目 ID 为 `opencode-go`;旧宿主继续使用 `settings.yaml` 中的 `llm-opencode-go` 分区。API Key 仍由 credentials 服务保存。
110
-
111
- 上游的一次性设置导入无法自动把第三方插件的旧分区名映射到不同的条目 ID。如果升级后高级配置恢复默认值,可从 DSH home 下的 `settings.yaml.imported`(尚未导入时为 `settings.yaml`)找到 `llm-opencode-go`,在新设置页重新保存其中的配置;也可以将这些字段合并到目标 profile 的已有条目中,保留其他配置:
112
-
113
- ```yaml
114
- - id: opencode-go
115
- config:
116
- # 将旧 llm-opencode-go 分区中需要保留的字段放在这里
117
- apiKeyEnv: OPENCODE_API_KEY
118
- refreshMinutes: 60
119
- ```
120
-
121
- 如果使用了自定义 API Key 引用,须保留原来的 `apiKeyEnv` 值。Web 和 Headless 的配置现在各自独立。
122
-
123
- ### DSH 0.1.5 安装插件后无法启动
124
-
125
- 插件 `0.1.0`–`0.1.4` 使用了 DSH `0.1.6` 新增的图片接口,在旧版 DSH 上可能出现 `IMAGE_OFFLOAD_REQUIRED_CODE` 导出不存在的启动错误。升级插件到 `0.1.5` 或更新版本后重启即可:
126
-
127
- ```sh
128
- dsh plugin --profile web add dsh-opencode-go@0.1.7
129
- ```
130
-
131
- Headless 用户将 `web` 换成 `headless`。修复保留了两版宿主的图片处理方式:DSH `0.1.5` 在请求超过图片预算时将最旧图片转成占位文本,DSH `0.1.6` 继续由宿主记录并处理图片卸载。
132
-
133
99
  ### 提示 `opencode-go` 路由已被占用
134
100
 
135
101
  同一 profile 中只能有一个适配器提供 `opencode-go` 路由。如果已经通过其他插件或通用 pi-ai 配置接入 OpenCode Go,请先停用那一项配置。其他提供方可以继续使用。
@@ -146,14 +112,6 @@ Headless 用户将 `web` 换成 `headless`。修复保留了两版宿主的图
146
112
 
147
113
  在线配置暂时不可达时,优先复用本次运行中成功获取的配置,以 pi-ai 内置配置作为备用。网关目录不可达时,已有请求可以使用上次目录;设置页刷新会显示失败,避免把旧目录误认为最新结果。`refreshMinutes` 只控制已有模型请求的缓存时长,不阻止主动读取列表获取新模型。
148
114
 
149
- ## 功能说明
150
-
151
- - **会话请求头**:每次请求包含 Harness User-Agent 和 `x-opencode-session`。同一会话保持相同 ID,无会话 ID 的请求使用独立随机值。
152
- - **流式与历史**:支持流式输出、工具调用及历史回放,协议请求由 pi-ai 执行。
153
- - **图片输入**:支持目录中声明图片能力的模型,需要 DSH attachment 服务。
154
- - **模型容量覆盖**:可按模型覆盖上下文窗口和最大输出,空值继承在线目录。
155
- - **提示与缓存**:插件不增加隐藏系统提示;会话 ID 用于网关路由。
156
-
157
115
  ## 卸载
158
116
 
159
117
  从对应 profile 移除插件,再重启应用:
Binary file
@@ -1,5 +1,17 @@
1
1
  # Verification
2
2
 
3
+ ## Release 0.1.8 (2026-09-22)
4
+
5
+ Host/client type checks, the build, and all **181 tests in 16 files** pass on macOS / Node.js 24.14.1. Coverage includes the five supported host versions, deprecated-model visibility, model remote injection, and CSS composition in the distributed client. The upstream UI primitives packages still emit missing-source-map warnings; all assertions pass. This release also synchronizes the English README with the simplified Chinese guide and updates installation examples to 0.1.8.
6
+
7
+ ## Model settings layout and deprecated visibility (2026-09-22)
8
+
9
+ The settings page uses the selected list/detail layout, real gateway membership, models.dev release dates and deprecation flags, and a default-off `showDeprecatedModels` switch. Deprecated models stay configurable in settings; only conversation picker membership is filtered. Existing conversations can still call a hidden model that the gateway serves. Models found only in metadata or saved overrides are not displayed. Before any successful gateway response, a network failure does not advertise built-in models.
10
+
11
+ Host/client type checks, the build, and all **181 tests in 16 files** passed. Added checks cover lifecycle date boundaries and ordering, gateway removals, deprecation during metadata outages, real model RPC serialization, immediate visibility changes and picker notifications on legacy settings and the 0.1.7 profile service, and failed toggle writes without discarding other edits. All five published host targets pass the compatibility fixture. Model and usage endpoints share one package contribution so 0.1.7's registry retains both.
12
+
13
+ The actual React settings component was also rendered in a separate local preview with public live API data. Preview settings remain in memory, and credentials are not read or changed. This is a component/browser check, not a manual five-version host UI matrix. No paid completion or publication was performed.
14
+
3
15
  ## Per-model capacities on five hosts (2026-09-22)
4
16
 
5
17
  PR #3's capacity editor is integrated on main commit `b093842`, preserving both legacy settings and the `0.1.7` profile configuration bridge. Each operation applies its captured overrides to original catalog metadata. The catalog cache remains available during outages, discovery shows the original reference values, and configured output caps also constrain explicit request budgets. Null model entries or fields explicitly restore catalog values over inherited configuration.
@@ -160,3 +172,7 @@ All four requests returned HTTP 200 and `finish.kind: stop`. After inspecting ea
160
172
  | 0.1.6-alpha.2 | 8/8 passed | 4.759 s | 133 / 702 |
161
173
 
162
174
  Total: four additional live completion requests and 3,092 reported tokens, including reasoning output. No code corrections or retries were needed. This verifies ordinary text-only code generation and executable output; it does not exercise an agent's multi-turn tool-call workflow. Credential handling was identical to the live image checks above.
175
+
176
+ The settings build was also loaded in the user's running local `0.1.7-alpha.1` Web profile. This exposed a missing `remote.opencodeGoModels` injection in the browser settings scope; both legacy and modern settings bindings now declare it, and the distributed-client regression checks exercise model loading under that injection requirement. After rebuilding and restarting the Host, the real settings page loaded 40 gateway models, including 3 recent releases and 8 deprecated entries, with the deprecated-model switch off. No completion request was sent during this check.
177
+
178
+ Local Web layout checks also cover the settings panel's independent scroll body and reserved save/discard footer. The model panel now uses the settings container's available height and stacks at narrow container widths. At a 600×780 viewport, browser geometry confirmed no footer overlap or horizontal overflow and a visible action row. The client artifact test checks inherited disclosure styles because the CSS-module build previously omitted `composes` entries.