@dan-ai-studio/dshopencodego 0.1.92 → 0.1.94
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 +15 -10
- package/lib/index.js +479 -204
- package/lib/types/llm-error.d.ts +27 -0
- package/package.json +25 -25
package/README.en.md
CHANGED
|
@@ -260,7 +260,7 @@ The verdict:
|
|
|
260
260
|
Things to keep in mind when maintaining this:
|
|
261
261
|
|
|
262
262
|
- **Required versus optional peers**: nine of the twenty-one are marked `optional` (`dsh-api-remotes`, `dsh-client-locale`, `dsh-client-store`, `dsh-client-ui-layout`, `dsh-client-ui-model-selection`, `dsh-client-ui-primitives`, `dsh-client-ui-settings`, `dsh-client-ui-sidebar`, `dsh-client-ui-slots`). The other twelve are required at runtime: `cordis`, `dsh-attachment`, `dsh-brand`, `dsh-client-ui-conversation`, `dsh-client-ui-renderer`, `dsh-credentials`, `dsh-fs`, `dsh-launch-environment`, `dsh-llm`, `dsh-timeout`, `dsh-typert-protocol`, and `dsh-typert-registry`. None of the twenty-one takes part in the load verdict today (see above: `engines.dsh` decides alone); their value is declaring the dependency for the package manager and for readers. `dsh-llm` is the heaviest coupling — more than twenty imports across the source.
|
|
263
|
-
- **Declared range ≠ verified range**: the declaration is `>=0.2.0-rc.1 <0.3.0-0`. What was actually verified here, in order, is `0.2.0-rc.1` (the dev-dependency baseline: gate verdict + typecheck + full suite), `0.2.0-rc.2` (the same plus a `prepareCall` generation freeze), `0.2.1-alpha.3` (the first target release), `0.2.1-alpha.4` (T-24), `0.2.1-alpha.5` (T-26),
|
|
263
|
+
- **Declared range ≠ verified range**: the declaration is `>=0.2.0-rc.1 <0.3.0-0`. What was actually verified here, in order, is `0.2.0-rc.1` (the dev-dependency baseline: gate verdict + typecheck + full suite), `0.2.0-rc.2` (the same plus a `prepareCall` generation freeze), `0.2.1-alpha.3` (the first target release), `0.2.1-alpha.4` (T-24), `0.2.1-alpha.5` (T-26), `0.2.1-rc.2` (T-31, where the runtime moved to cordis `4.0.5`; the upstream contract layer had zero source changes), `0.2.2-rc.1` (cordis `4.1.0`), `0.2.2-rc.2` (`LlmError`'s `code` narrowed to its built-in union), and `0.2.2-rc.3` (the current dev-dependency baseline). Other versions inside the range were not verified one by one.
|
|
264
264
|
- **The upper bound is a tracking line**: `<0.3.0-0` means that the moment DSH ships `0.3.0-0` (the first prerelease on the `0.3.0` line), this plugin must ship a new release in the same window or every user loses the plugin. `tests/peer-coverage.spec.ts` asserts both ends — the lower bound accepts the installed version, the upper bound rejects `0.3.0-0` — so a drift here fails locally instead of failing on a user's machine. After changing a range, `npm test` is the verification (local mock gateway, no network, no tokens) — ranges follow what the interfaces declare, and are never "measured" with live probes.
|
|
265
265
|
- **Peer coverage is now guarded both ways**: `dsh-typert-registry`, `dsh-client-ui-conversation`, and `dsh-client-ui-renderer` were imported by the source but absent from `peerDependencies`, invisible to the gate; they are declared now, and `tests/peer-coverage.spec.ts` asserts both directions — anything the source imports must be declared, and anything declared but unreached must be removed (`dsh-settings` went that way: the settings form is actually provided by `dsh-client-ui-settings`).
|
|
266
266
|
- **Exemptions are per profile**: only a profile that ran `dsh plugin allow-version` has one, and no record means the plugin must stay inside the declared range. `dsh plugin version-exemptions` lists a profile's exemptions.
|
package/README.md
CHANGED
|
@@ -259,7 +259,7 @@ API Key 通过 Harness 凭证库提供(引用名 `OPENCODE_GO_API_KEY`),
|
|
|
259
259
|
维护时需要注意:
|
|
260
260
|
|
|
261
261
|
- **必选与可选之分**:21 个 peer(20 个 `dsh-*` 加框架 `cordis`)中 9 个标了 `optional`(`dsh-api-remotes`、`dsh-client-locale`、`dsh-client-store`、`dsh-client-ui-layout`、`dsh-client-ui-model-selection`、`dsh-client-ui-primitives`、`dsh-client-ui-settings`、`dsh-client-ui-sidebar`、`dsh-client-ui-slots`);其余 12 个是运行时必需的——`cordis`、`dsh-attachment`、`dsh-brand`、`dsh-client-ui-conversation`、`dsh-client-ui-renderer`、`dsh-credentials`、`dsh-fs`、`dsh-launch-environment`、`dsh-llm`、`dsh-timeout`、`dsh-typert-protocol`、`dsh-typert-registry`。这 21 个当前都**不参与加载判定**(见上:`engines.dsh` 单独决定),它们的价值在于声明依赖并供包管理器与读者使用。其中 `dsh-llm` 是最重的一处耦合(源码 import 二十余处)。
|
|
262
|
-
- **名义范围 ≠ 实测范围**:声明范围是 `>=0.2.0-rc.1 <0.3.0-0`,本项目实际验证过的基线依次是 `0.2.0-rc.1`(开发依赖基线:门禁判定 + typecheck + 全量用例)、`0.2.0-rc.2`(同上 + `prepareCall` 代次冻结)、`0.2.1-alpha.3`(首个目标版本)、`0.2.1-alpha.4`(T-24)、`0.2.1-alpha.5`(T-26
|
|
262
|
+
- **名义范围 ≠ 实测范围**:声明范围是 `>=0.2.0-rc.1 <0.3.0-0`,本项目实际验证过的基线依次是 `0.2.0-rc.1`(开发依赖基线:门禁判定 + typecheck + 全量用例)、`0.2.0-rc.2`(同上 + `prepareCall` 代次冻结)、`0.2.1-alpha.3`(首个目标版本)、`0.2.1-alpha.4`(T-24)、`0.2.1-alpha.5`(T-26)、`0.2.1-rc.2`(T-31,运行时升到 cordis `4.0.5`;上游契约层源码零变更)、`0.2.2-rc.1`(cordis `4.1.0`)、`0.2.2-rc.2`(`LlmError` 的 `code` 收窄为内置联合类型)与 `0.2.2-rc.3`(当前开发依赖基线)。范围内的其他版本没有逐个验证过。
|
|
263
263
|
- **上界就是跟版线**:`<0.3.0-0` 意味着 DSH 一旦发布 `0.3.0-0`(`0.3.0` 线的第一个预发布版),本插件必须同批发新版,否则所有用户加载失败。`tests/peer-coverage.spec.ts` 会同时断言下界接受已安装版本、上界拒绝 `0.3.0-0`,所以这条线漂移会在本地测试里先失败,而不是等用户加载失败。调整范围后用 `npm test` 验证即可(本地 mock 网关,零网络零 token)——范围以接口声明为准,不要用线上探测来"测"出一个范围。
|
|
264
264
|
- **peer 覆盖已双向守住**:`dsh-typert-registry`、`dsh-client-ui-conversation`、`dsh-client-ui-renderer` 曾被源码 import 却未声明、门禁管不到,现已补进 `peerDependencies`;`tests/peer-coverage.spec.ts` 双向断言——源码用到的必须声明,声明了却没人用的必须删(`dsh-settings` 就这样被移除:设置表单实际由 `dsh-client-ui-settings` 提供)。
|
|
265
265
|
- **豁免是按 profile 记的**:只有显式执行过 `dsh plugin allow-version` 的 profile 才享有豁免;没有记录就代表必须落在声明范围内。用 `dsh plugin version-exemptions` 可查看当前 profile 的豁免。
|
package/lib/client.js
CHANGED
|
@@ -1410,18 +1410,22 @@ var SectionController = class _SectionController {
|
|
|
1410
1410
|
}
|
|
1411
1411
|
}
|
|
1412
1412
|
/**
|
|
1413
|
-
* The desktop download Remote.
|
|
1413
|
+
* The desktop download Remote, when the running build mounted it.
|
|
1414
1414
|
*
|
|
1415
|
-
*
|
|
1416
|
-
*
|
|
1417
|
-
*
|
|
1418
|
-
*
|
|
1419
|
-
*
|
|
1415
|
+
* Deliberately *not* in `client/index.ts`'s inject list. A declared
|
|
1416
|
+
* dependency that never mounts does not degrade — Cordis simply never runs
|
|
1417
|
+
* the injection, so the whole settings section disappears, which is exactly
|
|
1418
|
+
* what a missing desktop namespace did to 0.1.92. Reading it here instead
|
|
1419
|
+
* costs a caught error when it is absent and keeps every other panel on the
|
|
1420
|
+
* page alive; the download row then says it is not ready.
|
|
1421
|
+
* @returns the mounted desktop Remote, or undefined when it is absent.
|
|
1420
1422
|
*/
|
|
1421
1423
|
desktopRemote() {
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1424
|
+
try {
|
|
1425
|
+
return this.services.remote.opencodeGoDesktop;
|
|
1426
|
+
} catch {
|
|
1427
|
+
return void 0;
|
|
1428
|
+
}
|
|
1425
1429
|
}
|
|
1426
1430
|
/**
|
|
1427
1431
|
* Ask the Host which installer the desktop download host publishes.
|
|
@@ -1437,6 +1441,7 @@ var SectionController = class _SectionController {
|
|
|
1437
1441
|
this.set({ desktop: { ...previous, phase: "checking", message: void 0, copied: false } });
|
|
1438
1442
|
try {
|
|
1439
1443
|
const remote = this.desktopRemote();
|
|
1444
|
+
if (remote === void 0) throw new Error("remote-not-mounted");
|
|
1440
1445
|
const result = force ? await remote.refreshDesktop() : await remote.readDesktop();
|
|
1441
1446
|
if (!result.ok) throw result.error;
|
|
1442
1447
|
const reading = result.value;
|
|
@@ -3468,7 +3473,7 @@ function apply(ctx) {
|
|
|
3468
3473
|
void dispose?.();
|
|
3469
3474
|
};
|
|
3470
3475
|
}, "dshopencodego: usage Remote");
|
|
3471
|
-
ctx.inject(["configForms", "remote.opencodeGoCatalog", "remote.opencodeGoUpdate", "remote.opencodeGoNetwork", "remote.
|
|
3476
|
+
ctx.inject(["configForms", "remote.opencodeGoCatalog", "remote.opencodeGoUpdate", "remote.opencodeGoNetwork", "remote.opencodeGoRequestLog", "remote.credentials"], (scope) => {
|
|
3472
3477
|
const forms = scope.get("configForms");
|
|
3473
3478
|
const pluginManager = {};
|
|
3474
3479
|
const profile = forms?.get("dshopencodego");
|