@chrysb/alphaclaw 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.
@@ -15,78 +15,15 @@ const kGroupLabels = {
15
15
  const kGroupOrder = ["github", "channels", "tools", "custom"];
16
16
 
17
17
  const kHintByKey = {
18
- ANTHROPIC_API_KEY: html`From{" "}
19
- <a
20
- href="https://console.anthropic.com"
21
- target="_blank"
22
- class="text-blue-400 hover:underline"
23
- >console.anthropic.com</a
24
- >`,
25
- ANTHROPIC_TOKEN: html`From{" "}
26
- <code class="text-xs bg-black/30 px-1 rounded">claude setup-token</code>`,
27
- OPENAI_API_KEY: html`From{" "}
28
- <a
29
- href="https://platform.openai.com"
30
- target="_blank"
31
- class="text-blue-400 hover:underline"
32
- >platform.openai.com</a
33
- >`,
34
- GEMINI_API_KEY: html`From{" "}
35
- <a
36
- href="https://aistudio.google.com"
37
- target="_blank"
38
- class="text-blue-400 hover:underline"
39
- >aistudio.google.com</a
40
- >`,
41
- GITHUB_TOKEN: html`Use a <strong>classic PAT</strong> with{" "}
42
- <code class="text-xs bg-black/30 px-1 rounded">repo</code> scope from
43
- <a
44
- href="https://github.com/settings/tokens"
45
- target="_blank"
46
- class="text-blue-400 hover:underline"
47
- >github.com/settings/tokens</a
48
- >.`,
49
- GITHUB_WORKSPACE_REPO: html`Use{" "}
50
- <code class="text-xs bg-black/30 px-1 rounded">owner/repo</code> or
51
- <code class="text-xs bg-black/30 px-1 rounded"
52
- >https://github.com/owner/repo</code
53
- >`,
54
- TELEGRAM_BOT_TOKEN: html`From{" "}
55
- <a
56
- href="https://t.me/BotFather"
57
- target="_blank"
58
- class="text-blue-400 hover:underline"
59
- >@BotFather</a
60
- >
61
- ·
62
- <a
63
- href="https://docs.openclaw.ai/channels/telegram"
64
- target="_blank"
65
- class="text-blue-400 hover:underline"
66
- >full guide</a
67
- >`,
68
- DISCORD_BOT_TOKEN: html`From{" "}
69
- <a
70
- href="https://discord.com/developers/applications"
71
- target="_blank"
72
- class="text-blue-400 hover:underline"
73
- >Developer Portal</a
74
- >
75
- ·
76
- <a
77
- href="https://docs.openclaw.ai/channels/discord"
78
- target="_blank"
79
- class="text-blue-400 hover:underline"
80
- >full guide</a
81
- >`,
82
- BRAVE_API_KEY: html`From{" "}
83
- <a
84
- href="https://brave.com/search/api/"
85
- target="_blank"
86
- class="text-blue-400 hover:underline"
87
- >brave.com/search/api</a
88
- >
89
- — free tier available`,
18
+ ANTHROPIC_API_KEY: html`From <a href="https://console.anthropic.com" target="_blank" class="text-blue-400 hover:underline">console.anthropic.com</a>`,
19
+ ANTHROPIC_TOKEN: html`From <code class="text-xs bg-black/30 px-1 rounded">claude setup-token</code>`,
20
+ OPENAI_API_KEY: html`From <a href="https://platform.openai.com" target="_blank" class="text-blue-400 hover:underline">platform.openai.com</a>`,
21
+ GEMINI_API_KEY: html`From <a href="https://aistudio.google.com" target="_blank" class="text-blue-400 hover:underline">aistudio.google.com</a>`,
22
+ GITHUB_TOKEN: html`Use a <strong>classic PAT</strong> with <code class="text-xs bg-black/30 px-1 rounded">repo</code> scope from <a href="https://github.com/settings/tokens" target="_blank" class="text-blue-400 hover:underline">github.com/settings/tokens</a>.`,
23
+ GITHUB_WORKSPACE_REPO: html`Use <code class="text-xs bg-black/30 px-1 rounded">owner/repo</code> or <code class="text-xs bg-black/30 px-1 rounded">https://github.com/owner/repo</code>`,
24
+ TELEGRAM_BOT_TOKEN: html`From <a href="https://t.me/BotFather" target="_blank" class="text-blue-400 hover:underline">@BotFather</a> · <a href="https://docs.openclaw.ai/channels/telegram" target="_blank" class="text-blue-400 hover:underline">full guide</a>`,
25
+ DISCORD_BOT_TOKEN: html`From <a href="https://discord.com/developers/applications" target="_blank" class="text-blue-400 hover:underline">Developer Portal</a> · <a href="https://docs.openclaw.ai/channels/discord" target="_blank" class="text-blue-400 hover:underline">full guide</a>`,
26
+ BRAVE_API_KEY: html`From <a href="https://brave.com/search/api/" target="_blank" class="text-blue-400 hover:underline">brave.com/search/api</a> — free tier available`,
90
27
  };
91
28
 
92
29
  const getHintContent = (envVar) => kHintByKey[envVar.key] || envVar.hint || "";
@@ -130,13 +130,30 @@ const createAlphaclawVersionService = () => {
130
130
  );
131
131
  });
132
132
 
133
+ const isContainer = () =>
134
+ process.env.RAILWAY_ENVIRONMENT ||
135
+ process.env.RENDER ||
136
+ process.env.FLY_APP_NAME ||
137
+ fs.existsSync("/.dockerenv");
138
+
133
139
  const restartProcess = () => {
134
- console.log("[alphaclaw] Restarting process (exit 1 to trigger container restart)...");
135
- // Exit with code 1 so container orchestrators (Railway, Docker restart policy)
136
- // treat it as a crash and automatically restart the service.
137
- // The spawned-child approach doesn't work in containers because killing PID 1
138
- // tears down the entire container.
139
- process.exit(1);
140
+ if (isContainer()) {
141
+ // In containers, exit with code 1 so the orchestrator (Railway, Docker
142
+ // restart policy, etc.) treats it as a crash and restarts the service.
143
+ // Spawning a child doesn't work because killing PID 1 tears down the
144
+ // entire container along with any children.
145
+ console.log("[alphaclaw] Restarting via container crash (exit 1)...");
146
+ process.exit(1);
147
+ }
148
+ // On bare metal / Mac / Linux, spawn a replacement process then exit.
149
+ console.log("[alphaclaw] Spawning new process and exiting...");
150
+ const { spawn } = require("child_process");
151
+ const child = spawn(process.argv[0], process.argv.slice(1), {
152
+ detached: true,
153
+ stdio: "inherit",
154
+ });
155
+ child.unref();
156
+ process.exit(0);
140
157
  };
141
158
 
142
159
  const getVersionStatus = async (refresh) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chrysb/alphaclaw",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },