@chrysb/alphaclaw 0.8.7 → 0.8.8

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 (33) hide show
  1. package/bin/alphaclaw.js +174 -43
  2. package/lib/public/css/tailwind.generated.css +1 -1
  3. package/lib/public/dist/app.bundle.js +2109 -2089
  4. package/lib/public/js/app.js +3 -0
  5. package/lib/public/js/components/gateway.js +6 -3
  6. package/lib/public/js/components/general/index.js +2 -0
  7. package/lib/public/js/components/onboarding/welcome-form-step.js +29 -4
  8. package/lib/public/js/components/routes/general-route.js +2 -0
  9. package/lib/public/js/components/routes/watchdog-route.js +2 -0
  10. package/lib/public/js/components/sidebar.js +20 -7
  11. package/lib/public/js/components/update-modal-helpers.js +12 -0
  12. package/lib/public/js/components/update-modal.js +2 -1
  13. package/lib/public/js/components/watchdog-tab/index.js +2 -0
  14. package/lib/public/js/components/welcome/index.js +1 -0
  15. package/lib/public/js/components/welcome/use-welcome.js +52 -2
  16. package/lib/public/js/hooks/use-app-shell-controller.js +37 -9
  17. package/lib/public/js/lib/api.js +36 -0
  18. package/lib/release/managed-release.js +180 -0
  19. package/lib/server/alphaclaw-runtime.js +294 -0
  20. package/lib/server/alphaclaw-version.js +37 -128
  21. package/lib/server/gateway.js +32 -14
  22. package/lib/server/init/register-server-routes.js +7 -1
  23. package/lib/server/openclaw-runtime.js +428 -0
  24. package/lib/server/openclaw-version.js +76 -136
  25. package/lib/server/package-fingerprint.js +274 -0
  26. package/lib/server/pending-alphaclaw-update.js +85 -0
  27. package/lib/server/pending-openclaw-update.js +86 -0
  28. package/lib/server/routes/pages.js +9 -1
  29. package/lib/server/routes/system.js +6 -1
  30. package/lib/server/usage-tracker-config.js +27 -3
  31. package/package.json +3 -2
  32. package/patches/openclaw+2026.4.9.patch +13 -0
  33. package/patches/openclaw+2026.4.5.patch +0 -13
@@ -1,11 +1,19 @@
1
1
  const path = require("path");
2
2
 
3
- const registerPageRoutes = ({ app, requireAuth, isGatewayRunning }) => {
3
+ const registerPageRoutes = ({
4
+ app,
5
+ requireAuth,
6
+ isGatewayRunning,
7
+ alphaclawVersionService,
8
+ openclawVersionService,
9
+ }) => {
4
10
  app.get("/health", async (req, res) => {
5
11
  const running = await isGatewayRunning();
6
12
  res.json({
7
13
  status: running ? "healthy" : "starting",
8
14
  gateway: running ? "running" : "starting",
15
+ alphaclawVersion: alphaclawVersionService?.readAlphaclawVersion?.() || null,
16
+ openclawVersion: openclawVersionService?.readOpenclawVersion?.() || null,
9
17
  });
10
18
  });
11
19
 
@@ -588,7 +588,12 @@ const registerSystemRoutes = ({
588
588
  console.log(
589
589
  `[alphaclaw] /api/openclaw/update result: status=${result.status} ok=${result.body?.ok === true}`,
590
590
  );
591
- res.status(result.status).json(result.body);
591
+ if (result.status === 200 && result.body?.ok && result.body?.restarting) {
592
+ res.json(result.body);
593
+ setTimeout(() => alphaclawVersionService.restartProcess(), 1000);
594
+ } else {
595
+ res.status(result.status).json(result.body);
596
+ }
592
597
  });
593
598
 
594
599
  app.get("/api/alphaclaw/version", async (req, res) => {
@@ -8,6 +8,27 @@ const kUsageTrackerPluginPath = path.resolve(
8
8
  "usage-tracker",
9
9
  );
10
10
 
11
+ const normalizePluginPath = (value = "") =>
12
+ String(value || "")
13
+ .trim()
14
+ .replace(/\\/g, "/")
15
+ .replace(/\/+$/, "");
16
+
17
+ const isUsageTrackerPluginPath = (value = "") => {
18
+ const normalizedValue = normalizePluginPath(value);
19
+ const normalizedCanonicalPath = normalizePluginPath(kUsageTrackerPluginPath);
20
+ if (!normalizedValue) return false;
21
+ if (
22
+ normalizedValue === normalizedCanonicalPath ||
23
+ normalizedValue.startsWith(`${normalizedCanonicalPath}/`)
24
+ ) {
25
+ return true;
26
+ }
27
+ return /(?:^|\/)(?:node_modules\/@chrysb\/alphaclaw\/lib|lib)\/plugin\/usage-tracker(?:\/.*)?$/.test(
28
+ normalizedValue,
29
+ );
30
+ };
31
+
11
32
  const ensurePluginsShell = (cfg = {}) => {
12
33
  if (!cfg.plugins || typeof cfg.plugins !== "object") cfg.plugins = {};
13
34
  if (!Array.isArray(cfg.plugins.allow)) cfg.plugins.allow = [];
@@ -32,9 +53,11 @@ const ensurePluginAllowed = ({ cfg = {}, pluginKey = "" }) => {
32
53
  const ensureUsageTrackerPluginEntry = (cfg = {}) => {
33
54
  const before = JSON.stringify(cfg);
34
55
  ensurePluginAllowed({ cfg, pluginKey: "usage-tracker" });
35
- if (!cfg.plugins.load.paths.includes(kUsageTrackerPluginPath)) {
36
- cfg.plugins.load.paths.push(kUsageTrackerPluginPath);
37
- }
56
+ const nextPaths = cfg.plugins.load.paths.filter(
57
+ (entry) => !isUsageTrackerPluginPath(entry),
58
+ );
59
+ nextPaths.push(kUsageTrackerPluginPath);
60
+ cfg.plugins.load.paths = nextPaths;
38
61
  cfg.plugins.entries["usage-tracker"] = {
39
62
  ...(cfg.plugins.entries["usage-tracker"] &&
40
63
  typeof cfg.plugins.entries["usage-tracker"] === "object"
@@ -64,6 +87,7 @@ const ensureUsageTrackerPluginConfig = ({ fsModule, openclawDir }) => {
64
87
 
65
88
  module.exports = {
66
89
  kUsageTrackerPluginPath,
90
+ isUsageTrackerPluginPath,
67
91
  ensurePluginsShell,
68
92
  ensurePluginAllowed,
69
93
  ensureUsageTrackerPluginEntry,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chrysb/alphaclaw",
3
- "version": "0.8.7",
3
+ "version": "0.8.8",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -27,6 +27,7 @@
27
27
  "start": "node bin/alphaclaw.js start",
28
28
  "build:ui": "node scripts/build-ui.mjs",
29
29
  "postinstall": "node ./scripts/apply-openclaw-patches.js",
30
+ "release:managed": "node scripts/release-managed.mjs",
30
31
  "test": "vitest run",
31
32
  "test:watch": "vitest",
32
33
  "test:watchdog": "vitest run tests/server/watchdog.test.js tests/server/watchdog-db.test.js tests/server/routes-watchdog.test.js",
@@ -36,7 +37,7 @@
36
37
  "dependencies": {
37
38
  "express": "^4.21.0",
38
39
  "http-proxy": "^1.18.1",
39
- "openclaw": "2026.4.5",
40
+ "openclaw": "2026.4.9",
40
41
  "patch-package": "^8.0.1",
41
42
  "ws": "^8.19.0"
42
43
  },
@@ -0,0 +1,13 @@
1
+ diff --git a/node_modules/openclaw/dist/server.impl-BxLfE9ri.js b/node_modules/openclaw/dist/server.impl-BxLfE9ri.js
2
+ index e97a5374..4cd08799 100644
3
+ --- a/node_modules/openclaw/dist/server.impl-BxLfE9ri.js
4
+ +++ b/node_modules/openclaw/dist/server.impl-BxLfE9ri.js
5
+ @@ -28254,7 +28254,7 @@ function attachGatewayWsMessageHandler(params) {
6
+ close(1008, truncateCloseReason(authMessage));
7
+ };
8
+ const clearUnboundScopes = () => {
9
+ - if (scopes.length > 0) {
10
+ + if (scopes.length > 0 && !sharedAuthOk) {
11
+ scopes = [];
12
+ connectParams.scopes = scopes;
13
+ }
@@ -1,13 +0,0 @@
1
- diff --git a/node_modules/openclaw/dist/server-Cv5hzFG4.js b/node_modules/openclaw/dist/server-Cv5hzFG4.js
2
- index 926102f391c94b0e8bb52c2d322c107636e267f3..9e04644fcb8cc406d9b50f2590c5e12788cb7b6e 100644
3
- --- a/node_modules/openclaw/dist/server-Cv5hzFG4.js
4
- +++ b/node_modules/openclaw/dist/server-Cv5hzFG4.js
5
- @@ -26710,7 +26710,7 @@
6
- close(1008, truncateCloseReason(authMessage));
7
- };
8
- const clearUnboundScopes = () => {
9
- - if (scopes.length > 0) {
10
- + if (scopes.length > 0 && !sharedAuthOk) {
11
- scopes = [];
12
- connectParams.scopes = scopes;
13
- }