@dan-ai-studio/dshopencodego 0.1.84 → 0.1.85
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 +1 -1
- package/README.md +1 -1
- package/lib/client.js +37 -0
- package/lib/index.js +1 -1
- package/package.json +1 -1
package/README.en.md
CHANGED
|
@@ -201,7 +201,7 @@ The gateway's `/v1/models` answers only *which* models exist, never *how* to cal
|
|
|
201
201
|
- the bundled catalog is **frozen at the plugin's version** and affects only the quality of the "how to call it" decision, never *which* models exist.
|
|
202
202
|
- **fresh installs do not wait**: the bundle carries a directory snapshot from publish time (`src/catalog/seed.snapshot.json`), which answers at once when the disk cache is empty and refreshes behind it; past 24 hours without a refresh counts as stale and refreshes in the background too, whatever the TTL says. A timer re-checks on a live host, so long-running processes stay current without a request to trigger it.
|
|
203
203
|
|
|
204
|
-
When the gateway is **temporarily unavailable**, the plugin keeps the last listing that succeeded, marks it stale on the page, and retries in the background. The retry rate is governed by a **five-minute back-off** rather than by the TTL, so a gateway that comes back is picked up within five minutes; while it stays down it is asked once, not once per model request. The settings page's Recheck button revalidates at any time and is not bound by that back-off.
|
|
204
|
+
When the gateway is **temporarily unavailable**, the plugin keeps the last listing that succeeded, marks it stale on the page, and retries in the background. The retry rate is governed by a **five-minute back-off** rather than by the TTL, so a gateway that comes back is picked up within five minutes; while it stays down it is asked once, not once per model request. When the settings page opens on a stale reading, it follows up on its own (about every 5 seconds) until the reading turns current — the follow-ups are cheap local reads, and the host's back-off still decides when the gateway is really asked — so there is no need to press Recheck by hand. The settings page's Recheck button revalidates at any time and is not bound by that back-off.
|
|
205
205
|
|
|
206
206
|
The only thing that waits on a plugin release is a missing wire quirk in the pi-ai catalog (DeepSeek's `thinkingFormat`, say) — the model itself is already usable.
|
|
207
207
|
|
package/README.md
CHANGED
|
@@ -200,7 +200,7 @@ API Key 通过 Harness 凭证库提供(引用名 `OPENCODE_GO_API_KEY`),
|
|
|
200
200
|
- 内置目录**冻结**在插件版本里,仅影响"怎么调"的推断质量,不影响"有哪些"。
|
|
201
201
|
- **首次安装不等待**:包里带了一份发布时生成的目录快照(`src/catalog/seed.snapshot.json`,28 个模型上下),磁盘缓存为空时直接用它回答并在后台刷新;过期(超 24 小时未刷新)同样后台刷新,绝不为等网络拦住请求。插件挂载后还会定时触发一次,保证长期运行的进程目录常新。
|
|
202
202
|
|
|
203
|
-
网关**临时不可用**时,插件保留上次成功获取的列表并在页面上标注陈旧,同时在后台重试:重试由**5 分钟的退避**控制,而不是等满一个 TTL,所以网关恢复后 5
|
|
203
|
+
网关**临时不可用**时,插件保留上次成功获取的列表并在页面上标注陈旧,同时在后台重试:重试由**5 分钟的退避**控制,而不是等满一个 TTL,所以网关恢复后 5 分钟内列表就会更新;网关持续不可用时,它只被问一次,不会每次模型请求都去问一遍。设置页打开时若读到的是旧目录,会自动跟进重读直到拿到最新的(约每 5 秒一次读本地快照;何时真问网关由 Host 的 5 分钟退避决定,不会因此多发请求),不用手动点「重新检查」;「重新检查」随时可以强制重验,不受这个退避限制。
|
|
204
204
|
|
|
205
205
|
只有当 pi-ai 内置目录**缺了某个模型的线怪癖**(如 DeepSeek 的 `thinkingFormat`)时,才需要等插件同步 pi-ai 的新版本——而模型本身早已可用。
|
|
206
206
|
|
package/lib/client.js
CHANGED
|
@@ -1049,6 +1049,7 @@ var section_default = { "badge": "d7lz0W_badge", "block": "d7lz0W_block", "butto
|
|
|
1049
1049
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
1050
1050
|
var API_KEY_REF = "OPENCODE_GO_API_KEY";
|
|
1051
1051
|
var VISIBILITY_WRITE_DELAY_MS = 250;
|
|
1052
|
+
var FOLLOW_UP_MS = 5e3;
|
|
1052
1053
|
var INITIAL = {
|
|
1053
1054
|
loading: true,
|
|
1054
1055
|
reading: void 0,
|
|
@@ -1099,6 +1100,8 @@ var SectionController = class _SectionController {
|
|
|
1099
1100
|
pendingVisibility;
|
|
1100
1101
|
/** Timer of the coalescing window, when one is armed. */
|
|
1101
1102
|
visibilityTimer;
|
|
1103
|
+
/** The armed stale-reading follow-up, if one is waiting. */
|
|
1104
|
+
followTimer;
|
|
1102
1105
|
constructor(services) {
|
|
1103
1106
|
this.services = services;
|
|
1104
1107
|
const scope = services.scope;
|
|
@@ -1126,6 +1129,10 @@ var SectionController = class _SectionController {
|
|
|
1126
1129
|
dispose() {
|
|
1127
1130
|
this.listeners.clear();
|
|
1128
1131
|
for (const dispose of this.disposers.splice(0)) dispose();
|
|
1132
|
+
if (this.followTimer !== void 0) {
|
|
1133
|
+
clearTimeout(this.followTimer);
|
|
1134
|
+
this.followTimer = void 0;
|
|
1135
|
+
}
|
|
1129
1136
|
const scope = this.services.scope;
|
|
1130
1137
|
if (this.visibilityTimer !== void 0 && scope !== void 0) void this.flushVisibility(scope);
|
|
1131
1138
|
}
|
|
@@ -1140,6 +1147,7 @@ var SectionController = class _SectionController {
|
|
|
1140
1147
|
const result = refresh ? await this.services.remote.opencodeGoCatalog.refresh() : await this.services.remote.opencodeGoCatalog.read();
|
|
1141
1148
|
if (!result.ok) throw result.error;
|
|
1142
1149
|
this.set({ loading: false, reading: result.value, failure: void 0 });
|
|
1150
|
+
if (result.value.cached === true) this.followReading();
|
|
1143
1151
|
} catch (error) {
|
|
1144
1152
|
this.set({
|
|
1145
1153
|
loading: false,
|
|
@@ -1147,6 +1155,35 @@ var SectionController = class _SectionController {
|
|
|
1147
1155
|
});
|
|
1148
1156
|
}
|
|
1149
1157
|
}
|
|
1158
|
+
/**
|
|
1159
|
+
* Re-read a stale reading until it turns live, then stop.
|
|
1160
|
+
*
|
|
1161
|
+
* Only one follow-up is ever armed. The Host decides the real refresh
|
|
1162
|
+
* rhythm, so this never hammers the gateway — a follow-up is a plain
|
|
1163
|
+
* `read`, and the Host's own back-off decides how often the gateway is
|
|
1164
|
+
* really asked. A failed or still-stale read re-arms; only a live reading
|
|
1165
|
+
* or a disposal lets it lapse.
|
|
1166
|
+
*/
|
|
1167
|
+
followReading() {
|
|
1168
|
+
if (this.followTimer !== void 0) return;
|
|
1169
|
+
const timer = setTimeout(() => {
|
|
1170
|
+
this.followTimer = void 0;
|
|
1171
|
+
void (async () => {
|
|
1172
|
+
try {
|
|
1173
|
+
const result = await this.services.remote.opencodeGoCatalog.read();
|
|
1174
|
+
if (result.ok) {
|
|
1175
|
+
this.set({ reading: result.value, failure: void 0 });
|
|
1176
|
+
if (result.value.cached !== true) return;
|
|
1177
|
+
}
|
|
1178
|
+
} catch {
|
|
1179
|
+
}
|
|
1180
|
+
this.followReading();
|
|
1181
|
+
})();
|
|
1182
|
+
}, FOLLOW_UP_MS);
|
|
1183
|
+
const releasable = timer;
|
|
1184
|
+
if (typeof releasable.unref === "function") releasable.unref();
|
|
1185
|
+
this.followTimer = timer;
|
|
1186
|
+
}
|
|
1150
1187
|
async loadKey() {
|
|
1151
1188
|
try {
|
|
1152
1189
|
const described = await this.services.remote.credentials.describe([API_KEY_REF]);
|
package/lib/index.js
CHANGED
|
@@ -79487,7 +79487,7 @@ function createUpdateChecker(deps) {
|
|
|
79487
79487
|
}
|
|
79488
79488
|
|
|
79489
79489
|
// src/update/version.ts
|
|
79490
|
-
var PLUGIN_VERSION = true ? "0.1.
|
|
79490
|
+
var PLUGIN_VERSION = true ? "0.1.85" : "0.0.0-dev";
|
|
79491
79491
|
|
|
79492
79492
|
// src/update/service.ts
|
|
79493
79493
|
import { TypertRemoteService as TypertRemoteService4 } from "@deepseek-ai/dsh-typert-protocol";
|
package/package.json
CHANGED