@chrysb/alphaclaw 0.9.28 → 0.9.30

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/README.md +1 -1
  2. package/bin/alphaclaw.js +34 -0
  3. package/lib/node-runtime.js +38 -0
  4. package/lib/public/dist/app.bundle.js +1027 -1020
  5. package/lib/public/js/components/gateway.js +7 -2
  6. package/lib/public/js/components/models-tab/model-picker.js +5 -2
  7. package/lib/public/js/components/models-tab/use-models.js +4 -1
  8. package/lib/public/js/components/nodes-tab/setup-wizard/index.js +3 -1
  9. package/lib/public/js/components/onboarding/welcome-config.js +6 -2
  10. package/lib/public/js/components/onboarding/welcome-setup-step.js +58 -4
  11. package/lib/public/js/components/welcome/use-welcome.js +18 -8
  12. package/lib/public/js/lib/api.js +5 -0
  13. package/lib/public/js/lib/model-config.js +77 -8
  14. package/lib/public/js/lib/thinking-levels.js +1 -0
  15. package/lib/server/agents/shared.js +2 -0
  16. package/lib/server/auth-profiles.js +8 -1
  17. package/lib/server/codex-runtime-config.js +51 -0
  18. package/lib/server/constants.js +18 -0
  19. package/lib/server/cost-utils.js +18 -0
  20. package/lib/server/helpers.js +18 -2
  21. package/lib/server/model-catalog-cache.js +2 -2
  22. package/lib/server/onboarding/index.js +11 -0
  23. package/lib/server/onboarding/openclaw.js +4 -0
  24. package/lib/server/onboarding/validation.js +17 -3
  25. package/lib/server/openclaw-codex-migration.js +61 -17
  26. package/lib/server/openclaw-thinking.js +33 -27
  27. package/lib/server/openclaw-version.js +7 -0
  28. package/lib/server/plugin-config.js +22 -0
  29. package/lib/server/routes/models.js +4 -0
  30. package/lib/server/routes/onboarding.js +33 -0
  31. package/lib/server/usage-tracker-config.js +3 -21
  32. package/lib/server/watchdog.js +43 -0
  33. package/package.json +3 -3
package/README.md CHANGED
@@ -219,7 +219,7 @@ npm run test:watch # Watch mode
219
219
  npm run test:coverage # Coverage report
220
220
  ```
221
221
 
222
- **Requirements:** Node.js ≥ 22.14.0
222
+ **Requirements:** Node.js ≥ 22.22.3 on Node 22, ≥ 24.15.0 on Node 24, or ≥ 25.9.0
223
223
 
224
224
  ## Official Website
225
225
 
package/bin/alphaclaw.js CHANGED
@@ -26,6 +26,7 @@ const {
26
26
  const {
27
27
  migrateManagedInternalFiles,
28
28
  } = require("../lib/server/internal-files-migration");
29
+ const { assertSupportedNodeVersion } = require("../lib/node-runtime");
29
30
 
30
31
  const kUsageTrackerPluginPath = path.resolve(
31
32
  __dirname,
@@ -137,6 +138,15 @@ Examples:
137
138
  process.exit(0);
138
139
  }
139
140
 
141
+ if (command === "start") {
142
+ try {
143
+ assertSupportedNodeVersion();
144
+ } catch (error) {
145
+ console.error(`[alphaclaw] ${error.message}`);
146
+ process.exit(1);
147
+ }
148
+ }
149
+
140
150
  const quoteArg = (value) => `'${String(value || "").replace(/'/g, "'\"'\"'")}'`;
141
151
  const resolveGithubRepoPath = (value) =>
142
152
  String(value || "")
@@ -792,6 +802,30 @@ if (fs.existsSync(path.join(openclawDir, ".git"))) {
792
802
  }
793
803
  }
794
804
 
805
+ // Persist config-shape migrations before any OpenClaw import or CLI command.
806
+ // Newer OpenClaw releases validate config eagerly and cannot repair a shape
807
+ // that prevents the CLI from starting.
808
+ if (fs.existsSync(configPath)) {
809
+ try {
810
+ const cfg = JSON.parse(fs.readFileSync(configPath, "utf8"));
811
+ if (migrateLegacyTelegramStreamingConfig(cfg)) {
812
+ let content = `${JSON.stringify(cfg, null, 2)}\n`;
813
+ for (const [secret, envRef] of buildSecretReplacements(process.env)) {
814
+ if (!secret) continue;
815
+ content = content
816
+ .split(JSON.stringify(secret))
817
+ .join(JSON.stringify(envRef));
818
+ }
819
+ fs.writeFileSync(configPath, content, "utf8");
820
+ console.log("[alphaclaw] Migrated legacy Telegram streaming config");
821
+ }
822
+ } catch (error) {
823
+ console.error(
824
+ `[alphaclaw] Preflight config migration failed: ${error.message}`,
825
+ );
826
+ }
827
+ }
828
+
795
829
  if (fs.existsSync(configPath)) {
796
830
  try {
797
831
  execFileSync(process.execPath, [
@@ -0,0 +1,38 @@
1
+ const parseNodeVersion = (value = process.versions.node) => {
2
+ const match = String(value || "").trim().match(/^(\d+)\.(\d+)\.(\d+)/);
3
+ if (!match) return null;
4
+ return match.slice(1).map((part) => Number.parseInt(part, 10));
5
+ };
6
+
7
+ const isAtLeast = (version, minimum) => {
8
+ for (let index = 0; index < minimum.length; index += 1) {
9
+ if (version[index] > minimum[index]) return true;
10
+ if (version[index] < minimum[index]) return false;
11
+ }
12
+ return true;
13
+ };
14
+
15
+ const isSupportedNodeVersion = (value = process.versions.node) => {
16
+ const version = parseNodeVersion(value);
17
+ if (!version) return false;
18
+ const [major] = version;
19
+ if (major === 22) return isAtLeast(version, [22, 22, 3]);
20
+ if (major === 24) return isAtLeast(version, [24, 15, 0]);
21
+ if (major === 25) return isAtLeast(version, [25, 9, 0]);
22
+ return major >= 26;
23
+ };
24
+
25
+ const getUnsupportedNodeMessage = (value = process.versions.node) =>
26
+ `Node.js ${value} is not supported. AlphaClaw requires Node.js >=22.22.3 <23, >=24.15.0 <25, or >=25.9.0.`;
27
+
28
+ const assertSupportedNodeVersion = (value = process.versions.node) => {
29
+ if (isSupportedNodeVersion(value)) return;
30
+ throw new Error(getUnsupportedNodeMessage(value));
31
+ };
32
+
33
+ module.exports = {
34
+ assertSupportedNodeVersion,
35
+ getUnsupportedNodeMessage,
36
+ isSupportedNodeVersion,
37
+ parseNodeVersion,
38
+ };