@chrysb/alphaclaw 0.8.7 → 0.8.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.
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
const fs = require("fs");
|
|
2
|
+
const path = require("path");
|
|
3
|
+
|
|
4
|
+
const kTemplateDefinitions = {
|
|
5
|
+
railway: {
|
|
6
|
+
id: "railway",
|
|
7
|
+
packageName: "openclaw-railway",
|
|
8
|
+
description:
|
|
9
|
+
"OpenClaw on Railway — one-click deploy, powered by @chrysb/alphaclaw",
|
|
10
|
+
includeCompose: false,
|
|
11
|
+
},
|
|
12
|
+
render: {
|
|
13
|
+
id: "render",
|
|
14
|
+
packageName: "openclaw-render",
|
|
15
|
+
description:
|
|
16
|
+
"OpenClaw on Render — one-click deploy, powered by @chrysb/alphaclaw",
|
|
17
|
+
includeCompose: false,
|
|
18
|
+
},
|
|
19
|
+
apex: {
|
|
20
|
+
id: "apex",
|
|
21
|
+
packageName: "openclaw-apex",
|
|
22
|
+
description:
|
|
23
|
+
"OpenClaw on Apex — managed template, powered by @chrysb/alphaclaw",
|
|
24
|
+
includeCompose: true,
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const readJsonFile = (filePath) => JSON.parse(fs.readFileSync(filePath, "utf8"));
|
|
29
|
+
|
|
30
|
+
const normalizeValue = (value) => String(value || "").trim();
|
|
31
|
+
|
|
32
|
+
const createReleaseId = ({ alphaclawVersion, openclawVersion }) =>
|
|
33
|
+
`alphaclaw-${normalizeValue(alphaclawVersion)}_openclaw-${normalizeValue(openclawVersion)}`;
|
|
34
|
+
|
|
35
|
+
const readCurrentReleaseMetadata = ({ repoRoot }) => {
|
|
36
|
+
const packageJson = readJsonFile(path.join(repoRoot, "package.json"));
|
|
37
|
+
const alphaclawVersion = normalizeValue(packageJson.version);
|
|
38
|
+
const openclawVersion = normalizeValue(packageJson.dependencies?.openclaw);
|
|
39
|
+
if (!alphaclawVersion) {
|
|
40
|
+
throw new Error("AlphaClaw package.json is missing version.");
|
|
41
|
+
}
|
|
42
|
+
if (!openclawVersion) {
|
|
43
|
+
throw new Error("AlphaClaw package.json is missing dependencies.openclaw.");
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
alphaclawVersion,
|
|
47
|
+
openclawVersion,
|
|
48
|
+
releaseId: createReleaseId({
|
|
49
|
+
alphaclawVersion,
|
|
50
|
+
openclawVersion,
|
|
51
|
+
}),
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const resolveReleaseMetadata = ({
|
|
56
|
+
repoRoot,
|
|
57
|
+
alphaclawVersion,
|
|
58
|
+
openclawVersion,
|
|
59
|
+
}) => {
|
|
60
|
+
const normalizedAlphaClawVersion = normalizeValue(alphaclawVersion);
|
|
61
|
+
const normalizedOpenClawVersion = normalizeValue(openclawVersion);
|
|
62
|
+
if (!normalizedAlphaClawVersion && !normalizedOpenClawVersion) {
|
|
63
|
+
return readCurrentReleaseMetadata({ repoRoot });
|
|
64
|
+
}
|
|
65
|
+
if (!normalizedAlphaClawVersion || !normalizedOpenClawVersion) {
|
|
66
|
+
throw new Error("alphaclawVersion and openclawVersion overrides must be provided together.");
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
alphaclawVersion: normalizedAlphaClawVersion,
|
|
70
|
+
openclawVersion: normalizedOpenClawVersion,
|
|
71
|
+
releaseId: createReleaseId({
|
|
72
|
+
alphaclawVersion: normalizedAlphaClawVersion,
|
|
73
|
+
openclawVersion: normalizedOpenClawVersion,
|
|
74
|
+
}),
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const getTemplateDefinition = (templateId = "") => {
|
|
79
|
+
const normalizedTemplateId = normalizeValue(templateId).toLowerCase();
|
|
80
|
+
const definition = kTemplateDefinitions[normalizedTemplateId];
|
|
81
|
+
if (!definition) {
|
|
82
|
+
throw new Error(`Unsupported templateId: ${templateId}`);
|
|
83
|
+
}
|
|
84
|
+
return definition;
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const buildManagedBundlePackageJson = ({
|
|
88
|
+
templateId = "apex",
|
|
89
|
+
alphaclawVersion,
|
|
90
|
+
openclawVersion,
|
|
91
|
+
alphaclawPackageSpec = "",
|
|
92
|
+
}) => {
|
|
93
|
+
const definition = getTemplateDefinition(templateId);
|
|
94
|
+
return {
|
|
95
|
+
name: definition.packageName,
|
|
96
|
+
version: "2.0.0",
|
|
97
|
+
private: true,
|
|
98
|
+
description: definition.description,
|
|
99
|
+
scripts: {
|
|
100
|
+
dev: "docker compose up --build",
|
|
101
|
+
"dev:stop": "docker compose down",
|
|
102
|
+
"dev:clean": "docker compose down -v",
|
|
103
|
+
"dev:logs": "docker compose logs -f",
|
|
104
|
+
"dev:shell": "docker compose exec openclaw bash",
|
|
105
|
+
},
|
|
106
|
+
dependencies: {
|
|
107
|
+
"@chrysb/alphaclaw":
|
|
108
|
+
normalizeValue(alphaclawPackageSpec) || normalizeValue(alphaclawVersion),
|
|
109
|
+
openclaw: normalizeValue(openclawVersion),
|
|
110
|
+
},
|
|
111
|
+
engines: {
|
|
112
|
+
node: ">=22.12.0",
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
const buildManagedBundleDockerfile = ({
|
|
118
|
+
includeVendorDir = false,
|
|
119
|
+
} = {}) => `FROM node:22-slim
|
|
120
|
+
|
|
121
|
+
WORKDIR /app
|
|
122
|
+
|
|
123
|
+
${includeVendorDir ? "COPY vendor/ ./vendor/\n" : ""}COPY package.json package-lock.json ./
|
|
124
|
+
RUN npm ci --omit=dev --no-audit --no-fund && npm cache clean --force
|
|
125
|
+
|
|
126
|
+
ENV PATH="/app/node_modules/.bin:$PATH"
|
|
127
|
+
ENV ALPHACLAW_ROOT_DIR=/data
|
|
128
|
+
|
|
129
|
+
RUN mkdir -p /data
|
|
130
|
+
|
|
131
|
+
EXPOSE 3000
|
|
132
|
+
|
|
133
|
+
CMD ["alphaclaw", "start"]
|
|
134
|
+
`;
|
|
135
|
+
|
|
136
|
+
const buildManagedBundleCompose = () => `services:
|
|
137
|
+
openclaw:
|
|
138
|
+
build: .
|
|
139
|
+
restart: unless-stopped
|
|
140
|
+
env_file:
|
|
141
|
+
- /opt/alphaclaw/shared/.env
|
|
142
|
+
volumes:
|
|
143
|
+
- openclaw-data:/data
|
|
144
|
+
- /opt/alphaclaw/shared/.env:/data/.env
|
|
145
|
+
caddy:
|
|
146
|
+
image: caddy:2
|
|
147
|
+
restart: unless-stopped
|
|
148
|
+
extra_hosts:
|
|
149
|
+
- "host.docker.internal:host-gateway"
|
|
150
|
+
volumes:
|
|
151
|
+
- caddy_data:/data
|
|
152
|
+
- caddy_config:/config
|
|
153
|
+
- /opt/alphaclaw/shared/Caddyfile:/etc/caddy/Caddyfile:ro
|
|
154
|
+
ports:
|
|
155
|
+
- "\${ALPHACLAW_HTTP_PORT:-80}:80"
|
|
156
|
+
- "\${ALPHACLAW_HTTPS_PORT:-443}:443"
|
|
157
|
+
volumes:
|
|
158
|
+
openclaw-data:
|
|
159
|
+
caddy_data:
|
|
160
|
+
caddy_config:
|
|
161
|
+
`;
|
|
162
|
+
|
|
163
|
+
const buildTemplateDependencies = ({
|
|
164
|
+
alphaclawVersion,
|
|
165
|
+
openclawVersion,
|
|
166
|
+
}) => ({
|
|
167
|
+
"@chrysb/alphaclaw": normalizeValue(alphaclawVersion),
|
|
168
|
+
openclaw: normalizeValue(openclawVersion),
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
module.exports = {
|
|
172
|
+
buildManagedBundleCompose,
|
|
173
|
+
buildManagedBundleDockerfile,
|
|
174
|
+
buildManagedBundlePackageJson,
|
|
175
|
+
buildTemplateDependencies,
|
|
176
|
+
createReleaseId,
|
|
177
|
+
getTemplateDefinition,
|
|
178
|
+
readCurrentReleaseMetadata,
|
|
179
|
+
resolveReleaseMetadata,
|
|
180
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chrysb/alphaclaw",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.9",
|
|
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.
|
|
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
|
-
}
|