@goodandready/dsh-opencode-provider 0.5.8 → 0.5.10
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 +10 -0
- package/README.md +3 -3
- package/README.ru.md +3 -3
- package/README.zh.md +3 -3
- package/lib/client.js +20 -13
- package/lib/index.js +3 -8
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.10
|
|
4
|
+
|
|
5
|
+
- **Migration hint**: Settings → OpenCode explains the 0.5.7 provider-id split and why legacy `opencode`/`opencode-go` sessions stay on the built-in pi-ai routes. The analytics hint/empty state also distinguishes plugin routes from legacy traffic.
|
|
6
|
+
- 90 tests.
|
|
7
|
+
|
|
8
|
+
## 0.5.9
|
|
9
|
+
|
|
10
|
+
- **Analytics provider filter**: after the provider-id split, session model analytics includes only `opencode-direct`/`opencode-go-direct`. Legacy `opencode`/`opencode-go` sessions now belong to the built-in pi-ai catalog and are intentionally excluded, so the plugin no longer mixes built-in traffic into its model analytics.
|
|
11
|
+
- 90 tests.
|
|
12
|
+
|
|
3
13
|
## 0.5.8
|
|
4
14
|
|
|
5
15
|
- **Free-tier error cooldown**: a `FreeTierError` (free model used with a free/anonymous key) is now a short `RATE_LIMIT`, not `INVALID_CREDENTIAL`. The account rotates to the next key and is cooled for 60s instead of 24h; the key itself is not invalid. Added an adapter regression test.
|
package/README.md
CHANGED
|
@@ -130,12 +130,12 @@ npm pack
|
|
|
130
130
|
Install the **packed tarball** into a profile:
|
|
131
131
|
|
|
132
132
|
```bash
|
|
133
|
-
dsh plugin --profile web add /absolute/path/to/goodandready-dsh-opencode-provider-0.5.
|
|
133
|
+
dsh plugin --profile web add /absolute/path/to/goodandready-dsh-opencode-provider-0.5.10.tgz
|
|
134
134
|
# DSH Desktop:
|
|
135
|
-
dsh plugin --profile desktop add /absolute/path/to/goodandready-dsh-opencode-provider-0.5.
|
|
135
|
+
dsh plugin --profile desktop add /absolute/path/to/goodandready-dsh-opencode-provider-0.5.10.tgz
|
|
136
136
|
|
|
137
137
|
# Or install the published package:
|
|
138
|
-
dsh plugin --profile web add @goodandready/dsh-opencode-provider@0.5.
|
|
138
|
+
dsh plugin --profile web add @goodandready/dsh-opencode-provider@0.5.10
|
|
139
139
|
```
|
|
140
140
|
|
|
141
141
|
Restart dsh (or DSH Desktop), then pick **OpenCode (plugin)** or **OpenCode Go (plugin)** in the model picker.
|
package/README.ru.md
CHANGED
|
@@ -129,12 +129,12 @@ npm pack
|
|
|
129
129
|
Установка из **упакованного tarball**:
|
|
130
130
|
|
|
131
131
|
```bash
|
|
132
|
-
dsh plugin --profile web add /absolute/path/to/goodandready-dsh-opencode-provider-0.5.
|
|
132
|
+
dsh plugin --profile web add /absolute/path/to/goodandready-dsh-opencode-provider-0.5.10.tgz
|
|
133
133
|
# DSH Desktop:
|
|
134
|
-
dsh plugin --profile desktop add /absolute/path/to/goodandready-dsh-opencode-provider-0.5.
|
|
134
|
+
dsh plugin --profile desktop add /absolute/path/to/goodandready-dsh-opencode-provider-0.5.10.tgz
|
|
135
135
|
|
|
136
136
|
# Либо установка опубликованного пакета из npm:
|
|
137
|
-
dsh plugin --profile web add @goodandready/dsh-opencode-provider@0.5.
|
|
137
|
+
dsh plugin --profile web add @goodandready/dsh-opencode-provider@0.5.10
|
|
138
138
|
```
|
|
139
139
|
|
|
140
140
|
После установки перезапустите dsh (или DSH Desktop) и выберите **OpenCode (plugin)** или **OpenCode Go (plugin)** в списке моделей.
|
package/README.zh.md
CHANGED
|
@@ -124,12 +124,12 @@ npm pack
|
|
|
124
124
|
通过**打包文件 (.tgz)**安装:
|
|
125
125
|
|
|
126
126
|
```bash
|
|
127
|
-
dsh plugin --profile web add /absolute/path/to/goodandready-dsh-opencode-provider-0.5.
|
|
127
|
+
dsh plugin --profile web add /absolute/path/to/goodandready-dsh-opencode-provider-0.5.10.tgz
|
|
128
128
|
# DSH 桌面端:
|
|
129
|
-
dsh plugin --profile desktop add /absolute/path/to/goodandready-dsh-opencode-provider-0.5.
|
|
129
|
+
dsh plugin --profile desktop add /absolute/path/to/goodandready-dsh-opencode-provider-0.5.10.tgz
|
|
130
130
|
|
|
131
131
|
# 或从 npm 安装已发布版本:
|
|
132
|
-
dsh plugin --profile web add @goodandready/dsh-opencode-provider@0.5.
|
|
132
|
+
dsh plugin --profile web add @goodandready/dsh-opencode-provider@0.5.10
|
|
133
133
|
```
|
|
134
134
|
|
|
135
135
|
安装完成后重启 dsh 或 DSH 桌面端,在模型选择器中选择 **OpenCode (plugin)** 或 **OpenCode Go (plugin)** 即可。
|
package/lib/client.js
CHANGED
|
@@ -117,8 +117,8 @@ window.__ModuleLoader__.load({
|
|
|
117
117
|
heatmapModel: "Model",
|
|
118
118
|
heatmapByAccount: "Account",
|
|
119
119
|
heatmapAllAccounts: "All accounts",
|
|
120
|
-
analyticsHint: "Aggregated from local session metadata by last activity. A session that switched models is counted under its last model; failures are not exposed by the projection.",
|
|
121
|
-
analyticsEmpty: "No
|
|
120
|
+
analyticsHint: "Aggregated from local session metadata by last activity. A session that switched models is counted under its last model; failures are not exposed by the projection. Only plugin routes are counted; legacy opencode sessions belong to the built-in catalog.",
|
|
121
|
+
analyticsEmpty: "No plugin sessions in this window. Legacy opencode sessions belong to the built-in catalog.",
|
|
122
122
|
showAll: "Show all",
|
|
123
123
|
modelSearch: "Search models…",
|
|
124
124
|
transport: "Transport",
|
|
@@ -153,6 +153,7 @@ window.__ModuleLoader__.load({
|
|
|
153
153
|
streamIdleTimeoutMs: "Stream idle timeout (ms)",
|
|
154
154
|
maxOutputTokens: "Output limit (empty = model default, 0 = omit)",
|
|
155
155
|
contextWindow: "Context override",
|
|
156
|
+
providerMigrationNotice: "Provider ids changed in 0.5.7: use OpenCode (plugin) / OpenCode Go (plugin). Sessions recorded with opencode/opencode-go stay on the built-in pi-ai routes; legacy traffic is excluded from plugin analytics.",
|
|
156
157
|
sidebar: "Sidebar",
|
|
157
158
|
showSidebarQuota: "Show the quota card in the sidebar",
|
|
158
159
|
showSidebarQuotaHint: "The card updates immediately after saving and otherwise every 60 seconds.",
|
|
@@ -301,8 +302,8 @@ window.__ModuleLoader__.load({
|
|
|
301
302
|
heatmapModel: "模型",
|
|
302
303
|
heatmapByAccount: "账户",
|
|
303
304
|
heatmapAllAccounts: "全部账户",
|
|
304
|
-
analyticsHint: "
|
|
305
|
-
analyticsEmpty: "
|
|
305
|
+
analyticsHint: "按最后活动时间聚合本地会话元数据。切换过模型的会话计入最后使用的模型;本地投影不暴露失败。仅统计插件路由;旧 opencode 会话属于内置目录。",
|
|
306
|
+
analyticsEmpty: "此窗口内没有插件会话。旧 opencode 会话属于内置目录。",
|
|
306
307
|
showAll: "显示全部",
|
|
307
308
|
modelSearch: "搜索模型…",
|
|
308
309
|
transport: "传输",
|
|
@@ -337,6 +338,7 @@ window.__ModuleLoader__.load({
|
|
|
337
338
|
streamIdleTimeoutMs: "流空闲超时(毫秒)",
|
|
338
339
|
maxOutputTokens: "输出上限(空 = 模型默认,0 = 省略)",
|
|
339
340
|
contextWindow: "上下文覆盖",
|
|
341
|
+
providerMigrationNotice: "0.5.7 起 provider id 已更改:请选择 OpenCode (plugin) / OpenCode Go (plugin)。使用 opencode/opencode-go 记录的历史会话仍使用内置 pi-ai 路由,旧流量不计入插件分析。",
|
|
340
342
|
sidebar: "侧边栏",
|
|
341
343
|
showSidebarQuota: "在侧边栏显示配额卡片",
|
|
342
344
|
showSidebarQuotaHint: "保存后立即更新;其余时间每 60 秒更新一次。",
|
|
@@ -378,8 +380,6 @@ window.__ModuleLoader__.load({
|
|
|
378
380
|
perMonth: "每月"
|
|
379
381
|
}
|
|
380
382
|
};
|
|
381
|
-
//#endregion
|
|
382
|
-
//#region src/provider-ids.ts
|
|
383
383
|
const GO_PROVIDER = "opencode-go-direct";
|
|
384
384
|
//#endregion
|
|
385
385
|
//#region src/client/api.ts
|
|
@@ -2069,13 +2069,20 @@ window.__ModuleLoader__.load({
|
|
|
2069
2069
|
children: [
|
|
2070
2070
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2071
2071
|
className: "oc-head",
|
|
2072
|
-
children: [
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2072
|
+
children: [
|
|
2073
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", {
|
|
2074
|
+
className: "oc-title",
|
|
2075
|
+
children: t("title")
|
|
2076
|
+
}),
|
|
2077
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2078
|
+
className: "oc-hint",
|
|
2079
|
+
children: t("intro")
|
|
2080
|
+
}),
|
|
2081
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2082
|
+
className: "oc-hint",
|
|
2083
|
+
children: t("providerMigrationNotice")
|
|
2084
|
+
})
|
|
2085
|
+
]
|
|
2079
2086
|
}),
|
|
2080
2087
|
error === null ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2081
2088
|
className: "oc-error",
|
package/lib/index.js
CHANGED
|
@@ -17,7 +17,7 @@ const DEFAULT_GO_API_BASE = "https://opencode.ai/inference/go";
|
|
|
17
17
|
const DEFAULT_GO_ZEN_BASE = "https://opencode.ai/zen/go/v1";
|
|
18
18
|
const DEFAULT_USAGE_URL = "https://opencode.ai/zen/go/v1/usage";
|
|
19
19
|
const DEFAULT_AUTH_ENTRY = "opencode-go";
|
|
20
|
-
const DEFAULT_USER_AGENT = "dsh-opencode-provider/0.5.
|
|
20
|
+
const DEFAULT_USER_AGENT = "dsh-opencode-provider/0.5.10";
|
|
21
21
|
const DEFAULT_CONTEXT_WINDOW = 262144;
|
|
22
22
|
const DEFAULT_MAX_TOKENS = 32768;
|
|
23
23
|
const DEFAULT_GENERATE_MAX_TOKENS = 32768;
|
|
@@ -799,12 +799,7 @@ const GENERATED_MODELS = {
|
|
|
799
799
|
*/
|
|
800
800
|
const CONSOLE_PROVIDER = "opencode-direct";
|
|
801
801
|
const GO_PROVIDER = "opencode-go-direct";
|
|
802
|
-
const
|
|
803
|
-
CONSOLE_PROVIDER,
|
|
804
|
-
GO_PROVIDER,
|
|
805
|
-
"opencode",
|
|
806
|
-
"opencode-go"
|
|
807
|
-
]);
|
|
802
|
+
const PLUGIN_PROVIDER_SET = /* @__PURE__ */ new Set([CONSOLE_PROVIDER, GO_PROVIDER]);
|
|
808
803
|
//#endregion
|
|
809
804
|
//#region src/routing.ts
|
|
810
805
|
function isGoProvider(provider) {
|
|
@@ -4210,7 +4205,7 @@ function aggregateSessions(sessions, days, now = Date.now()) {
|
|
|
4210
4205
|
for (const session of sessions) {
|
|
4211
4206
|
const provider = session.lastUsed?.provider;
|
|
4212
4207
|
const model = session.lastUsed?.model;
|
|
4213
|
-
if (typeof provider !== "string" || !
|
|
4208
|
+
if (typeof provider !== "string" || !PLUGIN_PROVIDER_SET.has(provider) || model === void 0 || model === "") continue;
|
|
4214
4209
|
const usage = session.usage;
|
|
4215
4210
|
if (usage === void 0) continue;
|
|
4216
4211
|
const input = count(usage.uncachedInputTokens);
|