dsh-opencode-go 0.2.0 → 0.2.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/README.en.md +20 -18
- package/README.md +26 -18
- package/THIRD_PARTY_NOTICES.md +5 -1
- package/docs/advanced.en.md +17 -13
- package/docs/advanced.md +18 -13
- package/docs/assets/usage-history-desktop.jpg +0 -0
- package/docs/assets/usage-history-mobile.jpg +0 -0
- package/docs/assets/usage-history-models.jpg +0 -0
- package/docs/development.md +23 -9
- package/docs/usage-analytics.en.md +34 -85
- package/docs/usage-analytics.md +34 -85
- package/docs/verification.md +50 -13
- package/lib/build-info.json +1 -1
- package/lib/client.js +2111 -2257
- package/lib/free-http-worker.js +32 -0
- package/lib/index.js +3078 -1899
- package/lib/types/accounts.d.ts +2 -2
- package/lib/types/adapter.d.ts +24 -9
- package/lib/types/analytics.d.ts +22 -332
- package/lib/types/catalog.d.ts +35 -76
- package/lib/types/client/AnalyticsDialog.d.ts +11 -18
- package/lib/types/client/Section.d.ts +3 -13
- package/lib/types/client/UsagePill.d.ts +10 -3
- package/lib/types/client/controller.d.ts +10 -8
- package/lib/types/client/dashboard-copy.d.ts +58 -0
- package/lib/types/client/index.d.ts +9 -0
- package/lib/types/client/presentation.d.ts +36 -72
- package/lib/types/config.d.ts +5 -1
- package/lib/types/contracts.d.ts +80 -25
- package/lib/types/conversion.d.ts +10 -2
- package/lib/types/free-channel.d.ts +21 -0
- package/lib/types/free-http-worker.d.ts +1 -0
- package/lib/types/free-policy.d.ts +4 -0
- package/lib/types/free-protocol.d.ts +16 -0
- package/lib/types/free-runtime.d.ts +2 -0
- package/lib/types/free-socks-tunnel.d.ts +4 -0
- package/lib/types/free-transport.d.ts +19 -0
- package/lib/types/index.d.ts +1 -1
- package/lib/types/pricing.d.ts +29 -0
- package/lib/types/sdk-types.d.ts +1577 -2890
- package/lib/types/transport.d.ts +13 -5
- package/lib/vendor-licenses.txt +79 -55
- package/package.json +4 -4
- package/docs/assets/usage-panel.png +0 -0
package/README.en.md
CHANGED
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
|
|
16
16
|
DSH already supports OpenCode Go natively. This plugin focuses on usage inside conversations, managing multiple accounts, and dedicated model and settings controls.
|
|
17
17
|
|
|
18
|
+
- **Independent Go and Free routes**: dynamically discover each gateway’s chat models, keep overlapping IDs, and edit them in separate settings tabs. Free shares saved keys and uses public access when none is usable.
|
|
19
|
+
- **Free rate-limit protection**: honors upstream `Retry-After` and pauses new requests during cooldown. Shared Free quota/IP limits do not rotate Go accounts.
|
|
18
20
|
- **Usage at a glance**: see usage beside the conversation input, then open the panel for five-hour, weekly, and monthly percentages and reset times.
|
|
19
21
|
- **Accounts in one place**: inspect each account's quota and key status, drag to reorder, switch inside a conversation, or enable automatic fallback.
|
|
20
22
|
- **Clearer model and settings controls**: search and filter models, adjust visibility, limits, and thinking budgets; advanced settings are grouped by purpose, with hints and a reset action.
|
|
@@ -25,8 +27,6 @@ Supports Chinese and English, following DSH's interface language. The screenshot
|
|
|
25
27
|
|
|
26
28
|
Click the usage pill beside the conversation input to open the current account's subscription usage. Bars show the **percentage used**, turn amber near the limit, and red when exhausted. Each quota window shows its reset time.
|
|
27
29
|
|
|
28
|
-

|
|
29
|
-
|
|
30
30
|
While visible, usage refreshes every minute. Periodic queries pause while the page is hidden and resume with a refresh when it becomes visible. Temporary failures show a warning; retained readings are marked as previous data. Click **Retry now** after a failure, or **Refresh accounts** in the Settings account card.
|
|
31
31
|
|
|
32
32
|
Under **Settings → OpenCode Go → Advanced settings → Usage display**, choose:
|
|
@@ -39,17 +39,19 @@ Under **Settings → OpenCode Go → Advanced settings → Usage display**, choo
|
|
|
39
39
|
|
|
40
40
|
## Usage analytics
|
|
41
41
|
|
|
42
|
-
Open
|
|
42
|
+
Open the dashboard from the conversation input's expanded usage pill or the sidebar dashboard button.
|
|
43
|
+
|
|
44
|
+

|
|
43
45
|
|
|
44
|
-
-
|
|
45
|
-
- Cost uses the request start time. DeepSeek V4.1 Flash and V4 Pro are charged at twice the off-peak rate during the official peak window (01:00–04:00 and 06:00–10:00 UTC, Monday through Friday).
|
|
46
|
-
- Each model row shows only the display name and usage figures. Official quota percentages remain authoritative; the estimate is not an invoice.
|
|
47
|
-
- A scan stops at 500 sessions, 500,000 events, or 12 seconds by default and says so, including why. **Scan more history** raises the session cap to 2,000; the choice is remembered locally. Session folds are reused in memory for at most five seconds and scanned again after a restart; no fold cache is written to disk.
|
|
48
|
-
- DSH's native OpenCode Go route is excluded; pre-0.1.16 legacy route records are admitted by request time. A Host without `sessionQuery` shows an unavailable state.
|
|
46
|
+
[Narrow-screen light preview](docs/assets/usage-history-mobile.jpg) · [Model rankings and detail](docs/assets/usage-history-models.jpg), both using sample data.
|
|
49
47
|
|
|
50
|
-
|
|
48
|
+
- **One official source**: totals, daily charts and model detail use the same official daily CSV, covering requests, input/output/cache tokens and the official usage amount. Models are grouped by provider + model. Ranges are today, 7, 30 and 90 days; all dates use UTC.
|
|
49
|
+
- **Independent viewing account**: defaults to the current inference account and shows only the workspace belonging to the selected key, including calls from other clients. Changing the viewing account does not change the conversation account. All three dashboard quota windows follow the selection. Anonymous Free coverage is not guaranteed.
|
|
50
|
+
- **Official usage amount**: sums `cost_micro_cents` directly (`1 USD = 100,000,000` units); it does not mean an additional Go charge. Official daily aggregates may be delayed.
|
|
51
|
+
- **One visual language**: settings, the usage pill, sidebar and dashboard share warm paper / charcoal surfaces and terracotta accents, following the Host's light/dark mode. Locally installed Anthropic Serif / Sans / Mono fonts are preferred, with system and CJK serif fallbacks. The dashboard becomes full-screen on narrow screens and retains daily token/request bars, model rankings and details.
|
|
52
|
+
- **On-demand queries**: history loads when opening, changing account or range, or refreshing manually. The Host uses a 30-second cache; forced refresh bypasses it. History is not polled in the background. Only official model gateway configurations support it; errors remain explicit without falling back to local scans.
|
|
51
53
|
|
|
52
|
-
See [usage analytics notes](docs/usage-analytics.en.md) for
|
|
54
|
+
Keys stay on the Host. Normal reports send the browser only aggregate numbers and provider / model / day; an official CSV explicitly downloaded by the user may contain member fields. See [usage analytics notes](docs/usage-analytics.en.md) for accounting and privacy details.
|
|
53
55
|
|
|
54
56
|
## Manage multiple accounts
|
|
55
57
|
|
|
@@ -114,19 +116,19 @@ Search **Available models** by name or ID, or filter by **New in 7 days**, **Cus
|
|
|
114
116
|
- Select a model to inspect its catalog context window, maximum output, and input modalities. Save limit overrides to apply them; empty values use defaults.
|
|
115
117
|
- Reasoning models offer the applicable switch, effort, or token budget options. Budget-based models also accept custom budgets that become available after saving.
|
|
116
118
|
|
|
117
|
-
|
|
119
|
+
Any model with an output capacity above **65,536 tokens** defaults to that allowance when neither the caller nor settings specifies one. Smaller models retain their SDK defaults. DSH receives the same allowance for compaction budgeting. Set a model’s **Max output** override when a longer answer is needed.
|
|
118
120
|
|
|
119
121
|
Streaming, reasoning, tool calls, and image input depend on model capabilities. Input modalities shown in Settings come from online model metadata; this plugin currently converts and forwards only image attachments.
|
|
120
122
|
|
|
121
123
|
### Grouped advanced settings
|
|
122
124
|
|
|
123
|
-
Advanced settings are grouped into **Usage
|
|
125
|
+
Advanced settings are grouped into **Usage settings**, **Connection**, **Cache and timeouts**, and **Image handling**. Hover over a question mark for help. **Reset all to defaults** clears the card's custom overrides; save to apply the reset. The current account selection is preserved.
|
|
124
126
|
|
|
125
127
|

|
|
126
128
|
|
|
127
129
|
HTTP, HTTPS, and SOCKS5 proxies are supported. After saving, subsequent conversations, catalog updates, and usage queries use the proxy. Connections originate from the machine running DSH; on a remote deployment, `127.0.0.1` refers to that server.
|
|
128
130
|
|
|
129
|
-
|
|
131
|
+
Set `baseURL` and `freeBaseURL` independently under Connection. Protocol selection follows the gateway model declaration. See the [advanced guide](docs/advanced.en.md) for account, model-key and disk-cache details.
|
|
130
132
|
|
|
131
133
|
Screenshots illustrate the interface. Actual models, quotas, and timestamps depend on your account and the current online catalog.
|
|
132
134
|
|
|
@@ -158,15 +160,15 @@ dsh plugin --profile web remove dsh-opencode-go
|
|
|
158
160
|
|
|
159
161
|
## Architecture and verification
|
|
160
162
|
|
|
161
|
-
The source
|
|
163
|
+
The source is organized by domain:
|
|
162
164
|
|
|
163
165
|
| Domain | Modules |
|
|
164
166
|
| --- | --- |
|
|
165
167
|
| Plugin composition, settings and contracts | `index.ts`, `config.ts`, `contracts.ts` |
|
|
166
168
|
| Requests, model catalog and protocol conversion | `adapter.ts`, `catalog.ts`, `conversion.ts`, `google.ts`, `sdk-types.ts` |
|
|
167
|
-
| Accounts, official quota,
|
|
169
|
+
| Accounts, official quota, official CSV history and transport | `accounts.ts`, `analytics.ts`, `transport.ts` |
|
|
168
170
|
| Browser registration and typed state | `client/index.ts`, `client/controller.ts` |
|
|
169
|
-
|
|
|
171
|
+
| Host settings, account/model controls, usage and copy | `client/Section.tsx`, `client/UsagePill.tsx`, `client/AnalyticsDialog.tsx`, `client/presentation.ts` |
|
|
170
172
|
|
|
171
173
|
The browser uses DSH's `configForms`; capacities remain typed objects while editing. Images use per-request count and encoded-byte budgets, with at most four preparations per request. The package keeps its `.` and `./client` exports. Development dependencies pin DSH `0.2.1-rc.5` and Cordis `4.0.5`; runtime Cordis requires `~4.0.5`.
|
|
172
174
|
|
|
@@ -180,12 +182,12 @@ npm run check:dist
|
|
|
180
182
|
npm run verify
|
|
181
183
|
```
|
|
182
184
|
|
|
183
|
-
|
|
185
|
+
Tests cover host services, accounts, catalog, protocols, analytics, transport, Free backoff, and browser interactions. After changing source, run `npm run compile` to rebuild `lib/`. `verify` runs type checks, artifact comparison, the full test suite and the package-loading smoke. See [development](docs/development.md) for separate installed-consumer and Headless checks.
|
|
184
186
|
|
|
185
187
|
## More documentation
|
|
186
188
|
|
|
187
189
|
- [Advanced guide: Headless, proxies, manual configuration, and error diagnostics](docs/advanced.en.md)
|
|
188
|
-
- [Usage analytics:
|
|
190
|
+
- [Usage analytics: official source, accounting, and privacy](docs/usage-analytics.en.md)
|
|
189
191
|
- [Development and testing](docs/development.md)
|
|
190
192
|
- [Verification notes](docs/verification.md)
|
|
191
193
|
- [Issues and suggestions](https://github.com/Duskriver/dsh-opencode-go/issues)
|
package/README.md
CHANGED
|
@@ -19,10 +19,12 @@ DSH 原生支持接入 OpenCode Go,但原生模式无法满足复杂的生产
|
|
|
19
19
|
|
|
20
20
|
## ✨ 核心特性
|
|
21
21
|
|
|
22
|
+
- 🆓 **双路由动态模型目录**:Go 与平台免费模型分别从各自网关的 `/models` 发现,保留同名模型;Free 无 Key 时可使用公共访问,两套模型开关与容量设置独立。
|
|
23
|
+
- 🛑 **免费通道限流保护**:遵循上游 `Retry-After`,冷却期间暂停新请求;共享免费额度或 IP 限制不会触发 Go 换号。
|
|
22
24
|
- 🛡️ **多账号无感容灾**:支持最多 20 个账号集中管理与拖拽排序。当主账号额度耗尽或 Key 失效时,**在输出前自动尝试备用账号**,成功后自动扶正,告别“聊到一半额度没了”的打断感。
|
|
23
25
|
- ⚡ **会话级 Prompt 缓存绑定**:严格遵循网关协议注入专有 `x-opencode-session` 路由头,稳定复用网关上下文缓存,显著降低响应首字延迟。
|
|
24
26
|
- 📊 **会话内额度实时透视**:在聊天输入框旁常驻“用量胶囊”,直观展示 5 小时滚动、每周、每月的额度百分比及重置时间倒计时;支持休眠节能与静默刷新。
|
|
25
|
-
- 💰
|
|
27
|
+
- 💰 **官方历史用量看板**:按所选 Key 的工作区汇总官方每日 CSV,查看请求、Token、官方用量金额与模型明细,包含其他客户端的调用。
|
|
26
28
|
- 🎛️ **模型与热配置**:无需重启 DSH!随时在线调整模型上下文窗口、最大输出上限、思考预算(Thinking Budget),并支持 HTTP/HTTPS/SOCKS5 代理。
|
|
27
29
|
|
|
28
30
|
---
|
|
@@ -73,8 +75,6 @@ dsh plugin --profile web add dsh-opencode-go
|
|
|
73
75
|
|
|
74
76
|
在聊天输入区旁,常驻有直观的“用量胶囊”。点击即可展开完整的用量卡片:
|
|
75
77
|
|
|
76
|
-

|
|
77
|
-
|
|
78
78
|
- **三窗口精准监控**:
|
|
79
79
|
- 🟢 **5 小时滚动配额**:短周期高频使用的健康度。
|
|
80
80
|
- 🟡 **每周配额**:本周累计使用进度。
|
|
@@ -87,19 +87,27 @@ dsh plugin --profile web add dsh-opencode-go
|
|
|
87
87
|
- **常驻**:切换到其他厂商模型时,仍然保持胶囊显示。
|
|
88
88
|
- **关闭**:隐藏胶囊并停止后台用量轮询。
|
|
89
89
|
|
|
90
|
-
### 3.
|
|
90
|
+
### 3. 官方历史用量看板(Analytics)
|
|
91
|
+
|
|
92
|
+
从对话输入框的用量胶囊展开面板,或侧栏的看板按钮打开:
|
|
93
|
+
|
|
94
|
+

|
|
95
|
+
|
|
96
|
+
[窄屏浅色预览](docs/assets/usage-history-mobile.jpg) · [模型排行与明细预览](docs/assets/usage-history-models.jpg)(均为示例数据)
|
|
91
97
|
|
|
92
|
-
|
|
98
|
+
- **官方 CSV 单一来源**:请求、输入 / 输出 / 缓存 Token、官方用量金额、每日图表与模型明细来自同一份官方每日 CSV;provider + model 区分同名模型。支持今日、7 / 30 / 90 天,日期统一使用 UTC。
|
|
99
|
+
- **独立查看账号**:默认当前调用账号,只查看所选 Key 所属工作区,包含其他客户端;切换查看账号不改变对话账号。看板的三个额度窗口跟随所选账号。匿名 Free 覆盖不作保证。
|
|
100
|
+
- **官方用量金额**:直接汇总 `cost_micro_cents`(1 美元 = 1 亿单位),不等同于 Go 额外扣款。官方日汇总可能延迟。
|
|
101
|
+
- **统一界面**:设置页、用量胶囊、侧栏与看板统一采用暖纸色 / 炭灰色和陶土色强调,跟随宿主明暗。优先使用本地 Anthropic Serif / Sans / Mono 字体,中文标题配衬线回退;宽屏弹窗、窄屏全屏,保留 Token 堆叠或请求日柱图、模型排行与明细。
|
|
102
|
+
- **按需查询**:打开、切账号、切区间或手动刷新时查询,Host 短缓存 30 秒,强制刷新绕过缓存,不后台轮询历史。仅官方模型网关支持历史查询;错误明确显示,不回退本地扫描。
|
|
93
103
|
|
|
94
|
-
|
|
95
|
-
- **峰谷电价式开销估算**:使用从 models.dev 获取的模型价格;自动识别 DeepSeek V4.1 Flash / V4 Pro 等模型的官方峰时时段(UTC 周一至周五 01:00–04:00、06:00–10:00)并按双倍费率估算金额。
|
|
96
|
-
- **四款专属主题**:支持在 **寂静黑 / 石墨(默认)/ 海盐青 / 暖砂** 之间切换,自动适配系统的亮色/暗色模式。
|
|
104
|
+
Key 留在 Host;常规报告只向浏览器传递聚合数字与 provider / model / day。用户主动下载的官方 CSV 可包含成员字段。完整口径见[用量统计说明](docs/usage-analytics.md)。
|
|
97
105
|
|
|
98
106
|
---
|
|
99
107
|
|
|
100
108
|
## 🛠️ 架构设计与工作原理
|
|
101
109
|
|
|
102
|
-
|
|
110
|
+
源码按领域组织,宿主与浏览器通过 DSH Typert RPC 通讯:
|
|
103
111
|
|
|
104
112
|
```text
|
|
105
113
|
src/
|
|
@@ -110,14 +118,14 @@ src/
|
|
|
110
118
|
├── conversion.ts 上下文、单次请求图片预算、回放与流转换
|
|
111
119
|
├── google.ts + sdk-types.ts Google SDK 接入与公开类型
|
|
112
120
|
├── accounts.ts 串行账号命令、凭据写入与官方配额
|
|
113
|
-
├── analytics.ts
|
|
121
|
+
├── analytics.ts 官方每日 CSV、历史聚合与短缓存
|
|
114
122
|
├── transport.ts HTTP/HTTPS/SOCKS5、超时与脱敏错误
|
|
115
123
|
└── client/
|
|
116
124
|
├── index.ts + controller.ts configForms 接入、类型化草稿与账号操作
|
|
117
|
-
├── Section.tsx
|
|
125
|
+
├── Section.tsx 宿主设置页、账号卡片与模型编辑器
|
|
118
126
|
├── UsagePill.tsx 会话额度胶囊
|
|
119
|
-
├── AnalyticsDialog.tsx
|
|
120
|
-
└── presentation.ts
|
|
127
|
+
├── AnalyticsDialog.tsx 官方历史用量看板
|
|
128
|
+
└── presentation.ts 多语言、明暗配色与显示格式
|
|
121
129
|
```
|
|
122
130
|
|
|
123
131
|
账号操作在内存串行队列中直接更新凭据与设置。模型容量草稿始终保留为对象;图片按单次请求限制数量、编码字节及最多四路并行准备。宿主仅使用 DSH `0.2.1-rc.5` 起提供的设置与图片卸载接口。包的 `.` 与 `./client` 导出路径保持不变。
|
|
@@ -137,7 +145,7 @@ OpenCode Go 网关具有会话粘性路由与上下文缓存共享能力。插
|
|
|
137
145
|
- **显示开关**:自由隐藏不常用的模型,净化聊天选择器。
|
|
138
146
|
- **容量与上下文覆盖**:可手动指定上下文窗口(Context Window)与单次最大输出 Token。
|
|
139
147
|
- **思考预算(Thinking Budget)**:对支持深度思考的模型,可自定义思考强度等级或 Token 预算。
|
|
140
|
-
-
|
|
148
|
+
- **默认输出预算**:任意模型声明的输出上限超过 65,536 且调用方与设置均未显式指定时,默认封顶 **65,536 tokens**;较小模型保留 SDK 默认值。该预算同时报告给 DSH,用于上下文压缩。
|
|
141
149
|
|
|
142
150
|
### 分组高级设置
|
|
143
151
|
支持在 **设置 → OpenCode Go → 高级设置** 中按需微调:
|
|
@@ -177,9 +185,9 @@ OpenCode Go 网关具有会话粘性路由与上下文缓存共享能力。插
|
|
|
177
185
|
<details>
|
|
178
186
|
<summary><strong>Q: 插件在执行过程中会自动将我的数据上传到第三方吗?</strong></summary>
|
|
179
187
|
|
|
180
|
-
正常对话会把请求内容发送到你配置的模型网关(默认为 OpenCode Go
|
|
188
|
+
正常对话会把请求内容发送到你配置的模型网关(默认为 OpenCode Go 官方网关),额度查询也会访问该网关。插件从 Go 与平台网关各自的 `/models` 下载公开的模型能力与价格;默认地址分别为 `https://opencode.ai/inference/go/v1` 与 `https://opencode.ai/inference/v1`。
|
|
181
189
|
|
|
182
|
-
|
|
190
|
+
历史看板由 Host 使用所选 Key 请求官方 Console 的每日 CSV,仅支持官方模型网关配置,沿用代理设置。浏览器常规报告只收到聚合数字与 provider / model / day,不含 Key、会话正文或成员字段;主动下载的官方 CSV 可包含成员字段。模型发现请求不携带会话正文、账号密钥或逐条统计记录。
|
|
183
191
|
</details>
|
|
184
192
|
|
|
185
193
|
---
|
|
@@ -211,14 +219,14 @@ npm run check:dist
|
|
|
211
219
|
npm run verify
|
|
212
220
|
```
|
|
213
221
|
|
|
214
|
-
|
|
222
|
+
测试按领域覆盖宿主、协议转换、账号、统计、传输、免费通道退避、前端。修改源码后先运行 `npm run compile` 更新 `lib/`;`verify` 包含类型检查、产物一致性、全量测试与包加载冒烟。独立安装和 Headless 验证见[开发说明](docs/development.md)。
|
|
215
223
|
|
|
216
224
|
---
|
|
217
225
|
|
|
218
226
|
## 📚 更多文档与链接
|
|
219
227
|
|
|
220
228
|
- 📖 [高级使用指南(Headless 部署、代理策略与错误排查)](docs/advanced.md)
|
|
221
|
-
- 📊 [
|
|
229
|
+
- 📊 [用量看板统计说明(官方来源、口径与隐私)](docs/usage-analytics.md)
|
|
222
230
|
- 🛠️ [开发与贡献指南](docs/development.md)
|
|
223
231
|
- 🧪 [验收范围与验证记录](docs/verification.md)
|
|
224
232
|
- 🐛 [提交 Issue 与建议](https://github.com/Duskriver/dsh-opencode-go/issues)
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -4,8 +4,12 @@ The initial adapter, settings UI, and `src/conversion.ts` were derived from Deep
|
|
|
4
4
|
|
|
5
5
|
Original additions and subsequent modifications made in this project are copyright (c) 2026 dsh-opencode-go contributors and are also licensed under MIT. LICENSE records both the upstream attribution and this project's contributor attribution.
|
|
6
6
|
|
|
7
|
-
The host bundle includes the required portions of `@earendil-works/pi-ai@1.
|
|
7
|
+
The host bundle includes the required portions of `@earendil-works/pi-ai@1.5.0`, `@google/genai@2.21.0` and their bundled dependencies; SDK declarations include pi-ai, pi-telemetry and pi-schema types. Their original licenses are reproduced in `lib/vendor-licenses.txt`, including the Google SDK's Apache-2.0 license and data-uri-to-buffer's MIT license from its published README. The pi packages' license comes from the [upstream v1.5.0 license](https://github.com/earendil-works/pi/blob/v1.5.0/LICENSE), which their npm distributions omit, and is retained in `scripts/licenses/pi-1.5.0-LICENSE`. OpenAI and Anthropic transport SDKs remain separate runtime dependencies.
|
|
8
|
+
|
|
9
|
+
pi-ai 1.5.0 replaces its TypeBox dependency with `@earendil-works/pi-schema@1.5.0`. pi-schema includes format checks and value conversion rules adapted from TypeBox 1.3.27, copyright (c) 2017-2026 Haydn Paterson, under MIT. Its bundled `LICENSES/typebox-LICENSE` is also reproduced in `lib/vendor-licenses.txt`. pi-ai pins both pi-schema and pi-telemetry to 1.5.0, so this package no longer needs a dependency override.
|
|
8
10
|
|
|
9
11
|
The bundled Google SDK's HTTP fetch call is modified at build time to use the plugin's request-scoped fetch binding. Its message serialization and stream parser remain upstream implementations.
|
|
10
12
|
|
|
11
13
|
The GitHub icon in the settings footer comes from Simple Icons, distributed under CC0 1.0 Universal.
|
|
14
|
+
|
|
15
|
+
Free HTTP transport uses the official `bun@1.4.4` optional dependency and its platform packages. Bun is maintained by Oven and contributors and distributed under its upstream license and third-party notices; the runtime remains a separate npm dependency rather than part of this package's JavaScript bundle. See [Bun's license](https://github.com/oven-sh/bun/blob/bun-v1.4.4/LICENSE.md). The HTTP worker and Node bridge in this project are original code.
|
package/docs/advanced.en.md
CHANGED
|
@@ -42,24 +42,25 @@ socks5://127.0.0.1:1080
|
|
|
42
42
|
|
|
43
43
|
HTTP, HTTPS, SOCKS5, and URLs containing a username and password are supported. Subsequent conversations, catalog updates, and usage queries use the saved proxy. Connections originate from the machine running DSH; on a remote deployment, `127.0.0.1` refers to that server.
|
|
44
44
|
|
|
45
|
-
###
|
|
45
|
+
### Dual routes and manual configuration
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
`dsh-opencode-go` (DSH OpenCode Go) discovers all chat models from `baseURL/models` and activates when at least one usable API key is configured. `dsh-opencode-free` (DSH OpenCode Free) discovers only chat models with a valid declared tariff whose text input, output, cache and every context tier are all zero, from `freeBaseURL/models`. Missing or invalid prices never qualify as free. Free activates whenever the plugin is enabled.
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
Free shares the account roster, prefers usable saved keys and follows automatic account retry settings. Without a usable key it sends `Bearer public`. Both routes preserve original model IDs, including overlapping names. Settings provides separate model tabs; Go keeps existing ID keys, while Free uses `dsh-opencode-free/<model ID>` in visibility and capacity settings.
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
- id: opencode-go
|
|
53
|
-
config:
|
|
54
|
-
protocolOverrides:
|
|
55
|
-
deepseek-v4.1-flash: openai-responses
|
|
56
|
-
```
|
|
51
|
+
Free inference sends direct API requests through the bundled standalone Bun 1.4.4 HTTP worker, with no local OpenCode dependency. The existing Node SDK still handles discovery, message/tool conversion and response parsing; Go retains its transport. Free uses the observed `opencode/latest/2.2.5/cli` user agent and the existing host-session normalization, without placeholder tools or captured account/project/session values. Compatibility does not guarantee upstream free access.
|
|
57
52
|
|
|
58
|
-
|
|
53
|
+
Free requests handle rate limits automatically. `FreeUsageLimitError` becomes `FREE_QUOTA`, a generic 429 becomes `FREE_RATE_LIMIT`, an explicit OpenCode client restriction becomes `FREE_CLIENT_RESTRICTED`, and an otherwise unclassified 403 becomes `FREE_ACCESS_DENIED`. Go error codes and account switching retain their behavior. Explicit Go account quota/authentication failures on Free still follow existing account fallback settings; shared Free limits neither rotate accounts nor fall back to paid Go.
|
|
59
54
|
|
|
60
|
-
|
|
55
|
+
Shared Free restrictions and network, timeout or server errors honor `Retry-After` delta-seconds or HTTP-date, including delays of many hours. Without a valid header, exponential backoff starts at 60 seconds and caps at 15 minutes. Cooldowns are isolated by Free gateway and proxy configuration. New calls during cooldown return `FREE_COOLDOWN` without inference traffic; no automatic retry is scheduled. Users can retry after expiry; success resets the fallback counter. State is held in the plugin instance and starts fresh after restart.
|
|
61
56
|
|
|
62
|
-
|
|
57
|
+
The platform binary installs through npm optional dependencies. Install scripts may be disabled, but optional dependencies must be included. A missing runtime reports `MISSING_BUN_RUNTIME` on Free; reinstall the plugin with optional dependencies enabled. Go remains available. Supported operating systems and CPUs follow Bun's official platform packages.
|
|
58
|
+
|
|
59
|
+
Each Free HTTP request owns a worker, with at most four concurrent workers and cancellable queueing. Requests use stdin; response headers and raw SSE bytes use stdout. Keys never enter argv or temporary files. Consumer cancellation, timeouts and plugin unload stop requests and reap workers. Encoded IPC requests are limited to 256 MiB. Bun handles HTTP/HTTPS proxies; SOCKS5 uses a per-request loopback byte tunnel with random authentication credentials while Bun still performs target TLS. A proxy failure never falls back to a direct connection.
|
|
60
|
+
|
|
61
|
+
Protocols, capabilities, reasoning controls and tariffs come directly from each gateway’s `/models` entries. Official gateways prefer declared protocol URLs; custom gateways keep their configured prefix. Separate `go.models.json` and `free.models.json` files under `~/.dsh/cache/dsh-opencode-go/` support ETag revalidation and offline retention. Cache documents identify their source URL and cannot be reused for another gateway.
|
|
62
|
+
|
|
63
|
+
The following patch configures shared accounts and per-model settings:
|
|
63
64
|
|
|
64
65
|
```yaml
|
|
65
66
|
- id: opencode-go
|
|
@@ -73,11 +74,14 @@ Add an `opencode-go` configuration block to a patch file. It can be combined wit
|
|
|
73
74
|
name: Backup
|
|
74
75
|
apiKeyEnv: OPENCODE_GO_BACKUP_KEY
|
|
75
76
|
autoSwitch: true
|
|
77
|
+
freeBaseURL: https://opencode.ai/inference/v1
|
|
76
78
|
proxyURL: http://127.0.0.1:7890
|
|
77
79
|
refreshMinutes: 60
|
|
78
80
|
modelVisibility:
|
|
79
81
|
deepseek-v4-pro: false
|
|
80
82
|
modelLimits:
|
|
83
|
+
dsh-opencode-free/beam-free:
|
|
84
|
+
maxTokens: 8192
|
|
81
85
|
deepseek-v4.1-flash:
|
|
82
86
|
maxTokens: 8192
|
|
83
87
|
qwen3.7-plus:
|
|
@@ -90,11 +94,11 @@ Keep the options you need and supply the corresponding keys through DSH credenti
|
|
|
90
94
|
| Option | Purpose |
|
|
91
95
|
| --- | --- |
|
|
92
96
|
| `baseURL` | OpenCode Go gateway address; defaults to `https://opencode.ai/inference/go/v1`, with official inference endpoints selected by model protocol |
|
|
97
|
+
| `freeBaseURL` | Platform free gateway, default `https://opencode.ai/inference/v1`; editable with URL validation in advanced settings |
|
|
93
98
|
| `usageDisplay` | Usage display mode: `auto`, `always`, or `off` |
|
|
94
99
|
| `proxyURL` | Network proxy; an empty string uses the default network settings |
|
|
95
100
|
| `refreshMinutes` | Model catalog cache lifetime; defaults to 60 minutes, with manual refresh available in Settings |
|
|
96
101
|
| `modelVisibility` | Control model picker visibility by model ID |
|
|
97
|
-
| `protocolOverrides` | Experimental `deepseek-v4.1-flash: openai-responses`; unset or null follows the gateway |
|
|
98
102
|
| `modelLimits` | Per-model `contextWindow` and `maxTokens` overrides, plus additional `thinkingBudgets` options; null uses defaults |
|
|
99
103
|
| `maxImages` | Maximum images in one request's history; unset by default, with oldest images offloaded when exceeded |
|
|
100
104
|
| `streamIdleTimeoutMs` | Maximum wait for the next stream event; defaults to 300000 milliseconds |
|
package/docs/advanced.md
CHANGED
|
@@ -42,20 +42,23 @@ socks5://127.0.0.1:1080
|
|
|
42
42
|
|
|
43
43
|
支持 HTTP、HTTPS、SOCKS5 和带用户名、密码的代理 URL。保存后,后续对话、模型目录更新和用量查询使用新代理。代理运行在 DSH 所在的机器上;远程部署中的 `127.0.0.1` 指服务器自身。
|
|
44
44
|
|
|
45
|
-
###
|
|
45
|
+
### 双路由与手动配置
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
`dsh-opencode-go`(DSH OpenCode Go)从 `baseURL` 的 `/models` 动态发现全部聊天模型,需要至少一个可用 API Key 才激活。`dsh-opencode-free`(DSH OpenCode Free)从 `freeBaseURL` 的 `/models` 筛选已声明合法价格、且文本输入、输出、缓存及所有上下文阶梯均为零的聊天模型;缺失或非法价格不会被视为免费。插件开启即激活 Free 路由。
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
Free 共用账号列表,优先使用已配置的可用 Key,并遵循多账号自动切换设置;没有可用 Key 时使用 `Bearer public`。两个路由分别保留原始模型 ID,同名模型可同时存在。设置页顶部的两个模型 Tab 分别编辑各自列表;Go 沿用原 ID 设置键,Free 使用 `dsh-opencode-free/<模型 ID>`。
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
protocolOverrides:
|
|
55
|
-
deepseek-v4.1-flash: openai-responses
|
|
56
|
-
```
|
|
51
|
+
Free 推理通过插件附带的独立 Bun 1.4.4 HTTP worker 直接发送 API 请求;不依赖本机 OpenCode。模型发现、消息和工具转换、响应解析仍由现有 Node SDK 负责,Go 沿用原传输。Free 使用实测的 `opencode/latest/2.2.5/cli` UA,保留宿主会话 ID 的原有规范化,不注入占位工具或抓包中的账号、项目和会话值。这些兼容行为不保证上游开放免费服务。
|
|
52
|
+
|
|
53
|
+
Free 请求自动处理限流:`FreeUsageLimitError` 返回 `FREE_QUOTA`,普通 429 返回 `FREE_RATE_LIMIT`,明确的 OpenCode 客户端限制返回 `FREE_CLIENT_RESTRICTED`,其他未明确分类的 403 返回 `FREE_ACCESS_DENIED`。Go 的错误码和账号切换保持原有规则;Free 中明确的 Go 账号额度或凭据错误仍可按既有设置切换账号,共享 Free 限制不会换号或回退到付费 Go。
|
|
57
54
|
|
|
58
|
-
|
|
55
|
+
对共享免费限制及网络、超时、服务端错误,优先遵循 `Retry-After` 秒数或 HTTP 日期(不会把数小时的退避缩短成几分钟);没有有效头时,从 60 秒开始指数退避,最多 15 分钟。冷却按免费网关与代理配置隔离,冷却期间新调用返回 `FREE_COOLDOWN`,不发送推理请求,也不自动定时重试。到期后可由用户重试;成功请求重置本地退避计数。退避计数只保存在当前插件实例内,重启后清空。
|
|
56
|
+
|
|
57
|
+
Bun 通过 npm 可选依赖安装对应平台的二进制;禁用安装脚本仍可使用,但不能省略可选依赖。若缺少运行时,Free 会报告 `MISSING_BUN_RUNTIME`,可重新安装插件并启用 optional dependencies;Go 不受影响。当前平台包支持的系统和 CPU 以 Bun 的官方发行包为准。
|
|
58
|
+
|
|
59
|
+
每个 Free HTTP 请求使用一个 worker,默认最多并发 4 个,其余请求可排队或取消。请求通过标准输入传递,响应头和原始 SSE 字节通过标准输出返回;Key 不进入命令行参数或临时文件。消费者停止、超时、取消或卸载插件都会终止相关请求并回收 worker。IPC 请求上限为编码后 256 MiB。HTTP/HTTPS 代理由 Bun 连接;SOCKS5 使用该请求专属、带随机认证凭据的本机字节隧道,目标 TLS 握手仍由 Bun 完成。代理失败不会回退到直连。
|
|
60
|
+
|
|
61
|
+
协议、能力、思考控制与价格直接来自各自的 `/models` 条目。官方网关优先使用条目声明的协议地址;自定义网关保留配置的前缀。两个模型源分别缓存到 `~/.dsh/cache/dsh-opencode-go/go.models.json` 与 `free.models.json`,支持 ETag 与离线保留;缓存带有网关来源标记,不会用于其他地址。
|
|
59
62
|
|
|
60
63
|
在 patch 文件中添加 `opencode-go` 配置块,可与上面的默认模型配置一起使用:
|
|
61
64
|
|
|
@@ -71,11 +74,14 @@ socks5://127.0.0.1:1080
|
|
|
71
74
|
name: 备用账号
|
|
72
75
|
apiKeyEnv: OPENCODE_GO_BACKUP_KEY
|
|
73
76
|
autoSwitch: true
|
|
77
|
+
freeBaseURL: https://opencode.ai/inference/v1
|
|
74
78
|
proxyURL: http://127.0.0.1:7890
|
|
75
79
|
refreshMinutes: 60
|
|
76
80
|
modelVisibility:
|
|
77
81
|
deepseek-v4-pro: false
|
|
78
82
|
modelLimits:
|
|
83
|
+
dsh-opencode-free/beam-free:
|
|
84
|
+
maxTokens: 8192
|
|
79
85
|
deepseek-v4.1-flash:
|
|
80
86
|
maxTokens: 8192
|
|
81
87
|
qwen3.7-plus:
|
|
@@ -88,11 +94,11 @@ socks5://127.0.0.1:1080
|
|
|
88
94
|
| 配置项 | 用途 |
|
|
89
95
|
| --- | --- |
|
|
90
96
|
| `baseURL` | OpenCode Go 网关地址,默认 `https://opencode.ai/inference/go/v1`;官方网关自动按模型协议选择推理端点 |
|
|
97
|
+
| `freeBaseURL` | 平台免费模型网关,默认 `https://opencode.ai/inference/v1`;高级设置可编辑并校验 URL |
|
|
91
98
|
| `usageDisplay` | 额度显示模式:`auto`、`always` 或 `off` |
|
|
92
99
|
| `proxyURL` | 网络代理;空字符串使用默认网络设置 |
|
|
93
100
|
| `refreshMinutes` | 模型目录缓存时长,默认 60 分钟;设置页可随时手动刷新 |
|
|
94
|
-
| `modelVisibility` |
|
|
95
|
-
| `protocolOverrides` | 实验性协议覆盖;目前仅支持 `deepseek-v4.1-flash: openai-responses`,省略或模型值为 `null` 时自动跟随目录 |
|
|
101
|
+
| `modelVisibility` | Go 用原模型 ID;Free 用 `dsh-opencode-free/<模型 ID>`,分别控制显示 |
|
|
96
102
|
| `modelLimits` | 按模型覆盖 `contextWindow`、`maxTokens`,或用 `thinkingBudgets` 添加思考预算选项;空值使用默认设置 |
|
|
97
103
|
| `maxImages` | 单次请求历史中的图片数量上限,默认不设上限;超过时先卸载最旧图片 |
|
|
98
104
|
| `streamIdleTimeoutMs` | 等待下一个流事件的最长时间,默认 300000 毫秒 |
|
|
@@ -116,7 +122,6 @@ socks5://127.0.0.1:1080
|
|
|
116
122
|
|
|
117
123
|
图片数量超限会在附件读取前检测。每个请求最多并发准备 4 张图片,并在已知编码大小超过单次请求预算时停止;插件不再维护全局图片队列或共享内存池。
|
|
118
124
|
|
|
119
|
-
|
|
120
125
|
首次查询目录失败会报告 `DISCOVERY_FAILED`;已有目录时保留之前确认过的模型。网关明确返回空列表才会清空目录。列表中仅部分行格式错误时,仍可使用有效模型,设置页与日志会提示被忽略的行数。高级表单的普通配置项一次提交并检查版本;凭据由独立服务保存,凭据保存失败时保留其草稿,重试只提交未成功的部分。
|
|
121
126
|
|
|
122
127
|
请求失败时,错误信息仍包含 HTTP 分类、脱敏后的上游摘要,以及适用的上下文容量提示。插件不再输出内部诊断文件或逐调用追踪。
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/docs/development.md
CHANGED
|
@@ -19,37 +19,41 @@ The development baseline is DSH `0.2.1-rc.5`, Cordis `4.0.5` and Schemastery `3.
|
|
|
19
19
|
|
|
20
20
|
## Test suite
|
|
21
21
|
|
|
22
|
-
Vitest
|
|
22
|
+
Vitest tests are organized by domain. Results for the history-dashboard migration are tracked separately in [verification notes](verification.md); the table below is a scope reference, not a passing-run claim.
|
|
23
23
|
|
|
24
24
|
| Test file | Coverage |
|
|
25
25
|
| --- | --- |
|
|
26
26
|
| `plugin.spec.ts` | Cordis mounting/unloading, native SettingsForms/profile writes, hot configuration, RPC and public exports |
|
|
27
27
|
| `accounts.spec.ts` | Account CRUD, 20-account cap, serial writes, failed-write cleanup, fallback/promotion, stale calls and five-minute cooldown |
|
|
28
|
-
| `
|
|
28
|
+
| `free.spec.ts` | Dual route lifecycle, public Bearer fallback, saved keys, account retry and credential deadlines |
|
|
29
|
+
| `free-channel.spec.ts`, `free-transport.spec.ts` | Free failure classification, Retry-After/backoff, cancellation, transport isolation and coexistence with Go |
|
|
30
|
+
| `pricing.spec.ts` | Catalog tariff validation and Free-model eligibility; historical amounts come from official CSV |
|
|
31
|
+
| `catalog.spec.ts` | Discovery, model limits/visibility, dual directories, ETag/disk cache, endpoint isolation and bounded transport |
|
|
29
32
|
| `adapter.spec.ts` | Requests, capacity limits, session/attribution headers, immutable request snapshots, cancellation and timeouts |
|
|
30
33
|
| `protocols.spec.ts` | Reasoning levels, protocol overrides, OpenAI/Anthropic/Google serialization and signed Google parts |
|
|
31
34
|
| `conversion.spec.ts` | Independent tool messages, replay signatures, context conversion, durable image offload, per-request budgets and stream contracts |
|
|
32
35
|
| `usage.spec.ts` | Official quota reads, current-account selection, native gateway access and safe error responses |
|
|
33
|
-
| `analytics.spec.ts` |
|
|
36
|
+
| `analytics.spec.ts` | Official daily CSV parsing/aggregation, UTC ranges, provider/model grouping, account isolation, short cache and cancellation |
|
|
34
37
|
| `transport.spec.ts` | Bounded JSON/gzip, classified/redacted HTTP errors, real CONNECT/SOCKS5 proxies and SDK bridge matching |
|
|
35
38
|
| `settings.client.spec.tsx` | Page configuration, typed Save/Reset/refused writes, locale changes, registration and subscription/cancellation lifecycle |
|
|
36
39
|
| `accounts-models.client.spec.tsx` | AccountsCard forms/status/quota, drag/keyboard ordering, model visibility, metadata failures and refresh races |
|
|
37
|
-
| `usage.client.spec.tsx` | Conversation pill,
|
|
40
|
+
| `usage.client.spec.tsx` | Conversation pill, dashboard account/range controls, official amount presentation, quota refresh/visibility and accessibility |
|
|
38
41
|
|
|
39
42
|
All test imports target current modules directly. `vitest.config.ts` has no aliases or compatibility resolver. Its Google SDK loader is the same version-guarded transport patch used by the production build. The UI tests load the published DSH primitives and the installed locale bundle.
|
|
40
43
|
|
|
41
|
-
`tests/setup.ts` gives each test a temporary `DSH_HOME`, provides synthetic models
|
|
44
|
+
`tests/setup.ts` gives each test a temporary `DSH_HOME`, provides complete synthetic `/models` entries, allows loopback HTTP fixtures and explicit `.invalid` destinations through the local proxy fixture, and rejects other network requests. `tests/support/` provides current host/account services, ConfigForm/React fixtures, metadata data, loopback gateways and proxies. Fixtures clean up contexts, sockets, timers and temporary homes.
|
|
42
45
|
|
|
43
46
|
## Modules
|
|
44
47
|
|
|
45
|
-
|
|
48
|
+
Implementation modules are grouped by domain, with browser CSS and its ambient declaration:
|
|
46
49
|
|
|
47
50
|
| Domain | Modules |
|
|
48
51
|
| --- | --- |
|
|
49
52
|
| Host composition and settings | `index.ts`, `config.ts` |
|
|
50
53
|
| Inference and model discovery | `adapter.ts`, `catalog.ts`, `conversion.ts`, `google.ts`, `sdk-types.ts` |
|
|
51
54
|
| Account commands and official quota | `accounts.ts` |
|
|
52
|
-
|
|
|
55
|
+
| Official daily CSV history and aggregation | `analytics.ts` |
|
|
56
|
+
| Free backoff, error classification and transport | `free-channel.ts`, `free-policy.ts`, `free-transport.ts` |
|
|
53
57
|
| Browser-safe configuration and RPC contracts | `contracts.ts` |
|
|
54
58
|
| HTTP, proxy transport and redacted errors | `transport.ts` |
|
|
55
59
|
| Browser registration and state | `client/index.ts`, `client/controller.ts` |
|
|
@@ -59,10 +63,20 @@ The host uses `settings.configure()` and volatile configuration fields; the brow
|
|
|
59
63
|
|
|
60
64
|
Account commands and automatic primary-account promotion share one in-memory serial queue. Credential writes settle before the next command starts. Metadata changes use a single revision-guarded write; no WAL, startup recovery or conflict retry loop is maintained. Only credentials owned by the removed generated account are deleted. Request generations prevent late fallback outcomes from replacing a newer user selection. Credential, quota and rate-limit failures can try the next account only before output or positive usage, and rejected gateway keys cool down for five minutes. Changing a key or explicitly selecting an account clears its rejection state.
|
|
61
65
|
|
|
62
|
-
Analytics
|
|
66
|
+
Analytics requests `https://opencode.ai/console/api/v2/usage/export?range=7d|30d|90d` from the Host with the selected account's key. One daily CSV snapshot supplies totals, UTC daily buckets and provider/model detail. Today filters the 7-day snapshot to the current UTC date; absent dates are filled with zero. Input, output, cache read and both 5-minute/1-hour cache-write fields are summed without repricing. Integer `cost_micro_cents` use `1 USD = 100,000,000` units and are presented as the official usage amount, which does not establish extra Go charges.
|
|
67
|
+
|
|
68
|
+
History queries occur only on open, account/range changes and manual refresh. Official reports and CSVs have a 30-second Host cache isolated by credential, account, network configuration, range and UTC date; forced refresh bypasses it. Queries retain the configured proxy path, cancellation, timeouts and response-size limits. Only official gateway configurations may send keys to Console. Third-party gateways, permission failures, network failures and invalid data produce explicit errors, without a local-history fallback.
|
|
69
|
+
|
|
70
|
+
The browser receives only aggregate numbers and provider/model/day groups. The user's explicit CSV download may contain official member fields. The independent viewing-account selector defaults to the inference account and scopes all three dashboard quota windows to the selected workspace, including other clients; anonymous Free coverage is not guaranteed. Settings, the dashboard, pill and expanded sidebar share warm paper/charcoal surfaces and terracotta accents, following the Host's light/dark mode. Settings map Host control tokens only within the plugin section. Typography prefers locally installed Anthropic Serif Web, Sans Web and Mono Web families, with system fallbacks and CJK serif headings; no font binaries or external font requests are added.
|
|
71
|
+
|
|
72
|
+
Backend history tests use synthetic CSVs, synthetic keys and loopback services; real user keys are not used in automated tests. The separately recorded Console check establishes source availability for the checked account; automated migration results are recorded separately in the verification notes.
|
|
63
73
|
|
|
64
74
|
Image count limits are checked before reads. Each request prepares up to four images concurrently and checks its own encoded-payload budget. The host's `requiredImageOffload` / `projectOffloadedImages` protocol owns durable offload marks. There is no plugin-wide preparation queue or payload pool. HTTP failure classification, credential redaction, context-capacity hints, stream deadlines and cancellation remain active; internal call tracing and diagnostic file capture are removed.
|
|
65
75
|
|
|
66
76
|
## Distribution
|
|
67
77
|
|
|
68
|
-
The `.` and `./client` exports continue to point to the built host entry and browser factory. Rebuild `lib/` with source changes, then run `npm run check:dist`. Builds do not execute during dependency installation. The
|
|
78
|
+
The `.` and `./client` exports continue to point to the built host entry and browser factory. Rebuild `lib/` with source changes, then run `npm run check:dist`. Builds do not execute during dependency installation. The private `opencode-go-pi-ai` alias uses `@earendil-works/pi-ai@1.5.0`, which pins `@earendil-works/pi-telemetry@1.5.0` and `@earendil-works/pi-schema@1.5.0` exactly; `package.json` no longer needs `overrides`.
|
|
79
|
+
|
|
80
|
+
The Google transport bridge is version-guarded for pi-ai 1.5.0 and `@google/genai@2.21.0`. `src/google.ts` delegates simple streaming to the upstream adapter through the request-scoped fetch binding; pi-ai now selects discrete thinking levels for Gemini 4 natively.
|
|
81
|
+
|
|
82
|
+
SDK declarations bundle pi-schema in place of TypeBox. `scripts/licenses/pi-1.5.0-LICENSE` supplies the pi packages' upstream MIT license omitted from their npm distributions. pi-schema's format checks and value conversion rules include code adapted from TypeBox 1.3.27 (MIT); the build appends the package's `LICENSES/typebox-LICENSE` to its pi-schema notice in `lib/vendor-licenses.txt`.
|