@csdwd/ai-teams-agent 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.
Files changed (2) hide show
  1. package/dist/index.js +20 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1298,6 +1298,12 @@ if (isCli) {
1298
1298
  if (status.running) {
1299
1299
  void stopDaemon(pidFile);
1300
1300
  }
1301
+ } else if (!process.env.__AI_TEAMS_DAEMON_WATCHDOG && !process.env.__AI_TEAMS_DAEMON_WORKER) {
1302
+ const status = getDaemonStatus(resolvePidFile());
1303
+ if (status.running) {
1304
+ console.log(`Already running (PID ${status.pid}).`);
1305
+ process.exit(0);
1306
+ }
1301
1307
  }
1302
1308
  applyCliArgsToEnv();
1303
1309
  const fileConfig2 = loadConfigFile();
@@ -1327,6 +1333,20 @@ if (isCli) {
1327
1333
  } else {
1328
1334
  console.log("ai-teams-agent is not running.");
1329
1335
  }
1336
+ } else if (subcommand === "update") {
1337
+ const { execSync } = await import("node:child_process");
1338
+ try {
1339
+ execSync("npm install -g @csdwd/ai-teams-agent@latest", { stdio: "inherit" });
1340
+ const ver = execSync("ai-teams-agent --version").toString().trim();
1341
+ console.log(`
1342
+ \u2713 \u5DF2\u66F4\u65B0\u5230 ${ver}`);
1343
+ const status = getDaemonStatus(resolvePidFile());
1344
+ if (status.running) {
1345
+ console.log(" \u63D0\u793A: \u8FD0\u884C ai-teams-agent restart \u4EE5\u5E94\u7528\u66F4\u65B0\u3002");
1346
+ }
1347
+ } catch {
1348
+ process.exit(1);
1349
+ }
1330
1350
  } else {
1331
1351
  void (async () => {
1332
1352
  const fileConfig2 = loadConfigFile();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@csdwd/ai-teams-agent",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "AI Teams agent — connects to server via WebSocket, spawns Claude CLI to execute tasks",
5
5
  "type": "module",
6
6
  "bin": {