@dan-ai-studio/dshopencodego 0.1.18 → 0.1.20

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 CHANGED
@@ -162,7 +162,7 @@ The `engines.dsh` field is informational for readers and package managers; **DSH
162
162
  Things to keep in mind when maintaining this:
163
163
 
164
164
  - **Required versus optional peers**: six of the eighteen are marked `optional` (`dsh-api-remotes`, `dsh-client-locale`, `dsh-client-store`, `dsh-client-ui-model-selection`, `dsh-client-ui-settings`, `dsh-client-ui-slots`). The twelve that actually block loading are `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`. `dsh-llm` is the heaviest coupling — more than twenty imports across the source.
165
- - **Declared range ≠ verified range**: `0.1.7-alpha.1` and `alpha.2` fall inside the declaration but were never verified here. What was verified is `0.1.7-rc.1`, `0.1.7-rc.2` (daily use), `0.2.0-rc.1` (the dev-dependency baseline: gate verdict + typecheck + full suite), and `0.2.0-rc.2` (dev-dependency baseline + `prepareCall` generation freeze + pi-ai delta-parse patch port).
165
+ - **Declared range ≠ verified range**: `0.1.7-alpha.1` and `alpha.2` fall inside the declaration but were never verified here. What was verified is `0.1.7-rc.1`, `0.1.7-rc.2` (daily use), `0.2.0-rc.1` (the dev-dependency baseline: gate verdict + typecheck + full suite), and `0.2.0-rc.2` (dev-dependency baseline + `prepareCall` generation freeze).
166
166
  - **The upper bound is a tracking line**: `<0.3.0` means that the moment DSH ships `0.3.0`, this plugin must ship a new release in the same window or every user loses the plugin. The current range spans both `0.1.7` and `0.2.0` (`0.1.8` and `0.1.9` were never published, hence two segments). 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.
167
167
  - **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`).
168
168
  - **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.
@@ -179,6 +179,7 @@ Things to keep in mind when maintaining this:
179
179
  | "The settings write was rejected" | Usually a concurrent writer (another window or process) holding the same profile. The plugin retries once automatically; if it still fails the view has reloaded — click again. |
180
180
  | The usage button shows "unavailable" | An endpoint or credential change invalidated the previous reading. Fix the configuration and press Retry. It never shows `0` in place of a missing reading. |
181
181
  | npm publish fails with `ENEEDAUTH` | OIDC did not match: check the Trusted Publisher's **workflow filename** (must be exactly `publish-npm.yml`, case-sensitive) and the organization/repository fields; run on GitHub-hosted runners with `id-token: write`. A `repository.url` that does not match the GitHub repository is rejected as well. |
182
+ | The whole DSH process stalls during ultra-long tool calls (multi-MB arguments) | Inherent to pi-ai 0.87.1's per-delta re-parsing (issue #9265 / PR #9461). This plugin does not port DSH's consumer-side patch (ADR-0005); the fix arrives with an upstream release and a pi-ai upgrade. |
182
183
 
183
184
  ## Development
184
185
 
package/README.md CHANGED
@@ -162,7 +162,7 @@ API Key 通过 Harness 凭证库提供(引用名 `OPENCODE_GO_API_KEY`),
162
162
  维护时需要注意:
163
163
 
164
164
  - **必选与可选之分**:18 个 peer(17 个 `dsh-*` 加框架 `cordis`)中 6 个标了 `optional`(`dsh-api-remotes`、`dsh-client-locale`、`dsh-client-store`、`dsh-client-ui-model-selection`、`dsh-client-ui-settings`、`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`。其中 `dsh-llm` 是最重的一处耦合(源码 import 二十余处)。
165
- - **名义范围 ≠ 实测范围**:`0.1.7-alpha.1`、`alpha.2` 落在声明范围内,但本项目没有验证过;实际验证过的是 `0.1.7-rc.1`、`0.1.7-rc.2`(日常使用)、`0.2.0-rc.1`(开发依赖基线:门禁判定 + typecheck + 全量用例)与 `0.2.0-rc.2`(开发依赖基线 + `prepareCall` 代次冻结 + pi-ai 增量解析补丁移植)。
165
+ - **名义范围 ≠ 实测范围**:`0.1.7-alpha.1`、`alpha.2` 落在声明范围内,但本项目没有验证过;实际验证过的是 `0.1.7-rc.1`、`0.1.7-rc.2`(日常使用)、`0.2.0-rc.1`(开发依赖基线:门禁判定 + typecheck + 全量用例)与 `0.2.0-rc.2`(开发依赖基线 + `prepareCall` 代次冻结)。
166
166
  - **上界就是跟版线**:`<0.3.0` 意味着 DSH 一旦发布 `0.3.0`,本插件必须同批发新版,否则所有用户加载失败。当前范围跨 `0.1.7` 与 `0.2.0` 两代(`0.1.8`、`0.1.9` 从未发布,所以写成两段而不是一条)。调整范围后用 `npm test` 验证即可(本地 mock 网关,零网络零 token)——范围以接口声明为准,不要用线上探测来"测"出一个范围。
167
167
  - **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` 提供)。
168
168
  - **豁免是按 profile 记的**:只有显式执行过 `dsh plugin allow-version` 的 profile 才享有豁免;没有记录就代表必须落在声明范围内。用 `dsh plugin version-exemptions` 可查看当前 profile 的豁免。
@@ -179,6 +179,7 @@ API Key 通过 Harness 凭证库提供(引用名 `OPENCODE_GO_API_KEY`),
179
179
  | 设置页出现「设置写入被拒绝」 | 通常是与另一个窗口/进程并发写同一 profile;插件会自动重试一次,仍失败时界面已重载最新状态,再点一次即可。 |
180
180
  | 用量按钮显示「不可用」 | 端点或凭证变化导致旧读数作废;配置正确后点「重试」。数值不会以 0 冒充。 |
181
181
  | npm 发布报 `ENEEDAUTH` | OIDC 没匹配上:核对包设置里 Trusted Publisher 的 **workflow 文件名**(必须恰为 `publish-npm.yml`、大小写敏感)与组织/仓库字段;确认跑在 GitHub 托管 runner 上且工作流带 `id-token: write`。`package.json` 的 `repository.url` 与仓库不符也会被拒。 |
182
+ | 超长工具调用(多 MB 参数)期间整个 DSH 进程卡顿 | 上游 pi-ai 0.87.1 逐 delta 重解析的固有开销(issue #9265 / PR #9461)。本插件不移植 DSH 的消费者侧补丁(ADR-0005);修复随上游发布后升级 pi-ai 解决。 |
182
183
 
183
184
  ## 开发
184
185
 
package/lib/client.js CHANGED
@@ -462,7 +462,7 @@ if (!document.querySelector("style[data-plugin-css=" + JSON.stringify(id) + "]")
462
462
  style.textContent = ".d7lz0W_root{color:var(--dsw-alias-label-primary);flex-direction:column;gap:1.25rem;display:flex}.d7lz0W_title{margin:0;font-size:1.05rem}.d7lz0W_hint{color:var(--dsw-alias-label-secondary);margin:0;font-size:.8rem}.d7lz0W_warn{color:var(--dsw-alias-state-warn-primary);margin:0;font-size:.8rem}.d7lz0W_ok{color:var(--dsw-alias-state-success-primary);font-size:.8rem}.d7lz0W_block{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);border-radius:.6rem;flex-direction:column;gap:.5rem;padding:.85rem;display:flex}.d7lz0W_row{flex-wrap:wrap;align-items:center;gap:.5rem;display:flex}.d7lz0W_row>strong{margin-right:auto}.d7lz0W_input{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-base);min-width:10rem;color:var(--dsw-alias-label-primary);font:inherit;border-radius:.35rem;flex:14rem;padding:.35rem .5rem;font-size:.85rem}.d7lz0W_button{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);font:inherit;cursor:pointer;border-radius:.35rem;padding:.35rem .7rem;font-size:.8rem}.d7lz0W_button:disabled{color:var(--dsw-alias-state-idle-primary);cursor:default}.d7lz0W_number{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-base);width:5rem;color:var(--dsw-alias-label-primary);font:inherit;border-radius:.35rem;padding:.25rem .4rem;font-size:.8rem}.d7lz0W_select{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-base);width:auto;max-width:100%;color:var(--dsw-alias-label-primary);font:inherit;border-radius:.35rem;padding:.25rem .4rem;font-size:.8rem}.d7lz0W_list{flex-direction:column;display:flex}.d7lz0W_item{border-top:1px solid var(--dsw-alias-border-l1);align-items:flex-start;gap:.5rem;padding:.45rem .15rem;display:flex}.d7lz0W_item input[type=checkbox]{accent-color:var(--dsw-alias-brand-primary);margin-top:.15rem}.d7lz0W_itemBody{flex-direction:column;gap:.15rem;min-width:0;display:flex}.d7lz0W_itemMain{flex-wrap:wrap;align-items:baseline;gap:.6rem;display:flex}.d7lz0W_itemMeta{color:var(--dsw-alias-label-secondary);flex-wrap:wrap;gap:.75rem;font-size:.75rem;display:flex}.d7lz0W_itemModalities{color:var(--dsw-alias-label-secondary);font-size:.75rem}.d7lz0W_name{color:var(--dsw-alias-label-primary)}.d7lz0W_mono{color:var(--dsw-alias-label-secondary);font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.d7lz0W_badge{color:var(--dsw-alias-brand-primary)}";
463
463
  document.head.appendChild(style);
464
464
  }
465
- var section_default = { "ok": "d7lz0W_ok", "itemModalities": "d7lz0W_itemModalities", "number": "d7lz0W_number", "hint": "d7lz0W_hint", "item": "d7lz0W_item", "block": "d7lz0W_block", "name": "d7lz0W_name", "warn": "d7lz0W_warn", "itemMain": "d7lz0W_itemMain", "badge": "d7lz0W_badge", "button": "d7lz0W_button", "input": "d7lz0W_input", "row": "d7lz0W_row", "select": "d7lz0W_select", "title": "d7lz0W_title", "list": "d7lz0W_list", "root": "d7lz0W_root", "itemMeta": "d7lz0W_itemMeta", "itemBody": "d7lz0W_itemBody", "mono": "d7lz0W_mono" };
465
+ var section_default = { "hint": "d7lz0W_hint", "block": "d7lz0W_block", "root": "d7lz0W_root", "row": "d7lz0W_row", "title": "d7lz0W_title", "input": "d7lz0W_input", "warn": "d7lz0W_warn", "item": "d7lz0W_item", "itemMain": "d7lz0W_itemMain", "itemMeta": "d7lz0W_itemMeta", "name": "d7lz0W_name", "button": "d7lz0W_button", "mono": "d7lz0W_mono", "number": "d7lz0W_number", "itemModalities": "d7lz0W_itemModalities", "ok": "d7lz0W_ok", "badge": "d7lz0W_badge", "itemBody": "d7lz0W_itemBody", "list": "d7lz0W_list", "select": "d7lz0W_select" };
466
466
 
467
467
  // src/client/Section.tsx
468
468
  var import_jsx_runtime = require("react/jsx-runtime");
@@ -963,7 +963,7 @@ if (!document.querySelector("style[data-plugin-css=" + JSON.stringify(id2) + "]"
963
963
  style.textContent = ".mMNkkW_root{align-items:center;display:inline-flex;position:relative}.mMNkkW_trigger{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary);font:inherit;cursor:pointer;white-space:nowrap;border-radius:999px;padding:.35rem .6rem;font-size:.8rem;line-height:1}.mMNkkW_trigger:hover{color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-border-l2)}.mMNkkW_panel{z-index:20;border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-overlay);width:18rem;color:var(--dsw-alias-label-primary);border-radius:.6rem;flex-direction:column;gap:.6rem;padding:.75rem .85rem;display:flex;position:absolute;bottom:calc(100% + .5rem);right:0;box-shadow:0 8px 24px #0000002e}.mMNkkW_window{flex-direction:column;gap:.25rem;display:flex}.mMNkkW_row{justify-content:space-between;gap:.5rem;font-size:.85rem;display:flex}.mMNkkW_hint{color:var(--dsw-alias-label-secondary);margin:0;font-size:.75rem}.mMNkkW_progress{width:100%;height:.35rem;accent-color:var(--dsw-alias-brand-primary)}.mMNkkW_limited{color:var(--dsw-alias-state-warn-primary);font-size:.75rem}.mMNkkW_warning{border:1px solid var(--dsw-alias-state-warn-primary);color:var(--dsw-alias-label-primary);border-radius:.4rem;padding:.4rem .5rem;font-size:.75rem}.mMNkkW_retry{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);font:inherit;cursor:pointer;border-radius:.35rem;align-self:flex-start;padding:.25rem .5rem;font-size:.75rem}.mMNkkW_local{border-top:1px solid var(--dsw-alias-border-l1);flex-direction:column;gap:.2rem;padding-top:.5rem;display:flex}";
964
964
  document.head.appendChild(style);
965
965
  }
966
- var pill_default = { "hint": "mMNkkW_hint", "warning": "mMNkkW_warning", "trigger": "mMNkkW_trigger", "row": "mMNkkW_row", "retry": "mMNkkW_retry", "root": "mMNkkW_root", "panel": "mMNkkW_panel", "local": "mMNkkW_local", "window": "mMNkkW_window", "limited": "mMNkkW_limited", "progress": "mMNkkW_progress" };
966
+ var pill_default = { "trigger": "mMNkkW_trigger", "limited": "mMNkkW_limited", "progress": "mMNkkW_progress", "warning": "mMNkkW_warning", "retry": "mMNkkW_retry", "window": "mMNkkW_window", "local": "mMNkkW_local", "panel": "mMNkkW_panel", "hint": "mMNkkW_hint", "row": "mMNkkW_row", "root": "mMNkkW_root" };
967
967
 
968
968
  // src/client/UsagePill.tsx
969
969
  var import_jsx_runtime2 = require("react/jsx-runtime");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dan-ai-studio/dshopencodego",
3
- "version": "0.1.18",
3
+ "version": "0.1.20",
4
4
  "description": "OpenCode Go provider for DeepSeek Harness: live gateway catalog, per-conversation session header, usage",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -59,7 +59,6 @@
59
59
  "test": "vitest run",
60
60
  "test:coverage": "vitest run --coverage",
61
61
  "test:watch": "vitest",
62
- "postinstall": "node scripts/patch-pi-ai.mjs",
63
62
  "prepare": "npm run build",
64
63
  "prepack": "npm run build"
65
64
  },