@chrysb/alphaclaw 0.8.8 → 0.8.10

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 (31) hide show
  1. package/bin/alphaclaw.js +43 -174
  2. package/lib/public/css/tailwind.generated.css +1 -1
  3. package/lib/public/dist/app.bundle.js +2089 -2109
  4. package/lib/public/js/app.js +0 -3
  5. package/lib/public/js/components/gateway.js +3 -6
  6. package/lib/public/js/components/general/index.js +0 -2
  7. package/lib/public/js/components/onboarding/welcome-form-step.js +4 -29
  8. package/lib/public/js/components/routes/general-route.js +0 -2
  9. package/lib/public/js/components/routes/watchdog-route.js +0 -2
  10. package/lib/public/js/components/sidebar.js +7 -20
  11. package/lib/public/js/components/update-modal.js +1 -2
  12. package/lib/public/js/components/watchdog-tab/index.js +0 -2
  13. package/lib/public/js/components/welcome/index.js +0 -1
  14. package/lib/public/js/components/welcome/use-welcome.js +2 -52
  15. package/lib/public/js/hooks/use-app-shell-controller.js +9 -37
  16. package/lib/public/js/lib/api.js +0 -36
  17. package/lib/server/alphaclaw-version.js +128 -37
  18. package/lib/server/gateway.js +14 -32
  19. package/lib/server/init/register-server-routes.js +1 -7
  20. package/lib/server/openclaw-version.js +136 -76
  21. package/lib/server/routes/pages.js +1 -9
  22. package/lib/server/routes/system.js +1 -6
  23. package/lib/server/usage-tracker-config.js +3 -27
  24. package/package.json +1 -2
  25. package/lib/public/js/components/update-modal-helpers.js +0 -12
  26. package/lib/release/managed-release.js +0 -180
  27. package/lib/server/alphaclaw-runtime.js +0 -294
  28. package/lib/server/openclaw-runtime.js +0 -428
  29. package/lib/server/package-fingerprint.js +0 -274
  30. package/lib/server/pending-alphaclaw-update.js +0 -85
  31. package/lib/server/pending-openclaw-update.js +0 -86
@@ -1,85 +0,0 @@
1
- const path = require("path");
2
-
3
- const {
4
- installManagedAlphaclawRuntime,
5
- } = require("./alphaclaw-runtime");
6
-
7
- const buildPendingAlphaclawInstallSpec = (marker = {}) => {
8
- const explicitSpec = String(marker?.spec || "").trim();
9
- if (explicitSpec) {
10
- return explicitSpec;
11
- }
12
- const targetVersion = String(marker?.to || "").trim() || "latest";
13
- return `@chrysb/alphaclaw@${targetVersion}`;
14
- };
15
-
16
- const applyPendingAlphaclawUpdate = ({
17
- execSyncImpl,
18
- fsModule,
19
- installDir,
20
- logger = console,
21
- markerPath,
22
- }) => {
23
- if (!fsModule.existsSync(markerPath)) {
24
- return {
25
- attempted: false,
26
- installed: false,
27
- spec: "",
28
- };
29
- }
30
-
31
- let marker = {};
32
- try {
33
- marker = JSON.parse(fsModule.readFileSync(markerPath, "utf8"));
34
- } catch {
35
- marker = {};
36
- }
37
-
38
- const spec = buildPendingAlphaclawInstallSpec(marker);
39
- logger.log(`[alphaclaw] Pending update detected, installing ${spec}...`);
40
-
41
- const resolvedInstallDir = path.resolve(String(installDir || ""));
42
- const installParentDir = path.dirname(resolvedInstallDir);
43
- const tempInstallDir = fsModule.mkdtempSync(
44
- path.join(installParentDir, `${path.basename(resolvedInstallDir)}-pending-`),
45
- );
46
-
47
- try {
48
- installManagedAlphaclawRuntime({
49
- execSyncImpl,
50
- fsModule,
51
- runtimeDir: tempInstallDir,
52
- spec,
53
- });
54
- try {
55
- fsModule.rmSync(resolvedInstallDir, { recursive: true, force: true });
56
- } catch {}
57
- fsModule.renameSync(tempInstallDir, resolvedInstallDir);
58
- fsModule.unlinkSync(markerPath);
59
- logger.log("[alphaclaw] Update applied successfully");
60
- return {
61
- attempted: true,
62
- installed: true,
63
- spec,
64
- };
65
- } catch (error) {
66
- logger.log(`[alphaclaw] Update install failed: ${error.message}`);
67
- try {
68
- fsModule.rmSync(tempInstallDir, { recursive: true, force: true });
69
- } catch {}
70
- try {
71
- fsModule.unlinkSync(markerPath);
72
- } catch {}
73
- return {
74
- attempted: true,
75
- installed: false,
76
- spec,
77
- error,
78
- };
79
- }
80
- };
81
-
82
- module.exports = {
83
- applyPendingAlphaclawUpdate,
84
- buildPendingAlphaclawInstallSpec,
85
- };
@@ -1,86 +0,0 @@
1
- const path = require("path");
2
-
3
- const {
4
- installManagedOpenclawRuntime,
5
- } = require("./openclaw-runtime");
6
-
7
- const buildPendingOpenclawInstallSpec = (marker = {}) => {
8
- const explicitSpec = String(marker?.spec || "").trim();
9
- if (explicitSpec) {
10
- return explicitSpec;
11
- }
12
- const targetVersion = String(marker?.to || "").trim() || "latest";
13
- return `openclaw@${targetVersion}`;
14
- };
15
-
16
- const applyPendingOpenclawUpdate = ({
17
- execSyncImpl,
18
- fsModule,
19
- installDir,
20
- logger = console,
21
- markerPath,
22
- }) => {
23
- if (!fsModule.existsSync(markerPath)) {
24
- return {
25
- attempted: false,
26
- installed: false,
27
- spec: "",
28
- };
29
- }
30
-
31
- let marker = {};
32
- try {
33
- marker = JSON.parse(fsModule.readFileSync(markerPath, "utf8"));
34
- } catch {
35
- marker = {};
36
- }
37
-
38
- const spec = buildPendingOpenclawInstallSpec(marker);
39
- logger.log(`[alphaclaw] Pending OpenClaw update detected, installing ${spec}...`);
40
-
41
- const resolvedInstallDir = path.resolve(String(installDir || ""));
42
- const installParentDir = path.dirname(resolvedInstallDir);
43
- const tempInstallDir = fsModule.mkdtempSync(
44
- path.join(installParentDir, `${path.basename(resolvedInstallDir)}-pending-`),
45
- );
46
-
47
- try {
48
- installManagedOpenclawRuntime({
49
- execSyncImpl,
50
- fsModule,
51
- logger,
52
- runtimeDir: tempInstallDir,
53
- spec,
54
- });
55
- try {
56
- fsModule.rmSync(resolvedInstallDir, { recursive: true, force: true });
57
- } catch {}
58
- fsModule.renameSync(tempInstallDir, resolvedInstallDir);
59
- fsModule.unlinkSync(markerPath);
60
- logger.log("[alphaclaw] OpenClaw update applied successfully");
61
- return {
62
- attempted: true,
63
- installed: true,
64
- spec,
65
- };
66
- } catch (error) {
67
- logger.log(`[alphaclaw] OpenClaw update install failed: ${error.message}`);
68
- try {
69
- fsModule.rmSync(tempInstallDir, { recursive: true, force: true });
70
- } catch {}
71
- try {
72
- fsModule.unlinkSync(markerPath);
73
- } catch {}
74
- return {
75
- attempted: true,
76
- installed: false,
77
- spec,
78
- error,
79
- };
80
- }
81
- };
82
-
83
- module.exports = {
84
- applyPendingOpenclawUpdate,
85
- buildPendingOpenclawInstallSpec,
86
- };