@justsilver/opencode-providers 0.1.0-beta.1 → 0.1.0
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,54 @@
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.1.0] - 2026-10-07
|
|
11
|
+
|
|
12
|
+
> 首个**正式版**(由 `0.1.0-beta.0` → `0.1.0-beta.2` 三个预发布版本稳定而来);npm 的 `latest` 指向它。
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- 自维护注册表 `registry/registry.json` + `registry/registry.schema.json`:共享 `models` 表 + provider `base` 引用/覆盖,
|
|
17
|
+
带 `schemaVersion` —— 改数据**不需要**发插件版本
|
|
18
|
+
- 注册表收入两家真实供应商:**Command Code**(`https://api.commandcode.ai/provider/v1`)与
|
|
19
|
+
**R4 Coder**(`https://api.r4.codes/v1`)。二者共享 `deepseek-v4.1-flash`
|
|
20
|
+
(context 1048576 / output 393216,`reasoningEffort` 变体 low/high/max);Command Code 用 `modelID` 覆盖成 `deepseek/deepseek-v4.1-flash`
|
|
21
|
+
- server 入口:按注册表注册 integration(只声明 `key` 方法)与 provider(`activation: "auto"`)及其模型;
|
|
22
|
+
拉取 6h TTL + `ETag` + 失败沿用旧缓存(`ctx.storage`)
|
|
23
|
+
- TUI 入口 `/connect-providers`:选供应商 → 贴 API Key / 切换账号,与内置 `/connect` 共用同一张凭据表
|
|
24
|
+
- 两种安装方式:npm 包(`"plugins": ["@justsilver/opencode-providers"]`)与安装脚本(整目录复制到
|
|
25
|
+
`~/.config/opencode/plugins/`,支持 `--local` / `-Local` 从工作树部署)
|
|
26
|
+
- 预发布优先的发版流水线:CD 走 OIDC(自动签名 provenance),预发布发 npm 的 `next`;
|
|
27
|
+
正式版必须**手动** Run workflow 勾 `publish` + `stable`(该次运行发布到 `latest` 并补 tag + GitHub Release)
|
|
28
|
+
- `.opencode/skills/opencode-providers-registry`:维护注册表的技能(两条路由 + 最小字段铁律 + 协议 → package)
|
|
29
|
+
|
|
30
|
+
### Fixed
|
|
31
|
+
|
|
32
|
+
- **`/connect-providers` 在输入框里"看不见"**:命令图层补 `mode: "global"`(图层默认 `base`,而提示框 push 的是
|
|
33
|
+
`composer`/补全时 `autocomplete` → 不可达,命令不进补全列表)
|
|
34
|
+
- 仓库自身不再是插件发现根(源码移到 `plugin/opencode-providers/`),避免在仓库里跑 opencode 时与全局安装**同 id 相撞**
|
|
35
|
+
(supervisor 会把后者标成 `failed` + `Duplicate plugin ID`)
|
|
36
|
+
|
|
37
|
+
### Changed
|
|
38
|
+
|
|
39
|
+
- 注册表移出仓库根:`registry.json` → `registry/registry.json`(`$id` 同步);插件默认拉取地址与**缓存键**同步改为含 URL,换地址立即重拉
|
|
40
|
+
|
|
41
|
+
## [0.1.0-beta.2] - 2026-10-07
|
|
42
|
+
|
|
43
|
+
### Added
|
|
44
|
+
|
|
45
|
+
- 注册表收入两家**真实供应商**:**Command Code**(`https://api.commandcode.ai/provider/v1`)与
|
|
46
|
+
**R4 Coder**(`https://api.r4.codes/v1`),共享 `deepseek-v4.1-flash` 参数
|
|
47
|
+
(context 1048576 / output 393216,`reasoningEffort` 变体 low/high/max);
|
|
48
|
+
Command Code 用 `modelID` 覆盖成 `deepseek/deepseek-v4.1-flash`,R4 Coder 用默认(= map key)
|
|
49
|
+
- `tests/registry.test.ts`:对随仓注册表断言这两家、共享 `base` 与 `modelID` 覆盖(CI 会跑)
|
|
50
|
+
|
|
51
|
+
### Changed
|
|
52
|
+
|
|
53
|
+
- **注册表挪出仓库根目录**:`registry.json` / `registry.schema.json` →
|
|
54
|
+
`registry/registry.json` / `registry/registry.schema.json`;插件默认拉取地址同步为
|
|
55
|
+
`…/main/registry/registry.json`。旧版本(beta.0/beta.1)拉旧地址会 404 → **沿用本地缓存**(不会清空列表,但不再更新),需升到本版
|
|
56
|
+
- 注册表缓存按 URL 区分(`registry-cache:<url>`):换 URL 不再等 TTL 就重新拉取
|
|
57
|
+
|
|
10
58
|
## [0.1.0-beta.1] - 2026-10-07
|
|
11
59
|
|
|
12
60
|
### Fixed
|
|
@@ -41,6 +89,8 @@
|
|
|
41
89
|
- 插件源码从 `.opencode/plugins/opencode-providers/` 移到 `plugin/opencode-providers/`:仓库自身不再是插件发现根,避免在仓库里跑 opencode 时与全局安装的同 id 副本相撞(`Duplicate plugin ID` → 面板里一条 `failed`)
|
|
42
90
|
- 安装后**通常无需重启**(插件目录被文件监视热重载),不再要求 `opencode service restart`
|
|
43
91
|
|
|
44
|
-
[Unreleased]: https://github.com/Just-Silver/opencode-providers/compare/v0.1.0
|
|
92
|
+
[Unreleased]: https://github.com/Just-Silver/opencode-providers/compare/v0.1.0...HEAD
|
|
93
|
+
[0.1.0]: https://github.com/Just-Silver/opencode-providers/releases/tag/v0.1.0
|
|
94
|
+
[0.1.0-beta.2]: https://github.com/Just-Silver/opencode-providers/releases/tag/v0.1.0-beta.2
|
|
45
95
|
[0.1.0-beta.1]: https://github.com/Just-Silver/opencode-providers/releases/tag/v0.1.0-beta.1
|
|
46
96
|
[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
|
|
3
|
+
"version": "0.1.0",
|
|
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
|