@yoooclaw/cli 0.8.2 → 0.9.0-beta.1

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.
@@ -58,6 +58,15 @@ function run(args) {
58
58
  }
59
59
  }
60
60
 
61
+ function tryRun(args) {
62
+ const result = spawnSync(bin, args, {
63
+ stdio: "inherit",
64
+ env: process.env,
65
+ windowsHide: true,
66
+ });
67
+ return !result.error && result.status === 0;
68
+ }
69
+
61
70
  if (activationRequested) {
62
71
  const args = ["owner", "activate", "cli", "--format", "json"];
63
72
  if (process.env.HERMES_PROFILE) {
@@ -66,7 +75,14 @@ if (activationRequested) {
66
75
  run(args);
67
76
  } else {
68
77
  for (const profile of runningProfiles) {
69
- run(["--profile", profile, "daemon", "start", "--format", "json"]);
78
+ if (
79
+ !tryRun(["--profile", profile, "daemon", "autostart", "enable", "--format", "json"])
80
+ ) {
81
+ process.stderr.write(
82
+ `@yoooclaw/cli: autostart unavailable; restoring detached daemon for ${profile}\n`,
83
+ );
84
+ run(["--profile", profile, "daemon", "start", "--format", "json"]);
85
+ }
70
86
  }
71
87
  }
72
88
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@yoooclaw/cli",
3
3
  "description": "yoooclaw 独立 CLI(Go 实现,按平台分发原生二进制)",
4
- "version": "0.8.2",
4
+ "version": "0.9.0-beta.1",
5
5
  "license": "MIT",
6
6
  "author": "developer@yoooclaw.com",
7
7
  "repository": {
@@ -26,11 +26,11 @@
26
26
  "postinstall": "node bin/activate-owner.js"
27
27
  },
28
28
  "optionalDependencies": {
29
- "@yoooclaw/cli-darwin-arm64": "0.8.2",
30
- "@yoooclaw/cli-darwin-x64": "0.8.2",
31
- "@yoooclaw/cli-linux-arm64": "0.8.2",
32
- "@yoooclaw/cli-linux-x64": "0.8.2",
33
- "@yoooclaw/cli-win32-x64": "0.8.2"
29
+ "@yoooclaw/cli-darwin-arm64": "0.9.0-beta.1",
30
+ "@yoooclaw/cli-darwin-x64": "0.9.0-beta.1",
31
+ "@yoooclaw/cli-linux-arm64": "0.9.0-beta.1",
32
+ "@yoooclaw/cli-linux-x64": "0.9.0-beta.1",
33
+ "@yoooclaw/cli-win32-x64": "0.9.0-beta.1"
34
34
  },
35
35
  "engines": {
36
36
  "node": ">=18"