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 +7 -3
- package/cordis.patch.yml +1 -1
- package/lib/http.js +2 -1
- package/lib/version.js +16 -0
- package/package.json +1 -1
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
|
[](https://github.com/guicaiyue/dsh-context-domains/actions/workflows/verify.yml)
|
|
@@ -12,6 +14,8 @@
|
|
|
12
14
|
悬停展开成员(技能/工具两段,名字用顿号连起来)。新会话与对话是同一个位置。
|
|
13
15
|
- **设置 → 上下文领域**:领域清单 + 成员名单(按技能/工具两段、只有名字 + 复选框),另有建域建议。
|
|
14
16
|
|
|
17
|
+

|
|
18
|
+
|
|
15
19
|
---
|
|
16
20
|
|
|
17
21
|
## 效果
|
|
@@ -20,15 +24,15 @@
|
|
|
20
24
|
|
|
21
25
|
**新会话页**:领域条在顶部,点芯片即可在开会话前定好这次的上下文。
|
|
22
26
|
|
|
23
|
-

|
|
24
28
|
|
|
25
29
|
**混装领域的成员**:一个领域里同时有技能和工具,悬停列出名字。
|
|
26
30
|
|
|
27
|
-

|
|
28
32
|
|
|
29
33
|
**设置页**:左侧领域清单,右侧成员名单(只有名字 + 勾选框)。
|
|
30
34
|
|
|
31
|
-

|
|
32
36
|
|
|
33
37
|
---
|
|
34
38
|
|
package/cordis.patch.yml
CHANGED
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:
|
|
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()
|