@justsilver/opencode-providers 0.1.0-beta.1 → 0.1.0-beta.2
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
CHANGED
|
@@ -7,6 +7,23 @@
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.1.0-beta.2] - 2026-10-07
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- 注册表收入两家**真实供应商**:**Command Code**(`https://api.commandcode.ai/provider/v1`)与
|
|
15
|
+
**R4 Coder**(`https://api.r4.codes/v1`),共享 `deepseek-v4.1-flash` 参数
|
|
16
|
+
(context 1048576 / output 393216,`reasoningEffort` 变体 low/high/max);
|
|
17
|
+
Command Code 用 `modelID` 覆盖成 `deepseek/deepseek-v4.1-flash`,R4 Coder 用默认(= map key)
|
|
18
|
+
- `tests/registry.test.ts`:对随仓注册表断言这两家、共享 `base` 与 `modelID` 覆盖(CI 会跑)
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
|
|
22
|
+
- **注册表挪出仓库根目录**:`registry.json` / `registry.schema.json` →
|
|
23
|
+
`registry/registry.json` / `registry/registry.schema.json`;插件默认拉取地址同步为
|
|
24
|
+
`…/main/registry/registry.json`。旧版本(beta.0/beta.1)拉旧地址会 404 → **沿用本地缓存**(不会清空列表,但不再更新),需升到本版
|
|
25
|
+
- 注册表缓存按 URL 区分(`registry-cache:<url>`):换 URL 不再等 TTL 就重新拉取
|
|
26
|
+
|
|
10
27
|
## [0.1.0-beta.1] - 2026-10-07
|
|
11
28
|
|
|
12
29
|
### Fixed
|
|
@@ -41,6 +58,7 @@
|
|
|
41
58
|
- 插件源码从 `.opencode/plugins/opencode-providers/` 移到 `plugin/opencode-providers/`:仓库自身不再是插件发现根,避免在仓库里跑 opencode 时与全局安装的同 id 副本相撞(`Duplicate plugin ID` → 面板里一条 `failed`)
|
|
42
59
|
- 安装后**通常无需重启**(插件目录被文件监视热重载),不再要求 `opencode service restart`
|
|
43
60
|
|
|
44
|
-
[Unreleased]: https://github.com/Just-Silver/opencode-providers/compare/v0.1.0-beta.
|
|
61
|
+
[Unreleased]: https://github.com/Just-Silver/opencode-providers/compare/v0.1.0-beta.2...HEAD
|
|
62
|
+
[0.1.0-beta.2]: https://github.com/Just-Silver/opencode-providers/releases/tag/v0.1.0-beta.2
|
|
45
63
|
[0.1.0-beta.1]: https://github.com/Just-Silver/opencode-providers/releases/tag/v0.1.0-beta.1
|
|
46
64
|
[0.1.0-beta.0]: https://github.com/Just-Silver/opencode-providers/releases/tag/v0.1.0-beta.0
|
package/README.md
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
装完插件、在 `/connect-providers` 里贴一次 API Key 就能用 —— **不需要写 `opencode.json`**。
|
|
5
5
|
|
|
6
6
|
```
|
|
7
|
-
registry.json
|
|
8
|
-
registry.schema.json
|
|
7
|
+
registry/registry.json ← 唯一事实源:供应商 + 模型 + 参数(GitHub raw 托管)
|
|
8
|
+
registry/registry.schema.json ← 给编辑器校验 registry.json
|
|
9
9
|
plugin/opencode-providers/ ← 插件源码(安装时整目录复制到 ~/.config/opencode/plugins/)
|
|
10
10
|
├── index.ts ← server 入口:拉注册表 → 注册 integration/provider/models
|
|
11
11
|
├── tui.tsx ← TUI 入口:注册 /connect-providers 命令
|
|
@@ -98,7 +98,7 @@ API Key 只在你贴入时经过本插件的内存,不落任何本项目自己
|
|
|
98
98
|
|
|
99
99
|
## 维护注册表
|
|
100
100
|
|
|
101
|
-
改 `registry.json` 提交后,运行中的 opencode 最迟 6 小时(TTL)自动跟上;想立刻生效就重启服务。
|
|
101
|
+
改 `registry/registry.json` 提交后,运行中的 opencode 最迟 6 小时(TTL)自动跟上;想立刻生效就重启服务。
|
|
102
102
|
拉取使用 `ETag`,内容没变时不会重复下载;网络失败时继续沿用本地缓存,不会把供应商列表清空。
|
|
103
103
|
|
|
104
104
|
### 结构
|
|
@@ -154,7 +154,7 @@ API Key 只在你贴入时经过本插件的内存,不落任何本项目自己
|
|
|
154
154
|
| 模型 `variants` | `[{ "id": "high", "settings": {} }]` |
|
|
155
155
|
| 模型 `status` / `disabled` | 生命周期标记;`disabled: true` 不出现在 `/models` |
|
|
156
156
|
|
|
157
|
-
`registry.schema.json` 是同一份规则的 JSON Schema,编辑器可直接校验。
|
|
157
|
+
`registry/registry.schema.json` 是同一份规则的 JSON Schema,编辑器可直接校验。
|
|
158
158
|
|
|
159
159
|
## 范围之外
|
|
160
160
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justsilver/opencode-providers",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Register providers missing from the models.dev catalog in OpenCode V2 from a self-hosted registry — no opencode.json needed",
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,7 +23,6 @@ import { DEFAULT_REGISTRY_URL, loadRegistry } from "./registry/source.ts"
|
|
|
23
23
|
import type { RegistryCacheEntry } from "./registry/source.ts"
|
|
24
24
|
|
|
25
25
|
const PLUGIN_ID = "opencode-providers"
|
|
26
|
-
const CACHE_KEY = "registry-cache"
|
|
27
26
|
|
|
28
27
|
/** Tags integrations so the TUI entry can recognise its own. */
|
|
29
28
|
export const INTEGRATION_SOURCE = PLUGIN_ID
|
|
@@ -60,13 +59,15 @@ export default {
|
|
|
60
59
|
// reachable through a config `plugins` entry (which we deliberately do not use for TUI plugins).
|
|
61
60
|
// It exists for tests and forks; script installs always use DEFAULT_REGISTRY_URL.
|
|
62
61
|
const url = typeof ctx.options.registryUrl === "string" ? ctx.options.registryUrl : DEFAULT_REGISTRY_URL
|
|
62
|
+
// Cache per URL: switching the registry URL must not keep serving the old body for a TTL.
|
|
63
|
+
const cacheKey = `registry-cache:${url}`
|
|
63
64
|
const result = await loadRegistry({
|
|
64
65
|
url,
|
|
65
66
|
fetch: globalThis.fetch,
|
|
66
67
|
store: {
|
|
67
|
-
get: async () => asCacheEntry(await ctx.storage.get(
|
|
68
|
+
get: async () => asCacheEntry(await ctx.storage.get(cacheKey)),
|
|
68
69
|
set: async (entry) => {
|
|
69
|
-
await ctx.storage.set(
|
|
70
|
+
await ctx.storage.set(cacheKey, entry)
|
|
70
71
|
},
|
|
71
72
|
},
|
|
72
73
|
})
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
import type { Registry } from "./schema.ts"
|
|
10
10
|
import { parseRegistry } from "./schema.ts"
|
|
11
11
|
|
|
12
|
-
export const DEFAULT_REGISTRY_URL =
|
|
12
|
+
export const DEFAULT_REGISTRY_URL =
|
|
13
|
+
"https://raw.githubusercontent.com/Just-Silver/opencode-providers/main/registry/registry.json"
|
|
13
14
|
|
|
14
15
|
/** Successful checks are trusted for 6h; a failed refresh keeps serving the cached copy. */
|
|
15
16
|
export const DEFAULT_TTL_MS = 6 * 60 * 60 * 1000
|