@pleri/olam-cli 0.1.69 → 0.1.70
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/dist/__tests__/host-cp-gh-token.test.js +18 -8
- package/dist/__tests__/host-cp-gh-token.test.js.map +1 -1
- package/dist/__tests__/host-cp.test.js +13 -5
- package/dist/__tests__/host-cp.test.js.map +1 -1
- package/dist/cli-version.d.ts +16 -0
- package/dist/cli-version.d.ts.map +1 -0
- package/dist/cli-version.js +39 -0
- package/dist/cli-version.js.map +1 -0
- package/dist/commands/host-cp.d.ts.map +1 -1
- package/dist/commands/host-cp.js +10 -0
- package/dist/commands/host-cp.js.map +1 -1
- package/dist/image-digests.json +3 -3
- package/dist/index.js +609 -596
- package/dist/index.js.map +1 -1
- package/dist/mcp-server.js +301 -164
- package/host-cp/compose.yaml +6 -0
- package/host-cp/src/version-status.mjs +36 -0
- package/package.json +1 -1
package/host-cp/compose.yaml
CHANGED
|
@@ -85,6 +85,12 @@ services:
|
|
|
85
85
|
# which surfaces in the dashboard as a failed Connect Claude flow.
|
|
86
86
|
OLAM_AUTH_SERVICE_URL: "http://host.docker.internal:9999"
|
|
87
87
|
OLAM_AUTH_SECRET: "${OLAM_AUTH_SECRET:-}"
|
|
88
|
+
# Operator's CLI version, propagated by `olam host-cp start` via
|
|
89
|
+
# buildComposeEnv. Surfaces in /api/version/status so the
|
|
90
|
+
# dashboard's TopNav can render "the version we're working on."
|
|
91
|
+
# Empty when older CLI versions render this compose; the server
|
|
92
|
+
# falls back to host-cp's own package.json.
|
|
93
|
+
OLAM_CLI_VERSION: "${OLAM_CLI_VERSION:-}"
|
|
88
94
|
# Upgrade-trigger feature: host-cp uses these to construct bind
|
|
89
95
|
# mounts on the spawned upgrader container. The upgrader runs
|
|
90
96
|
# `olam upgrade -y` and needs (a) the operator's ~/.olam state,
|
|
@@ -24,6 +24,7 @@ import path from 'node:path';
|
|
|
24
24
|
* @property {ComponentVersion} devbox
|
|
25
25
|
* @property {string} operatorHead - resolved HEAD or 'unknown'
|
|
26
26
|
* @property {string} checkedAt - ISO timestamp
|
|
27
|
+
* @property {string} cliVersion - operator's CLI semver (e.g. "0.1.69") or 'unknown'
|
|
27
28
|
*/
|
|
28
29
|
|
|
29
30
|
/**
|
|
@@ -187,6 +188,14 @@ export async function buildVersionSnapshot({ authServiceUrl, dockerApiBase }) {
|
|
|
187
188
|
|
|
188
189
|
const hostCpRunning = process.env.OLAM_BUILD_SHA ?? 'unknown';
|
|
189
190
|
|
|
191
|
+
// CLI version is propagated by `olam host-cp start` via the
|
|
192
|
+
// OLAM_CLI_VERSION env (see packages/cli/src/commands/host-cp.ts
|
|
193
|
+
// buildComposeEnv). Falls back to host-cp's own package.json when
|
|
194
|
+
// an older CLI started this container without setting the env.
|
|
195
|
+
const cliVersion = process.env.OLAM_CLI_VERSION
|
|
196
|
+
|| readHostCpPackageVersion()
|
|
197
|
+
|| 'unknown';
|
|
198
|
+
|
|
190
199
|
return {
|
|
191
200
|
hostCp: {
|
|
192
201
|
running: hostCpRunning,
|
|
@@ -205,5 +214,32 @@ export async function buildVersionSnapshot({ authServiceUrl, dockerApiBase }) {
|
|
|
205
214
|
},
|
|
206
215
|
operatorHead,
|
|
207
216
|
checkedAt: new Date().toISOString(),
|
|
217
|
+
cliVersion,
|
|
208
218
|
};
|
|
209
219
|
}
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Read host-cp's bundled package.json version as the CLI-version
|
|
223
|
+
* fallback when OLAM_CLI_VERSION isn't propagated. The container
|
|
224
|
+
* Dockerfile copies the manifest into /app, so the lookup walks up
|
|
225
|
+
* from this module's location.
|
|
226
|
+
*
|
|
227
|
+
* @returns {string | null}
|
|
228
|
+
*/
|
|
229
|
+
function readHostCpPackageVersion() {
|
|
230
|
+
try {
|
|
231
|
+
const here = path.dirname(new URL(import.meta.url).pathname);
|
|
232
|
+
for (const candidate of [
|
|
233
|
+
path.join(here, '..', 'package.json'),
|
|
234
|
+
path.join(here, '..', '..', 'package.json'),
|
|
235
|
+
]) {
|
|
236
|
+
if (fs.existsSync(candidate)) {
|
|
237
|
+
const pkg = JSON.parse(fs.readFileSync(candidate, 'utf-8'));
|
|
238
|
+
if (typeof pkg.version === 'string' && pkg.version.length > 0) return pkg.version;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
} catch {
|
|
242
|
+
// best-effort
|
|
243
|
+
}
|
|
244
|
+
return null;
|
|
245
|
+
}
|