@pleri/olam-cli 0.1.68 → 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__/audit-publish-deps-contract.test.d.ts +26 -0
- package/dist/__tests__/audit-publish-deps-contract.test.d.ts.map +1 -0
- package/dist/__tests__/audit-publish-deps-contract.test.js +86 -0
- package/dist/__tests__/audit-publish-deps-contract.test.js.map +1 -0
- 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 +5 -5
- 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/listening-server-poller.mjs +141 -0
- package/host-cp/src/port-bridge-manager.mjs +290 -0
- package/host-cp/src/server.mjs +48 -94
- package/host-cp/src/version-status.mjs +36 -0
- package/package.json +4 -2
|
@@ -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
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pleri/olam-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.70",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"olam": "./bin/olam.cjs"
|
|
@@ -28,12 +28,14 @@
|
|
|
28
28
|
"build": "tsc",
|
|
29
29
|
"dev": "tsx src/index.ts",
|
|
30
30
|
"test": "vitest run --passWithNoTests",
|
|
31
|
-
"test:ci": "vitest run --reporter=basic --passWithNoTests"
|
|
31
|
+
"test:ci": "vitest run --reporter=basic --passWithNoTests",
|
|
32
|
+
"audit:publish-deps": "node scripts/audit-publish-deps.mjs"
|
|
32
33
|
},
|
|
33
34
|
"dependencies": {
|
|
34
35
|
"better-sqlite3": "^12.0.0",
|
|
35
36
|
"commander": "^13.0.0",
|
|
36
37
|
"dockerode": "^4.0.0",
|
|
38
|
+
"json-source-map": "^0.6.1",
|
|
37
39
|
"ora": "^8.0.0",
|
|
38
40
|
"picocolors": "^1.1.0",
|
|
39
41
|
"ssh2": "^1.16.0",
|