@dptech-corp/bohr-cli 2.7.0 → 2.7.2
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/CHANGELOG.md +22 -0
- package/package.json +7 -7
- package/run.js +54 -14
package/CHANGELOG.md
CHANGED
|
@@ -22,6 +22,28 @@
|
|
|
22
22
|
|
|
23
23
|
## [Unreleased]
|
|
24
24
|
|
|
25
|
+
## [2.7.2] - 2026-09-20
|
|
26
|
+
|
|
27
|
+
### Breaking
|
|
28
|
+
|
|
29
|
+
- **参数值错误统一分类**:支付来源、批量作业支付类型、结构检索参数值不合法时,`COMMAND_FAILED` 改为 `VALIDATION_FAILED`;调用方按新码修改参数。
|
|
30
|
+
- **交付物空列表统一为数组**:`agents artifacts list` 无结果时由 `artifacts: null` 改为 `artifacts: []`(含 `--all-files`);调用方按数组长度判空。
|
|
31
|
+
|
|
32
|
+
### Fixed
|
|
33
|
+
|
|
34
|
+
- **停止批量作业的确认等待遵守时限**:`batchjob kill --confirm-timeout` 也约束挂住的状态查询;到期报告已受理但未确认,提前取消则明确提示确认中断。
|
|
35
|
+
|
|
36
|
+
## [2.7.1] - 2026-09-19
|
|
37
|
+
|
|
38
|
+
### Changed
|
|
39
|
+
|
|
40
|
+
- **中断后的退出码**:自行处理中断的命令(如 structure search 下载)被 Ctrl-C 后返回自身的退出码,不再是 130;未处理中断的命令不变。
|
|
41
|
+
|
|
42
|
+
### Fixed
|
|
43
|
+
|
|
44
|
+
- **只停启动器也能停下 CLI**:`timeout`、Agent 框架超时只给 `bohr` 进程发信号时,CLI 不再成为孤儿继续运行、占着输出,而是照常处理中断后退出。
|
|
45
|
+
- **结构下载被挂断时不留临时文件**:关掉终端或收到 SIGHUP 时,`structure search --download` 同样清理临时文件并报下载已取消。
|
|
46
|
+
|
|
25
47
|
## [2.7.0] - 2026-09-18
|
|
26
48
|
|
|
27
49
|
### Breaking
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dptech-corp/bohr-cli",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.2",
|
|
4
4
|
"description": "CLI tool for Bohrium scientific computing platform",
|
|
5
5
|
"bin": {
|
|
6
6
|
"bohr": "run.js"
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
"CHANGELOG.md"
|
|
33
33
|
],
|
|
34
34
|
"optionalDependencies": {
|
|
35
|
-
"@dptech-corp/bohr-cli-darwin-arm64": "2.7.
|
|
36
|
-
"@dptech-corp/bohr-cli-darwin-amd64": "2.7.
|
|
37
|
-
"@dptech-corp/bohr-cli-linux-amd64": "2.7.
|
|
38
|
-
"@dptech-corp/bohr-cli-linux-arm64": "2.7.
|
|
39
|
-
"@dptech-corp/bohr-cli-windows-amd64": "2.7.
|
|
40
|
-
"@dptech-corp/bohr-cli-windows-arm64": "2.7.
|
|
35
|
+
"@dptech-corp/bohr-cli-darwin-arm64": "2.7.2",
|
|
36
|
+
"@dptech-corp/bohr-cli-darwin-amd64": "2.7.2",
|
|
37
|
+
"@dptech-corp/bohr-cli-linux-amd64": "2.7.2",
|
|
38
|
+
"@dptech-corp/bohr-cli-linux-arm64": "2.7.2",
|
|
39
|
+
"@dptech-corp/bohr-cli-windows-amd64": "2.7.2",
|
|
40
|
+
"@dptech-corp/bohr-cli-windows-arm64": "2.7.2"
|
|
41
41
|
}
|
|
42
42
|
}
|
package/run.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const {
|
|
2
|
+
const { spawn } = require("child_process");
|
|
3
3
|
const path = require("path");
|
|
4
4
|
const os = require("os");
|
|
5
5
|
|
|
@@ -66,18 +66,58 @@ try {
|
|
|
66
66
|
);
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
69
|
+
// Signals sent to this launcher must reach the binary. A caller that stops bohr
|
|
70
|
+
// by pid — `timeout`, Python's Popen.terminate(), an agent framework's step
|
|
71
|
+
// timeout — only ever signals this process. It used to run the binary with
|
|
72
|
+
// execFileSync, which blocks the event loop, so node took the default action and
|
|
73
|
+
// died on the spot while the binary kept running as an orphan, still holding the
|
|
74
|
+
// caller's stdout. The caller then waited on a pipe nothing would close.
|
|
75
|
+
//
|
|
76
|
+
// A terminal Ctrl-C reaches both processes (same process group), so the binary
|
|
77
|
+
// sees SIGINT twice. That is the usual trade-off of a forwarding launcher
|
|
78
|
+
// (internal/toolproxy/exec.go makes the same one): a command without a SIGINT
|
|
79
|
+
// handler is already gone when the copy arrives, and a command with one keeps
|
|
80
|
+
// catching until it has written its envelope, so the copy is absorbed.
|
|
81
|
+
//
|
|
82
|
+
// Windows is left alone. Console Ctrl-C already reaches every process on the
|
|
83
|
+
// console, and child.kill() there is TerminateProcess, which would cut off the
|
|
84
|
+
// binary's own cancellation handling. Listening is still worth it: node then
|
|
85
|
+
// waits for the binary instead of exiting first and handing the prompt back
|
|
86
|
+
// while it is still writing.
|
|
87
|
+
const FORWARDED_SIGNALS = ["SIGINT", "SIGTERM", "SIGHUP"];
|
|
88
|
+
const forward = platform !== "win32";
|
|
89
|
+
|
|
90
|
+
const child = spawn(binaryPath, process.argv.slice(2), { stdio: "inherit" });
|
|
91
|
+
|
|
92
|
+
const listeners = new Map();
|
|
93
|
+
for (const signal of FORWARDED_SIGNALS) {
|
|
94
|
+
const listener = () => {
|
|
95
|
+
if (forward) child.kill(signal);
|
|
96
|
+
};
|
|
97
|
+
listeners.set(signal, listener);
|
|
98
|
+
process.on(signal, listener);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
child.on("error", () => {
|
|
102
|
+
// Only a spawn failure (missing binary, no exec bit) ends up here with no
|
|
103
|
+
// pid; execFileSync reported those as a bare exit 1 and so does this. A
|
|
104
|
+
// failed kill also emits "error", but the binary is still running then and
|
|
105
|
+
// "exit" will follow.
|
|
106
|
+
if (child.pid === undefined) process.exit(1);
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
child.on("exit", (code, signal) => {
|
|
110
|
+
// Exit codes are how the billing gate (10) and every other envelope code
|
|
111
|
+
// reach the caller, so they pass through untouched.
|
|
112
|
+
if (typeof code === "number") process.exit(code);
|
|
113
|
+
for (const [name, listener] of listeners) process.removeListener(name, listener);
|
|
114
|
+
if (signal) {
|
|
115
|
+
// Die of the same signal instead of exiting 128+n: a shell script only
|
|
116
|
+
// stops at a Ctrl-C when the process it waited on was killed by SIGINT; an
|
|
117
|
+
// ordinary exit 130 means "handled it", and the script carries on. The
|
|
118
|
+
// exit after it is only the fallback for a signal that does not end us.
|
|
119
|
+
process.kill(process.pid, signal);
|
|
120
|
+
process.exit(128 + (os.constants.signals[signal] || 0));
|
|
81
121
|
}
|
|
82
122
|
process.exit(1);
|
|
83
|
-
}
|
|
123
|
+
});
|