@pleri/olam-cli 0.1.151 → 0.1.153

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.
Files changed (51) hide show
  1. package/dist/commands/doctor.d.ts +53 -2
  2. package/dist/commands/doctor.d.ts.map +1 -1
  3. package/dist/commands/doctor.js +74 -11
  4. package/dist/commands/doctor.js.map +1 -1
  5. package/dist/commands/host-cp.d.ts.map +1 -1
  6. package/dist/commands/host-cp.js +17 -0
  7. package/dist/commands/host-cp.js.map +1 -1
  8. package/dist/commands/services.d.ts.map +1 -1
  9. package/dist/commands/services.js +9 -26
  10. package/dist/commands/services.js.map +1 -1
  11. package/dist/commands/substrate.d.ts +27 -0
  12. package/dist/commands/substrate.d.ts.map +1 -1
  13. package/dist/commands/substrate.js +27 -8
  14. package/dist/commands/substrate.js.map +1 -1
  15. package/dist/commands/upgrade.d.ts.map +1 -1
  16. package/dist/commands/upgrade.js +11 -0
  17. package/dist/commands/upgrade.js.map +1 -1
  18. package/dist/image-digests.json +7 -7
  19. package/dist/index.js +1747 -1293
  20. package/dist/lib/auth-refresh-kubernetes.d.ts +3 -0
  21. package/dist/lib/auth-refresh-kubernetes.d.ts.map +1 -1
  22. package/dist/lib/auth-refresh-kubernetes.js +6 -17
  23. package/dist/lib/auth-refresh-kubernetes.js.map +1 -1
  24. package/dist/lib/health-probes.d.ts +43 -0
  25. package/dist/lib/health-probes.d.ts.map +1 -1
  26. package/dist/lib/health-probes.js +106 -0
  27. package/dist/lib/health-probes.js.map +1 -1
  28. package/dist/lib/k8s-bootstrap.d.ts +120 -0
  29. package/dist/lib/k8s-bootstrap.d.ts.map +1 -0
  30. package/dist/lib/k8s-bootstrap.js +193 -0
  31. package/dist/lib/k8s-bootstrap.js.map +1 -0
  32. package/dist/lib/k8s-secret-render.d.ts +139 -0
  33. package/dist/lib/k8s-secret-render.d.ts.map +1 -0
  34. package/dist/lib/k8s-secret-render.js +281 -0
  35. package/dist/lib/k8s-secret-render.js.map +1 -0
  36. package/dist/lib/kubectl-context.d.ts +38 -0
  37. package/dist/lib/kubectl-context.d.ts.map +1 -0
  38. package/dist/lib/kubectl-context.js +43 -0
  39. package/dist/lib/kubectl-context.js.map +1 -0
  40. package/dist/lib/upgrade-kubernetes.d.ts +24 -1
  41. package/dist/lib/upgrade-kubernetes.d.ts.map +1 -1
  42. package/dist/lib/upgrade-kubernetes.js +90 -38
  43. package/dist/lib/upgrade-kubernetes.js.map +1 -1
  44. package/host-cp/k8s/manifests/50-deployment.yaml +8 -1
  45. package/host-cp/k8s/manifests/auth-service/50-deployment.yaml +4 -1
  46. package/host-cp/k8s/manifests/kg-service/50-deployment.yaml +4 -1
  47. package/host-cp/k8s/manifests/mcp-auth-service/50-deployment.yaml +4 -1
  48. package/host-cp/k8s/manifests/memory-service/50-deployment.yaml +4 -1
  49. package/host-cp/src/docker-events.mjs +19 -4
  50. package/host-cp/src/server.mjs +18 -1
  51. package/package.json +1 -1
@@ -128,6 +128,10 @@ const OLAM_HOME_HOST_PATH = process.env.OLAM_HOME_HOST_PATH ?? '';
128
128
  const OLAM_DOCKER_SOCK_HOST_PATH = process.env.OLAM_DOCKER_SOCK_HOST_PATH ?? '/var/run/docker.sock';
129
129
  // Operator's olam repo path on the host. Bound into the upgrader at /workspace
130
130
  // so the npm-installed CLI can find packages/host-cp/compose.yaml.
131
+ // Issue #713: npm-only operators legitimately omit this mount. When empty,
132
+ // the /api/admin/upgrade endpoint returns 400 not_configured and /api/prs
133
+ // silently returns [] (gh will fail with "not a git repository"). All other
134
+ // endpoints are unaffected — host-cp stays healthy without the repo mount.
131
135
  const OLAM_REPO_HOST_PATH = process.env.OLAM_REPO_HOST_PATH ?? '';
132
136
  // gh config bind for the upgrader so it can `gh auth token | docker login ghcr.io ...`.
133
137
  // Optional — when empty, the upgrader will fail at the docker-login step
@@ -2051,6 +2055,12 @@ const server = http.createServer(async (req, res) => {
2051
2055
  // Wraps `gh pr list` with a 60s in-process TTL cache so repeated
2052
2056
  // palette opens don't hammer the GitHub API.
2053
2057
  if (url.pathname === '/api/prs' && req.method === 'GET') {
2058
+ // Issue #713: npm-only operators don't have an operator repo mount.
2059
+ // Return [] instead of spawning gh (which would fail with "not a git repository").
2060
+ const repoPath = process.env.OLAM_REPO_PATH || OLAM_REPO_HOST_PATH ? (process.env.OLAM_REPO_PATH || '/operator-repo') : null;
2061
+ if (!repoPath) {
2062
+ return jsonReply(res, 200, []);
2063
+ }
2054
2064
  const now = Date.now();
2055
2065
  if (prListCacheEntry && now - prListCacheEntry.fetchedAt < 60_000) {
2056
2066
  return jsonReply(res, 200, prListCacheEntry.data);
@@ -2070,7 +2080,7 @@ const server = http.createServer(async (req, res) => {
2070
2080
  '--json', 'number,title,state,headRefName',
2071
2081
  ], {
2072
2082
  timeout: 10_000,
2073
- cwd: process.env.OLAM_REPO_PATH || '/operator-repo',
2083
+ cwd: repoPath,
2074
2084
  });
2075
2085
  const data = JSON.parse(stdout.trim() || '[]');
2076
2086
  prListCacheEntry = { data, fetchedAt: Date.now() };
@@ -2930,6 +2940,13 @@ server.listen(PORT, '0.0.0.0', () => {
2930
2940
  console.log(` mode=${HOST_CP_MODE} world-host=${HOST_FOR_WORLD}`);
2931
2941
  console.log(` engine=${hostCpEngine.engineName}${hostCpEngine.context ? ` ctx=${hostCpEngine.context}` : ''}`);
2932
2942
  console.log(` (override: OLAM_HOST_CP_MODE=container|bare, OLAM_HOST_FOR_WORLD=<host>)`);
2943
+ // Issue #713: surface npm-only mode at boot so the operator can confirm
2944
+ // graceful degrade in `kubectl logs deploy/olam-host-cp -n olam`.
2945
+ // /api/admin/upgrade and /api/prs are the only features that need the repo
2946
+ // mount; all other endpoints are unaffected.
2947
+ if (!OLAM_REPO_HOST_PATH) {
2948
+ console.log(' [npm-only] OLAM_REPO_HOST_PATH unset — /api/admin/upgrade returns 400 (not_configured); /api/prs returns []. All other endpoints healthy.');
2949
+ }
2933
2950
  // Surface the auth wiring state at boot. An empty OLAM_AUTH_SECRET
2934
2951
  // here is silently fatal for the credential surfaces — the operator
2935
2952
  // would otherwise only see "0 credentials" in the SPA with no hint
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pleri/olam-cli",
3
- "version": "0.1.151",
3
+ "version": "0.1.153",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "olam": "./bin/olam.cjs"