dsh-workspace-api-key 0.2.9 → 0.2.10

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.md CHANGED
@@ -78,7 +78,7 @@ The command forwards its arguments to pnpm inside the profile directory, so the
78
78
  pnpm add dsh-workspace-api-key # or: npm install dsh-workspace-api-key
79
79
  ```
80
80
 
81
- Pin a version with `dsh-workspace-api-key@0.2.9`, or install straight from the repository with `dsh-workspace-api-key@github:COH2357/dsh-workspace-api-key` (a git-hosted plugin is built from source on install).
81
+ Pin a version with `dsh-workspace-api-key@0.2.10`, or install straight from the repository with `dsh-workspace-api-key@github:COH2357/dsh-workspace-api-key` (a git-hosted plugin is built from source on install).
82
82
 
83
83
  Then add `"dsh-workspace-api-key"` to `dsh.profile.bundles` in that profile's `package.json` and restart DSH. For local development, use a link instead:
84
84
 
package/README.zh.md CHANGED
@@ -78,7 +78,7 @@ dsh plugin --profile web add dsh-workspace-api-key
78
78
  pnpm add dsh-workspace-api-key # 或者:npm install dsh-workspace-api-key
79
79
  ```
80
80
 
81
- 锁版本用 `dsh-workspace-api-key@0.2.9`;直接从仓库装则用 `dsh-workspace-api-key@github:COH2357/dsh-workspace-api-key`(git 来源的插件会在安装时现场构建)。
81
+ 锁版本用 `dsh-workspace-api-key@0.2.10`;直接从仓库装则用 `dsh-workspace-api-key@github:COH2357/dsh-workspace-api-key`(git 来源的插件会在安装时现场构建)。
82
82
 
83
83
  然后把 `"dsh-workspace-api-key"` 加进该 profile `package.json` 的 `dsh.profile.bundles`,重启 DSH。本地开发用 link 代替:
84
84
 
package/lib/index.js CHANGED
@@ -697,13 +697,23 @@ function readWebSettings(ctx) {
697
697
  } catch {
698
698
  settings = undefined
699
699
  }
700
- const read = (ns) => {
701
- try {
702
- const value = settings?.get?.(ns)
703
- return typeof value === 'object' && value !== null ? value : {}
704
- } catch {
705
- return {}
700
+ // settings 服务的真实形状是 describe() 返回「按 profile 条目 id 键控」的行(每行带 ns 与活值),
701
+ // 没有 get(ns):早期版本曾按 get 读取,结果永远拿到 undefined,搜索面板会整个消失。
702
+ let rows = []
703
+ try {
704
+ if (typeof settings?.describe === 'function') {
705
+ rows = settings.describe() ?? []
706
+ } else if (typeof settings?.get === 'function') {
707
+ rows = [SEARCH_API_NS, LEGACY_SEARCH_NS, WEB_NS]
708
+ .map((ns) => ({ ns, value: settings.get(ns) }))
709
+ .filter((row) => row.value !== undefined)
706
710
  }
711
+ } catch {
712
+ rows = []
713
+ }
714
+ const read = (ns) => {
715
+ const value = rows.find((row) => row?.ns === ns)?.value
716
+ return typeof value === 'object' && value !== null ? value : {}
707
717
  }
708
718
  const api = read(SEARCH_API_NS)
709
719
  const legacy = read(LEGACY_SEARCH_NS)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-workspace-api-key",
3
- "version": "0.2.9",
3
+ "version": "0.2.10",
4
4
  "description": "A DeepSeek Harness plugin that binds a separate DeepSeek API key to each workspace, or to a single session, so the spend of one key stays with the sessions you choose.",
5
5
  "type": "module",
6
6
  "license": "MIT",