@csdwd/ai-teams-agent 0.3.2 → 0.3.4
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/dist/index.js +21 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1045,7 +1045,6 @@ function connect(state, getMainTask, getQueueTask, onMessage) {
|
|
|
1045
1045
|
}
|
|
1046
1046
|
|
|
1047
1047
|
// src/index.ts
|
|
1048
|
-
var PKG_VERSION = "0.2.0";
|
|
1049
1048
|
var mainTask = null;
|
|
1050
1049
|
var queueTask = null;
|
|
1051
1050
|
var agentState = loadState();
|
|
@@ -1255,7 +1254,7 @@ if (isCli) {
|
|
|
1255
1254
|
getArgValue2 = getArgValue, resolveWorkspace3 = resolveWorkspace2, resolveAgentDir2 = resolveAgentDir, resolvePidFile2 = resolvePidFile, resolveLogDir2 = resolveLogDir, applyCliArgsToEnv2 = applyCliArgsToEnv;
|
|
1256
1255
|
const args = process.argv.slice(2);
|
|
1257
1256
|
if (args.includes("--version") || args.includes("-v")) {
|
|
1258
|
-
console.log(
|
|
1257
|
+
console.log("0.3.4");
|
|
1259
1258
|
process.exit(0);
|
|
1260
1259
|
}
|
|
1261
1260
|
if (args.includes("--help") || args.includes("-h")) {
|
|
@@ -1298,6 +1297,12 @@ if (isCli) {
|
|
|
1298
1297
|
if (status.running) {
|
|
1299
1298
|
void stopDaemon(pidFile);
|
|
1300
1299
|
}
|
|
1300
|
+
} else if (!process.env.__AI_TEAMS_DAEMON_WATCHDOG && !process.env.__AI_TEAMS_DAEMON_WORKER) {
|
|
1301
|
+
const status = getDaemonStatus(resolvePidFile());
|
|
1302
|
+
if (status.running) {
|
|
1303
|
+
console.log(`Already running (PID ${status.pid}).`);
|
|
1304
|
+
process.exit(0);
|
|
1305
|
+
}
|
|
1301
1306
|
}
|
|
1302
1307
|
applyCliArgsToEnv();
|
|
1303
1308
|
const fileConfig2 = loadConfigFile();
|
|
@@ -1327,6 +1332,20 @@ if (isCli) {
|
|
|
1327
1332
|
} else {
|
|
1328
1333
|
console.log("ai-teams-agent is not running.");
|
|
1329
1334
|
}
|
|
1335
|
+
} else if (subcommand === "update") {
|
|
1336
|
+
const { execSync } = await import("node:child_process");
|
|
1337
|
+
try {
|
|
1338
|
+
execSync("npm install -g @csdwd/ai-teams-agent@latest", { stdio: "inherit" });
|
|
1339
|
+
const ver = execSync("ai-teams-agent --version").toString().trim();
|
|
1340
|
+
console.log(`
|
|
1341
|
+
\u2713 \u5DF2\u66F4\u65B0\u5230 ${ver}`);
|
|
1342
|
+
const status = getDaemonStatus(resolvePidFile());
|
|
1343
|
+
if (status.running) {
|
|
1344
|
+
console.log(" \u63D0\u793A: \u8FD0\u884C ai-teams-agent restart \u4EE5\u5E94\u7528\u66F4\u65B0\u3002");
|
|
1345
|
+
}
|
|
1346
|
+
} catch {
|
|
1347
|
+
process.exit(1);
|
|
1348
|
+
}
|
|
1330
1349
|
} else {
|
|
1331
1350
|
void (async () => {
|
|
1332
1351
|
const fileConfig2 = loadConfigFile();
|