@chrysb/alphaclaw 0.9.29 → 0.9.31
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.
- package/README.md +1 -1
- package/bin/alphaclaw.js +34 -0
- package/lib/node-runtime.js +38 -0
- package/lib/public/dist/app.bundle.js +795 -793
- package/lib/public/js/components/gateway.js +7 -2
- package/lib/public/js/components/models-tab/model-picker.js +5 -2
- package/lib/public/js/components/models-tab/use-models.js +4 -1
- package/lib/public/js/components/nodes-tab/setup-wizard/index.js +3 -1
- package/lib/public/js/components/welcome/use-welcome.js +4 -1
- package/lib/public/js/lib/model-config.js +49 -2
- package/lib/public/js/lib/thinking-levels.js +1 -0
- package/lib/server/agents/shared.js +2 -0
- package/lib/server/auth-profiles.js +8 -1
- package/lib/server/codex-runtime-config.js +51 -0
- package/lib/server/constants.js +18 -0
- package/lib/server/cost-utils.js +18 -0
- package/lib/server/helpers.js +18 -2
- package/lib/server/init/register-server-routes.js +2 -0
- package/lib/server/model-catalog-cache.js +2 -2
- package/lib/server/onboarding/openclaw.js +4 -0
- package/lib/server/onboarding/validation.js +3 -0
- package/lib/server/openclaw-codex-migration.js +61 -17
- package/lib/server/openclaw-thinking.js +33 -27
- package/lib/server/openclaw-version.js +7 -0
- package/lib/server/plugin-config.js +22 -0
- package/lib/server/routes/models.js +4 -0
- package/lib/server/startup.js +13 -0
- package/lib/server/usage-tracker-config.js +3 -21
- package/lib/server/watchdog.js +43 -0
- package/lib/server/webhooks.js +71 -2
- package/package.json +3 -3
package/README.md
CHANGED
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
|
+
};
|