@saltpub/xiaojiu-agent-bridge 0.1.7 → 0.1.9
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 +30 -0
- package/README.md +167 -166
- package/dist/cli.js +3618 -2494
- package/dist/launcher.js +23 -0
- package/package.json +3 -2
package/dist/launcher.js
CHANGED
|
@@ -22,6 +22,11 @@ var logFile = join(updateDir, "launcher.log");
|
|
|
22
22
|
var MAX_BOOT_ATTEMPTS = 2;
|
|
23
23
|
var CRASH_BACKOFF_MS = 5e3;
|
|
24
24
|
var BOOT_FAIL_MAX_BACKOFF_MS = 6e4;
|
|
25
|
+
var BOOT_READY_TIMEOUT_MS = 9e4;
|
|
26
|
+
function readBootReadyTimeoutMs(env = process.env) {
|
|
27
|
+
const raw = Number(env.XIAOJIU_BRIDGE_BOOT_TIMEOUT_MS);
|
|
28
|
+
return Number.isSafeInteger(raw) && raw > 0 ? raw : BOOT_READY_TIMEOUT_MS;
|
|
29
|
+
}
|
|
25
30
|
function logline(message) {
|
|
26
31
|
try {
|
|
27
32
|
mkdirSync(updateDir, { recursive: true });
|
|
@@ -123,11 +128,29 @@ async function main() {
|
|
|
123
128
|
[ENV_BOOT_FILE]: bootFile
|
|
124
129
|
}
|
|
125
130
|
});
|
|
131
|
+
const bootReadyTimeoutMs = readBootReadyTimeoutMs();
|
|
132
|
+
const deadline = setTimeout(() => {
|
|
133
|
+
const after2 = readJson(bootFile);
|
|
134
|
+
if (after2?.version === current.version && after2.ready === true) return;
|
|
135
|
+
logline(`child not ready after ${bootReadyTimeoutMs}ms; killing the wedged boot`);
|
|
136
|
+
try {
|
|
137
|
+
child?.kill("SIGTERM");
|
|
138
|
+
} catch {
|
|
139
|
+
}
|
|
140
|
+
setTimeout(() => {
|
|
141
|
+
try {
|
|
142
|
+
child?.kill("SIGKILL");
|
|
143
|
+
} catch {
|
|
144
|
+
}
|
|
145
|
+
}, 5e3).unref();
|
|
146
|
+
}, bootReadyTimeoutMs);
|
|
147
|
+
deadline.unref?.();
|
|
126
148
|
const code = await new Promise((resolve) => {
|
|
127
149
|
child?.on("exit", (exitCode, signal) => {
|
|
128
150
|
resolve(exitCode ?? (signal ? 1 : 0));
|
|
129
151
|
});
|
|
130
152
|
});
|
|
153
|
+
clearTimeout(deadline);
|
|
131
154
|
child = void 0;
|
|
132
155
|
if (quitting) process.exit(0);
|
|
133
156
|
if (code === SWITCH_EXIT_CODE) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@saltpub/xiaojiu-agent-bridge",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "Bridge Xiaojiu IM with local CLI coding agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "pnpm@10.33.0",
|
|
@@ -112,7 +112,8 @@
|
|
|
112
112
|
"schemaVersion": 1,
|
|
113
113
|
"channel": "stable",
|
|
114
114
|
"highlights": [
|
|
115
|
-
"
|
|
115
|
+
"新增 `/btw [问题]` 旁路提问:长任务运行中可向该会话问一句,用会话上下文回答、不执行工具、不写入会话历史,也不会让 btw 会话出现在 `/resume`;claude/codex/pi/omp/opencode 分别走 fork、RPC btw 与 `session.generate` 等价机制。",
|
|
116
|
+
"修复 launcher 模式下守护进程无法停止的问题:`stop`/`kill` 现在会先终止 launcher 监管进程再停止 bot 子进程,避免子进程被立即自动拉起导致停止假成功;`kill <uid>` 与 `stop --profile` 统一为同一套停止逻辑。停止时会同时清理现行 `port-*` 与旧版 profile 命名的系统服务定义。`profile remove` 在持锁进程已退出时自动清理残留锁,锁冲突错误现在带持有者 pid 与启动时间。"
|
|
116
117
|
],
|
|
117
118
|
"breakingChanges": [],
|
|
118
119
|
"securityFix": false,
|