@dsh-bio/dsh-bio-gem 0.1.14 → 0.1.15
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/package.json +3 -3
- package/src/capabilities.js +17 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dsh-bio/dsh-bio-gem",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.15",
|
|
4
4
|
"description": "基因组尺度代谢模型(GEM)构建插件:输入细菌全基因组(蛋白FASTA,支持多质粒/多染色体),自动构建+验证+补洞+出报告(SBML + 模型卡),供 dsh-bio-genie 消费工具加载使用 | Genome-scale metabolic model builder for dsh",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
},
|
|
53
53
|
"scripts": {
|
|
54
54
|
"smoke": "node test/smoke.js",
|
|
55
|
-
"test": "node test/check-version-source.mjs && node test/smoke.js --skip-build && node test/integration.js && node --import ./test/register-dsh-tools.mjs test/optional-injection.js && node --import ./test/register-dsh-tools.mjs test/check-capabilities.mjs && node test/check-counts.mjs",
|
|
56
|
-
"test:full": "node test/smoke.js && node test/integration.js && node --import ./test/register-dsh-tools.mjs test/optional-injection.js && node --import ./test/register-dsh-tools.mjs test/check-capabilities.mjs && node test/check-counts.mjs"
|
|
55
|
+
"test": "node test/check-version-source.mjs && node test/smoke.js --skip-build && node test/integration.js && node test/capabilities.js && node --import ./test/register-dsh-tools.mjs test/optional-injection.js && node --import ./test/register-dsh-tools.mjs test/check-capabilities.mjs && node test/check-counts.mjs && node test/capabilities-warn-state.mjs",
|
|
56
|
+
"test:full": "node test/smoke.js && node test/integration.js && node test/capabilities.js && node --import ./test/register-dsh-tools.mjs test/optional-injection.js && node --import ./test/register-dsh-tools.mjs test/check-capabilities.mjs && node test/check-counts.mjs"
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"@deepseek-ai/dsh-tools": "*"
|
package/src/capabilities.js
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
// cost_class: light (<10s) | medium (10s–2min) | heavy (>2min)
|
|
13
13
|
// network: none | optional | required
|
|
14
14
|
// mutability: read_only | writes_output | model_mutating
|
|
15
|
-
// status: ready | experimental | data-not-initialized (依赖级状态由 integration
|
|
15
|
+
// status: ready | experimental | data-not-initialized (依赖级状态由 integration 动态覆盖为 unavailable / unknown)
|
|
16
16
|
// requires: 动态依赖 id 列表(对齐 integration status 的 check id;缺省即 ready)
|
|
17
17
|
|
|
18
18
|
export const TOOLS_MANIFEST = [
|
|
@@ -124,11 +124,19 @@ export const CONTRACT_VERSION = '1'
|
|
|
124
124
|
export function buildCapabilitiesReport({ pluginVersion, checks = [] } = {}) {
|
|
125
125
|
const checkStatus = new Map(checks.map((c) => [c.id, c.status]))
|
|
126
126
|
const tools = TOOLS_MANIFEST.map((t) => {
|
|
127
|
-
const
|
|
127
|
+
const required = t.requires ?? []
|
|
128
|
+
// 三态与 status 层对齐:missing = 确认缺;warn = 探测未完成或进行中
|
|
129
|
+
// (runtime.gapseq 在 WSL 冷启动期间就是 warn);未出现在 checks = 未观测到。
|
|
130
|
+
// warn 不可归入 missing——否则"还在探测"会被说成"gapseq 不可用"。
|
|
131
|
+
const missingDeps = required.filter((id) => checkStatus.get(id) === 'missing')
|
|
132
|
+
const unprobedDeps = required.filter((id) => {
|
|
128
133
|
const st = checkStatus.get(id)
|
|
129
|
-
return st !== undefined && st !== 'ok'
|
|
134
|
+
return st !== undefined && st !== 'ok' && st !== 'missing'
|
|
130
135
|
})
|
|
131
|
-
const
|
|
136
|
+
const unknownDeps = required.filter((id) => !checkStatus.has(id))
|
|
137
|
+
const effectiveStatus = missingDeps.length > 0 ? 'unavailable'
|
|
138
|
+
: unprobedDeps.length > 0 ? 'unknown'
|
|
139
|
+
: unknownDeps.length > 0 ? 'unknown' : (t.status ?? 'ready')
|
|
132
140
|
return {
|
|
133
141
|
name: t.name,
|
|
134
142
|
capability: t.capability,
|
|
@@ -140,6 +148,11 @@ export function buildCapabilitiesReport({ pluginVersion, checks = [] } = {}) {
|
|
|
140
148
|
summary: t.summary,
|
|
141
149
|
...(t.requires ? { requires: t.requires } : {}),
|
|
142
150
|
...(missingDeps.length > 0 ? { missing_dependencies: missingDeps } : {}),
|
|
151
|
+
// 未观测到(check缺席)与探测未完成(warn)都归入 unknown_dependencies:
|
|
152
|
+
// 两者都无法证明依赖缺失,前端据此提示"待确认"而非"不可用"。
|
|
153
|
+
...(unknownDeps.length + unprobedDeps.length > 0
|
|
154
|
+
? { unknown_dependencies: [...unprobedDeps, ...unknownDeps] }
|
|
155
|
+
: {}),
|
|
143
156
|
}
|
|
144
157
|
})
|
|
145
158
|
return {
|