heybash-xdpool 0.0.0-stage → 1.0.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/package.json CHANGED
@@ -1,6 +1,143 @@
1
1
  {
2
2
  "name": "heybash-xdpool",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "displayName": "Heybash",
4
+ "description": "Heybash model pool for DeepSeek Harness: account rotation, provider aggregation, routing chains, usage insights and a local OpenAI-compatible gateway.",
5
+ "version": "1.0.1",
6
+ "license": "MIT",
7
+ "author": "Heybash",
8
+ "contributors": [
9
+ "XDTrees (upstream dsh-xdpool)"
10
+ ],
11
+ "homepage": "https://github.com/etosurvivor/dsh-xdpool#readme",
12
+ "bugs": {
13
+ "url": "https://github.com/etosurvivor/dsh-xdpool/issues"
14
+ },
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/etosurvivor/dsh-xdpool.git"
18
+ },
19
+ "keywords": [
20
+ "dsh-plugin",
21
+ "deepseek-harness",
22
+ "workbuddy",
23
+ "codebuddy",
24
+ "model-provider",
25
+ "multi-account",
26
+ "failover"
27
+ ],
28
+ "type": "module",
29
+ "engines": {
30
+ "node": "^22.19.0 || >=24.0.0",
31
+ "dsh": ">=0.1.5-rc.1 <0.3.0"
32
+ },
33
+ "main": "lib/index.js",
34
+ "types": "lib/index.d.ts",
35
+ "bin": {
36
+ "heybash-xdpool": "lib/bin.js"
37
+ },
38
+ "exports": {
39
+ ".": {
40
+ "types": "./lib/index.d.ts",
41
+ "default": "./lib/index.js"
42
+ },
43
+ "./client": "./lib/client.js",
44
+ "./vendor/channel-pack/pack.js": "./vendor/channel-pack/pack.js",
45
+ "./cordis.patch.yml": "./cordis.patch.yml",
46
+ "./package.json": "./package.json"
47
+ },
48
+ "files": [
49
+ "lib",
50
+ "vendor",
51
+ "cordis.patch.yml",
52
+ "screenshots.json",
53
+ "assets",
54
+ "README.md",
55
+ "README.en.md",
56
+ "CHANGELOG.md",
57
+ "LICENSE",
58
+ "scripts"
59
+ ],
60
+ "scripts": {
61
+ "build": "tsdown",
62
+ "prepublishOnly": "tsdown",
63
+ "test": "vitest run",
64
+ "typecheck": "tsc -p tsconfig.json --noEmit",
65
+ "typecheck:client": "tsc -p tsconfig.client.json --noEmit",
66
+ "postinstall": "node scripts/link-host-peers.mjs"
67
+ },
68
+ "dsh": {
69
+ "bundle": {
70
+ "patch": "./cordis.patch.yml"
71
+ },
72
+ "client": {
73
+ "inject": [
74
+ "@deepseek-ai/dsh-client-ui-settings",
75
+ "@deepseek-ai/dsh-client-ui-slots",
76
+ "@deepseek-ai/dsh-client-ui-settings-plugins",
77
+ "@deepseek-ai/dsh-client-ui-primitives",
78
+ "@deepseek-ai/dsh-client-locale"
79
+ ],
80
+ "platform": "web"
81
+ }
82
+ },
83
+ "devDependencies": {
84
+ "@deepseek-ai/cordis": "4.0.2",
85
+ "@deepseek-ai/dsh-client-locale": "0.2.1-rc.4",
86
+ "@deepseek-ai/dsh-client-runtime": "0.1.1-rc.2",
87
+ "@deepseek-ai/dsh-client-ui-primitives": "0.2.1-rc.4",
88
+ "@deepseek-ai/dsh-client-ui-settings-plugins": "0.2.1-rc.4",
89
+ "@deepseek-ai/dsh-client-ui-slots": "0.2.1-rc.4",
90
+ "@deepseek-ai/dsh-credentials": "0.2.1-rc.4",
91
+ "@deepseek-ai/dsh-host-webserver": "0.2.1-rc.4",
92
+ "@deepseek-ai/dsh-launch-environment": "0.2.1-rc.4",
93
+ "@deepseek-ai/dsh-llm": "0.2.1-rc.4",
94
+ "@deepseek-ai/dsh-llm-pi-ai": "0.2.1-rc.4",
95
+ "@deepseek-ai/dsh-settings": "0.2.1-rc.4",
96
+ "@deepseek-ai/schemastery": "3.18.2",
97
+ "@earendil-works/pi-ai": "0.85.1",
98
+ "@types/node": "^26.4.1",
99
+ "@types/react": "~18.3.31",
100
+ "@types/react-dom": "~18.3.0",
101
+ "react": "^18.2.0",
102
+ "tsdown": "^0.23.0",
103
+ "typescript": "^7.0.2",
104
+ "vite": "8.3.0",
105
+ "vitest": "^5.0.0"
106
+ },
107
+ "peerDependencies": {
108
+ "@deepseek-ai/cordis": "^4.0.1-rc.1",
109
+ "@deepseek-ai/dsh-llm": ">=0.1.1-rc.1 <0.3.0",
110
+ "@deepseek-ai/dsh-llm-pi-ai": ">=0.1.1-rc.1 <0.3.0",
111
+ "@deepseek-ai/dsh-credentials": ">=0.1.1-rc.1 <0.3.0",
112
+ "@deepseek-ai/dsh-settings": ">=0.1.1-rc.1 <0.3.0",
113
+ "@deepseek-ai/schemastery": "^3.18.1",
114
+ "@earendil-works/pi-ai": ">=0.82.1"
115
+ },
116
+ "peerDependenciesMeta": {
117
+ "@deepseek-ai/dsh-llm": {
118
+ "optional": true
119
+ },
120
+ "@deepseek-ai/dsh-llm-pi-ai": {
121
+ "optional": true
122
+ },
123
+ "@deepseek-ai/schemastery": {
124
+ "optional": true
125
+ },
126
+ "@earendil-works/pi-ai": {
127
+ "optional": true
128
+ },
129
+ "@deepseek-ai/cordis": {
130
+ "optional": true
131
+ },
132
+ "@deepseek-ai/dsh-settings": {
133
+ "optional": true
134
+ },
135
+ "@deepseek-ai/dsh-credentials": {
136
+ "optional": true
137
+ }
138
+ },
139
+ "publishConfig": {
140
+ "access": "public",
141
+ "registry": "https://registry.npmjs.org/"
142
+ }
143
+ }
@@ -0,0 +1 @@
1
+ []
@@ -0,0 +1,261 @@
1
+ /**
2
+ * Link the host-provided peer dependencies into this package's node_modules.
3
+ *
4
+ * WHY THIS EXISTS
5
+ *
6
+ * Seven of this plugin's dependencies are `peerDependencies`: the host supplies them, not
7
+ * npm. A manual copy of the package into `node_modules/dsh-xdpool` resolved them by walking
8
+ * up into the host's tree, so nothing was ever missing. Installing normally breaks that
9
+ * walk, and a top-level import failure prevents `apply()` from ever running — so EVERY web
10
+ * route is unregistered and the card renders empty while blaming the gateway.
11
+ *
12
+ * WHAT IT MAY NOT DO: FAIL THE INSTALL
13
+ *
14
+ * The script links what it can find and then stops. It does not exit non-zero when the
15
+ * host cannot be located, for a reason that two bug reports made concrete:
16
+ *
17
+ * - A PACKAGED host keeps its dependencies inside `app.asar`, and `fs.existsSync` in a
18
+ * plain Node process cannot see inside an asar archive — only Electron's patched `fs`
19
+ * can. So "not found" from here often means "invisible to this process", not "absent".
20
+ * - The host resolves these peers itself at runtime. 2.6.3 shipped with no postinstall at
21
+ * all and loaded fine on macOS for exactly that reason.
22
+ *
23
+ * The previous version treated a failed probe as proof of a broken install and exited 1,
24
+ * which made the plugin manager roll back a working upgrade. That is the worst outcome
25
+ * available: the user loses the new version to protect against a problem they did not have.
26
+ *
27
+ * So the contract is now: link when the host is reachable, otherwise say what was not
28
+ * found and finish successfully. Only an actual failure to CREATE a link is reported, and
29
+ * even then as a warning — the plugin may still load through the host's own resolution.
30
+ *
31
+ * HOW RESOLUTION IS CHECKED
32
+ *
33
+ * With ESM, not CJS. `@earendil-works/pi-ai` is ESM-only: its `exports` map has `types` and
34
+ * `import` but no `require` and no `./package.json` subpath. A `require.resolve()` of it
35
+ * throws ERR_PACKAGE_PATH_NOT_EXPORTED even when the package is installed and importable,
36
+ * which is precisely the false negative the reporter hit. `import.meta.resolve` asks the
37
+ * question the plugin will actually ask.
38
+ *
39
+ * @module dsh-xdpool/scripts/link-host-peers
40
+ */
41
+ import { existsSync, mkdirSync, readFileSync, rmSync, symlinkSync } from 'node:fs'
42
+ import { dirname, join, resolve } from 'node:path'
43
+ import { fileURLToPath, pathToFileURL } from 'node:url'
44
+
45
+ const HERE = dirname(fileURLToPath(import.meta.url))
46
+ const PACKAGE_ROOT = resolve(HERE, '..')
47
+ const ENTRY_URL = pathToFileURL(join(PACKAGE_ROOT, 'lib', 'index.js')).href
48
+
49
+ /** The peer dependencies this plugin imports at runtime. */
50
+ function peerNames() {
51
+ const manifest = JSON.parse(readFileSync(join(PACKAGE_ROOT, 'package.json'), 'utf8'))
52
+ return Object.keys(manifest.peerDependencies ?? {})
53
+ }
54
+
55
+ /**
56
+ * Can the plugin resolve `name` from its own entry point?
57
+ *
58
+ * `import.meta.resolve` answers with ESM conditions, which is what the plugin uses. It
59
+ * never throws for a missing package in current Node — it returns a URL that may not
60
+ * exist — so the answer is checked for existence as well.
61
+ *
62
+ * A `data:` or `node:` result is not a real package file and is treated as unresolved.
63
+ */
64
+ function resolvesFromEntry(name) {
65
+ try {
66
+ const url = import.meta.resolve(name, ENTRY_URL)
67
+ if (typeof url !== 'string' || url === '') return undefined
68
+ if (url.startsWith('node:') || url.startsWith('data:')) return undefined
69
+ return fileURLToPath(url)
70
+ } catch {
71
+ return undefined
72
+ }
73
+ }
74
+
75
+ /**
76
+ * The package directory for `name`, whether or not it can be imported right now.
77
+ *
78
+ * The physical check comes FIRST because it is the only one that works for an ESM-only
79
+ * package whose `exports` map omits `./package.json`: `require.resolve(`${name}/package.json`)`
80
+ * throws ERR_PACKAGE_PATH_NOT_EXPORTED for `pi-ai` even with the package sitting on disk.
81
+ * That false negative used to send an already-linked peer back into the missing list, so a
82
+ * second `postinstall` run re-linked what it had just built.
83
+ */
84
+ function locate(name) {
85
+ // 1. On disk under this package's own node_modules — a junction we made earlier counts.
86
+ const physical = join(PACKAGE_ROOT, 'node_modules', name)
87
+ if (existsSync(join(physical, 'package.json'))) return physical
88
+ // 2. Whatever ESM resolves from the entry, which is the real question.
89
+ const resolved = resolvesFromEntry(name)
90
+ if (resolved !== undefined) {
91
+ // Walk up to the package root: the first directory named like the package.
92
+ const wanted = name.startsWith('@') ? name.split('/')[1] : name
93
+ let dir = dirname(resolved)
94
+ while (dir !== dirname(dir)) {
95
+ if (dir.endsWith(`/${wanted}`) || dir.endsWith(`\\${wanted}`)) return dir
96
+ dir = dirname(dir)
97
+ }
98
+ return dirname(resolved)
99
+ }
100
+ return undefined
101
+ }
102
+
103
+ /**
104
+ * Candidate host module roots.
105
+ *
106
+ * The host SPLITS its tree — `cordis` and the `@deepseek-ai/*` runtime in one place,
107
+ * `pi-ai` in another — so several roots are tried rather than one.
108
+ *
109
+ * `DSH_HOST_ROOT` is honoured when set, but note it is NOT injected by the host: two
110
+ * reporters verified that the plugin manager does not pass it. It exists for an operator
111
+ * who wants to point at a specific tree by hand.
112
+ *
113
+ * On a packaged install most of this is unverifiable from a plain Node process, because the
114
+ * dependencies live inside `app.asar` and `existsSync` cannot see in. That is expected and
115
+ * is why a miss is not an error.
116
+ */
117
+ function hostRoots() {
118
+ const roots = []
119
+ const env = process.env['DSH_HOST_ROOT']
120
+ if (typeof env === 'string' && env !== '') roots.push(env)
121
+ // When the host loads the plugin from inside its own tree.
122
+ roots.push(resolve(PACKAGE_ROOT, '..'))
123
+ roots.push(resolve(PACKAGE_ROOT, '..', '..', '..'))
124
+ /**
125
+ * Derived from the running executable, which is the only signal that survives a
126
+ * non-default install drive — the reporter's harness sat on `F:` while every hard-coded
127
+ * guess pointed at `C:`. `process.execPath` is the Node or Electron binary doing the
128
+ * install, which for the bundled runtime lives inside the harness directory.
129
+ */
130
+ for (const up of [1, 2, 3, 4, 5]) {
131
+ const segments = [process.execPath]
132
+ for (let i = 0; i < up; i += 1) segments.push('..')
133
+ const base = resolve(...segments)
134
+ for (const app of ['app', join('app', 'dsh')]) {
135
+ roots.push(join(base, 'resources', app, 'node_modules'))
136
+ }
137
+ roots.push(join(base, 'node_modules'))
138
+ }
139
+ for (const base of HARNESS_BASES) {
140
+ if (typeof base !== 'string' || base === '') continue
141
+ for (const app of ['app', join('app', 'dsh')]) {
142
+ roots.push(join(base, 'resources', app, 'node_modules'))
143
+ }
144
+ }
145
+ return [...new Set(roots)]
146
+ }
147
+
148
+ /**
149
+ * Where a DSH install commonly sits, per platform.
150
+ *
151
+ * Every entry is a guess and a miss is silent, which is what makes listing several
152
+ * acceptable. `HARNESS_BASES` used to be Windows-only — the macOS reporter's whole
153
+ * `LOCALAPPDATA`/`PROGRAMFILES` loop simply never ran.
154
+ */
155
+ const HARNESS_BASES = [
156
+ process.env['DSH_HARNESS_ROOT'],
157
+ // macOS: /Applications/DeepSeek Harness.app/Contents/Resources
158
+ '/Applications/DeepSeek Harness.app/Contents/Resources',
159
+ join(process.env['HOME'] ?? '', 'Applications', 'DeepSeek Harness.app', 'Contents', 'Resources'),
160
+ // Linux
161
+ join(process.env['HOME'] ?? '', '.local', 'share', 'deepseek-harness'),
162
+ '/opt/DeepSeek Harness',
163
+ // Windows
164
+ typeof process.env['LOCALAPPDATA'] === 'string' ? join(process.env['LOCALAPPDATA'], 'Programs', 'DeepSeek Harness') : undefined,
165
+ typeof process.env['LOCALAPPDATA'] === 'string' ? join(process.env['LOCALAPPDATA'], 'DeepSeek Harness') : undefined,
166
+ typeof process.env['ProgramW6432'] === 'string' ? process.env['ProgramW6432'] : undefined,
167
+ typeof process.env['PROGRAMFILES'] === 'string' ? process.env['PROGRAMFILES'] : undefined,
168
+ ]
169
+
170
+ /** Whether this is a source checkout rather than an installed package. */
171
+ const IS_SOURCE_CHECKOUT = existsSync(join(PACKAGE_ROOT, 'src'))
172
+
173
+ const linked = []
174
+ const alreadyResolved = []
175
+ const notFound = []
176
+ const failed = []
177
+
178
+ for (const name of peerNames()) {
179
+ // Already resolvable: leave it alone. Someone who installed a peer deliberately keeps
180
+ // control, and re-linking would overwrite that choice. This check is also what makes the
181
+ // script idempotent — a second run must not rebuild links it made the first time.
182
+ if (locate(name) !== undefined) { alreadyResolved.push(name); continue }
183
+ let target
184
+ for (const root of hostRoots()) {
185
+ const candidate = join(root, name)
186
+ // `existsSync` cannot see inside `app.asar`; on a packaged host this simply misses and
187
+ // the peer is reported as not found, which is no longer fatal.
188
+ if (existsSync(join(candidate, 'package.json'))) { target = candidate; break }
189
+ }
190
+ if (target === undefined) { notFound.push(name); continue }
191
+ const dest = join(PACKAGE_ROOT, 'node_modules', name)
192
+ try {
193
+ mkdirSync(dirname(dest), { recursive: true })
194
+ // A previous run may have left a link (or a partial one); replacing it is correct
195
+ // because the resolve check above already skipped anything that works.
196
+ if (existsSync(dest)) rmSync(dest, { recursive: true, force: true })
197
+ // Junction on Windows because creating a real symlink needs elevation there; a
198
+ // junction needs none and behaves the same for directory reads.
199
+ symlinkSync(target, dest, process.platform === 'win32' ? 'junction' : 'dir')
200
+ linked.push(`${name} → ${target}`)
201
+ } catch (error) {
202
+ failed.push(`${name} (${error instanceof Error ? error.message : String(error)})`)
203
+ }
204
+ }
205
+
206
+ if (linked.length > 0) {
207
+ process.stdout.write(`heybash-xdpool: linked ${String(linked.length)} host dependency(ies)\n`)
208
+ for (const line of linked) process.stdout.write(` ${line}\n`)
209
+ }
210
+ if (alreadyResolved.length > 0 && linked.length === 0) {
211
+ process.stdout.write(`heybash-xdpool: all ${String(alreadyResolved.length)} peer dependencies already resolve\n`)
212
+ }
213
+
214
+ /**
215
+ * Report, and deliberately do not fail.
216
+ *
217
+ * A packaged host hides these inside `app.asar` (invisible to a bare Node process) and
218
+ * resolves them itself at runtime — 2.6.3 shipped with no postinstall and loaded fine. So
219
+ * "not found from here" is not evidence of a broken install, and exiting non-zero on it
220
+ * rolled back working upgrades for macOS and Windows users alike.
221
+ */
222
+ if (notFound.length > 0) {
223
+ process.stdout.write(
224
+ `heybash-xdpool: ${String(notFound.length)} peer dependency(ies) not visible from this process:\n`
225
+ + notFound.map(name => ` ${name}\n`).join('')
226
+ + (IS_SOURCE_CHECKOUT
227
+ ? 'Expected in a source checkout: build and test resolve them from devDependencies.\n'
228
+ : 'This is normal for a packaged host, which keeps them inside app.asar and resolves\n'
229
+ + 'them itself at runtime. Set DSH_HOST_ROOT to a directory containing node_modules\n'
230
+ + 'only if the plugin later fails to load.\n'),
231
+ )
232
+ }
233
+ if (failed.length > 0) {
234
+ // A link that could not be CREATED is a real problem, but still not fatal: the host may
235
+ // resolve the peer without our help. Worth a warning, not a rollback.
236
+ process.stdout.write(
237
+ `heybash-xdpool: could not link ${String(failed.length)} dependency(ies):\n`
238
+ + failed.map(name => ` ${name}\n`).join(''),
239
+ )
240
+ }
241
+
242
+ /**
243
+ * Final self-check, phrased as the plugin would phrase it.
244
+ *
245
+ * Uses ESM resolution rather than CJS: `pi-ai` is ESM-only with no `require` condition and
246
+ * no `./package.json` subpath, so a `require.resolve` of it throws
247
+ * ERR_PACKAGE_PATH_NOT_EXPORTED while the package sits there fully importable. That false
248
+ * negative is what made 2.6.4 uninstallable on Windows.
249
+ *
250
+ * An unresolved peer is reported and the script still exits 0, for the asar reason above.
251
+ */
252
+ const unresolved = peerNames().filter(name => locate(name) === undefined)
253
+ if (unresolved.length === 0) {
254
+ process.stdout.write('heybash-xdpool: all peer dependencies resolve; the build should load\n')
255
+ } else {
256
+ process.stdout.write(
257
+ `heybash-xdpool: ${String(unresolved.length)} peer dependency(ies) do not resolve here: `
258
+ + `${unresolved.join(', ')}\n`
259
+ + ' Not treated as an install failure — see the note above.\n',
260
+ )
261
+ }
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Jet
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,53 @@
1
+ # vendor/channel-pack — 上游免费渠道包的来源与再构建
2
+
3
+ 本目录是 **[dsh-codearts-auth](https://gitee.com/iJetLi/deepseek-harness-codearts)**
4
+ 的完整拷贝,由 `dsh-our-free-model` 的 Host 半身在独立 fiber 上挂载,
5
+ 使 CodeArts、CodeBuddy、WorkBuddy、LobsterAI、Qoder、Qoder 中国版、TRAE、
6
+ Cline、Loomy、Raccoon、MiniMax Code、ZCode、Gemini 这十三个账号渠道的
7
+ 登录流程、账号池、积分领取、模型黑名单与本地 OpenAI 网关可用。OFM 挂载时关闭上游 OpenCode 账号接入,原有匿名免费车道保持独立。
8
+ 目录名与内部标识符在本插件的再构建中统一改为 channel-pack;出处与许可证不变。
9
+
10
+ - 上游仓库:`https://gitee.com/iJetLi/deepseek-harness-codearts`
11
+ - 吸收的提交:`345f0a07b22713c0ae189ca7d8b97ec4f64626c6`(2026-10-06)
12
+ - 许可证:MIT(见 `LICENSE`,与上游一致)
13
+
14
+ ## 目录内容
15
+
16
+ | 路径 | 说明 |
17
+ | --- | --- |
18
+ | `src/` | 上游 TypeScript 源码,包含下述 OFM 本地适配(便于审计与再构建) |
19
+ | `pack.js` | **插件运行时实际加载的代码**:直接由 `src/` 经 `scripts/build-channel-pack.mjs` 打包成单文件(jose/undici 内联,`@deepseek-ai/*` 保持外部),使发布清单不超文件上限 |
20
+ | `qoder-auth-wasm.wasm` | Qoder 加密推理所需的 WASM,必须与 `pack.js` 同目录(`pack.js` 按 `import.meta.url` 定位它) |
21
+ | `locale/` | 上游文案 |
22
+ | `scripts/`、`tsconfig.json`、`package.json` | 再构建所需的元数据(`lib/` 与 `node_modules/` 不入库,按下面步骤重建) |
23
+
24
+ 宿主提供的依赖(`@deepseek-ai/dsh-llm`、`@deepseek-ai/dsh-credentials`、
25
+ `@deepseek-ai/cordis`、`@deepseek-ai/schemastery`)不在此目录,按 Node 解析规则
26
+ 从安装它的 profile 的 `node_modules` 取;缺少时渠道包整体降级(`/summary.channels`
27
+ 报告 `state: "failed"` 与原因),免费车道不受影响。
28
+
29
+ ## 再构建
30
+
31
+ 直接从受版本管理的 `src/` 打包,不使用未入库的 `lib/`:
32
+
33
+ ```bash
34
+ # 在仓库外准备构建依赖,保持插件零运行依赖
35
+ npm install --prefix /tmp/ofm-channel-build --no-package-lock --ignore-scripts esbuild@0.24.2 jose@6.2.9 undici@8.11.2
36
+ mkdir -p vendor/channel-pack/node_modules
37
+ cp -R /tmp/ofm-channel-build/node_modules/jose /tmp/ofm-channel-build/node_modules/undici vendor/channel-pack/node_modules/
38
+ OFM_ESBUILD_DIR=/tmp/ofm-channel-build npm run channel-pack
39
+ # qoder-auth-wasm.wasm 沿用上游已有文件,须与 pack.js 同目录
40
+ # 清理本次创建的构建依赖;这些目录不入库、不随插件发布
41
+ rm -rf vendor/channel-pack/node_modules
42
+ ```
43
+
44
+ ## OFM 本地适配
45
+
46
+ - `src/index.ts`:增加可选 `disableOpencode` 挂载配置;OFM 开启它时跳过重复 OpenCode adapter、默认匿名账号和能力表预热,保留历史账号及凭据。省略时维持上游行为。
47
+ - `src/channel-pack-rpc.ts`:追加同一配置,关闭时拒绝 `opencode.*` 与通用 `account.create(provider=opencode)`。
48
+ - 打包入口改为 `src/index.ts`;宿主模块仍保持外部,jose/undici 内联。
49
+ - 构建依赖固定为 esbuild 0.24.2、jose 6.2.9、undici 8.11.2;本次重构建核对了原包的依赖代码,未借此升级运行依赖。
50
+
51
+ 本目录**不含**上游的浏览器半身(`plugin-src/client`)与其设置页——
52
+ 界面由 `dsh-our-free-model` 自己的三页界面取代,渠道操作经上游的
53
+ `/api/channel-pack` RPC 完成(`connection.rpc.call('/api', 'channel-pack', { method, payload })`)。