@chrysb/alphaclaw 0.8.9 → 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chrysb/alphaclaw",
3
- "version": "0.8.9",
3
+ "version": "0.8.10",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -27,7 +27,6 @@
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",
31
30
  "test": "vitest run",
32
31
  "test:watch": "vitest",
33
32
  "test:watchdog": "vitest run tests/server/watchdog.test.js tests/server/watchdog-db.test.js tests/server/routes-watchdog.test.js",
@@ -1,180 +0,0 @@
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
- };