dsh-context-domains 0.3.1 → 0.3.3

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
@@ -1,3 +1,5 @@
1
+ <img src="https://raw.githubusercontent.com/guicaiyue/dsh-context-domains/main/assets/icon-180.png" width="72" align="left" hspace="12" vspace="4" alt="dsh-context-domains">
2
+
1
3
  # dsh-context-domains
2
4
 
3
5
  [![verify](https://github.com/guicaiyue/dsh-context-domains/actions/workflows/verify.yml/badge.svg)](https://github.com/guicaiyue/dsh-context-domains/actions/workflows/verify.yml)
@@ -12,6 +14,8 @@
12
14
  悬停展开成员(技能/工具两段,名字用顿号连起来)。新会话与对话是同一个位置。
13
15
  - **设置 → 上下文领域**:领域清单 + 成员名单(按技能/工具两段、只有名字 + 复选框),另有建域建议。
14
16
 
17
+ ![会话顶部的领域条:绿点=已加载、灰点=未加载,点一下整块开关](https://raw.githubusercontent.com/guicaiyue/dsh-context-domains/main/assets/shot-session.png)
18
+
15
19
  ---
16
20
 
17
21
  ## 效果
@@ -20,15 +24,15 @@
20
24
 
21
25
  **新会话页**:领域条在顶部,点芯片即可在开会话前定好这次的上下文。
22
26
 
23
- ![新会话页:顶部领域条](assets/shot-new-session.png)
27
+ ![新会话页:领域条在顶部,点芯片即可定好这次的上下文](https://raw.githubusercontent.com/guicaiyue/dsh-context-domains/main/assets/shot-new-session.png)
24
28
 
25
29
  **混装领域的成员**:一个领域里同时有技能和工具,悬停列出名字。
26
30
 
27
- ![混合领域展开:技能 3 项、工具 4 项](assets/shot-domain-members.png)
31
+ ![混装领域展开:技能 3 项、工具 4 项,名字用顿号连起来](https://raw.githubusercontent.com/guicaiyue/dsh-context-domains/main/assets/shot-domain-members.png)
28
32
 
29
33
  **设置页**:左侧领域清单,右侧成员名单(只有名字 + 勾选框)。
30
34
 
31
- ![设置 → 上下文领域](assets/shot-settings.png)
35
+ ![设置 → 上下文领域:左侧领域清单,右侧只用名字 + 勾选框](https://raw.githubusercontent.com/guicaiyue/dsh-context-domains/main/assets/shot-settings.png)
32
36
 
33
37
  ---
34
38
 
package/cordis.patch.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # 上下文领域:把一批 skill / 一批 tool 归纳成一个可整块开关的「领域」。
2
2
  # 一处 Host 行(状态、目录发现、限制施加、HTTP API)+ 一个 Client 半边
3
- # (新会话两个下拉、会话头芯片带、设置页)。
3
+ # (会话顶部一条领域横条 + 设置 → 上下文领域;横条在新会话与对话里是同一个位置)。
4
4
  - insert:
5
5
  - id: context-domains
6
6
  name: dsh-context-domains
package/lib/http.js CHANGED
@@ -3,6 +3,7 @@
3
3
  import { randomUUID } from 'node:crypto'
4
4
  import { domainCounts, requestedMembers, selectionFor, unassigned } from './resolve.js'
5
5
  import { estimateTokens } from './config.js'
6
+ import { VERSION } from './version.js'
6
7
  import { readCatalogAll, readSkills, readTools, suggestDomains } from './catalog.js'
7
8
 
8
9
  const PREFIX = '/context-domains/api'
@@ -180,7 +181,7 @@ export function registerHttp(ctx, deps) {
180
181
  async 'GET /health'(_req, res) {
181
182
  ok(res, {
182
183
  plugin: 'context-domains',
183
- version: '0.1.0',
184
+ version: VERSION,
184
185
  stateFile: store.file,
185
186
  config,
186
187
  domains: store.document().domains.length,
package/lib/version.js ADDED
@@ -0,0 +1,16 @@
1
+ // 插件自报版本:只从 package.json 读,绝不手写常量。
2
+ // 之前 /health 里写死 '0.1.0',发到 0.3.x 之后它仍报 0.1.0,排障时先被骗一次。
3
+ import { readFileSync } from 'node:fs'
4
+ import { fileURLToPath } from 'node:url'
5
+
6
+ function readVersion() {
7
+ try {
8
+ const file = fileURLToPath(new URL('../package.json', import.meta.url))
9
+ const parsed = JSON.parse(readFileSync(file, 'utf8'))
10
+ return typeof parsed.version === 'string' ? parsed.version : '0.0.0'
11
+ } catch {
12
+ return '0.0.0'
13
+ }
14
+ }
15
+
16
+ export const VERSION = readVersion()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-context-domains",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "DSH 上下文领域:把一个领域里的 skill 与 tool 归成一块,在会话顶部一键整块开关,设置页里维护领域成员",
5
5
  "type": "module",
6
6
  "main": "index.js",