@pleri/olam-cli 0.1.152 → 0.1.157

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 (146) hide show
  1. package/dist/commands/bootstrap.d.ts +2 -1
  2. package/dist/commands/bootstrap.d.ts.map +1 -1
  3. package/dist/commands/bootstrap.js +8 -10
  4. package/dist/commands/bootstrap.js.map +1 -1
  5. package/dist/commands/doctor.d.ts +46 -0
  6. package/dist/commands/doctor.d.ts.map +1 -1
  7. package/dist/commands/doctor.js +146 -8
  8. package/dist/commands/doctor.js.map +1 -1
  9. package/dist/commands/flywheel/check-persona-skeleton.d.ts +7 -0
  10. package/dist/commands/flywheel/check-persona-skeleton.d.ts.map +1 -0
  11. package/dist/commands/flywheel/check-persona-skeleton.js +14 -0
  12. package/dist/commands/flywheel/check-persona-skeleton.js.map +1 -0
  13. package/dist/commands/flywheel/diversity-check.d.ts +7 -0
  14. package/dist/commands/flywheel/diversity-check.d.ts.map +1 -0
  15. package/dist/commands/flywheel/diversity-check.js +14 -0
  16. package/dist/commands/flywheel/diversity-check.js.map +1 -0
  17. package/dist/commands/flywheel/emit-breadcrumb.d.ts +20 -0
  18. package/dist/commands/flywheel/emit-breadcrumb.d.ts.map +1 -0
  19. package/dist/commands/flywheel/emit-breadcrumb.js +137 -0
  20. package/dist/commands/flywheel/emit-breadcrumb.js.map +1 -0
  21. package/dist/commands/flywheel/index.d.ts +27 -0
  22. package/dist/commands/flywheel/index.d.ts.map +1 -0
  23. package/dist/commands/flywheel/index.js +48 -0
  24. package/dist/commands/flywheel/index.js.map +1 -0
  25. package/dist/commands/flywheel/install-shims.d.ts +8 -0
  26. package/dist/commands/flywheel/install-shims.d.ts.map +1 -0
  27. package/dist/commands/flywheel/install-shims.js +15 -0
  28. package/dist/commands/flywheel/install-shims.js.map +1 -0
  29. package/dist/commands/flywheel/k10-measure.d.ts +7 -0
  30. package/dist/commands/flywheel/k10-measure.d.ts.map +1 -0
  31. package/dist/commands/flywheel/k10-measure.js +14 -0
  32. package/dist/commands/flywheel/k10-measure.js.map +1 -0
  33. package/dist/commands/flywheel/k5-score.d.ts +14 -0
  34. package/dist/commands/flywheel/k5-score.d.ts.map +1 -0
  35. package/dist/commands/flywheel/k5-score.js +59 -0
  36. package/dist/commands/flywheel/k5-score.js.map +1 -0
  37. package/dist/commands/flywheel/k5-validate.d.ts +15 -0
  38. package/dist/commands/flywheel/k5-validate.d.ts.map +1 -0
  39. package/dist/commands/flywheel/k5-validate.js +185 -0
  40. package/dist/commands/flywheel/k5-validate.js.map +1 -0
  41. package/dist/commands/flywheel/ping.d.ts +21 -0
  42. package/dist/commands/flywheel/ping.d.ts.map +1 -0
  43. package/dist/commands/flywheel/ping.js +79 -0
  44. package/dist/commands/flywheel/ping.js.map +1 -0
  45. package/dist/commands/flywheel/sanitize-persona-output.d.ts +7 -0
  46. package/dist/commands/flywheel/sanitize-persona-output.d.ts.map +1 -0
  47. package/dist/commands/flywheel/sanitize-persona-output.js +14 -0
  48. package/dist/commands/flywheel/sanitize-persona-output.js.map +1 -0
  49. package/dist/commands/hermes-kg-hook.d.ts +36 -0
  50. package/dist/commands/hermes-kg-hook.d.ts.map +1 -0
  51. package/dist/commands/hermes-kg-hook.js +80 -0
  52. package/dist/commands/hermes-kg-hook.js.map +1 -0
  53. package/dist/commands/hermes.d.ts +46 -0
  54. package/dist/commands/hermes.d.ts.map +1 -0
  55. package/dist/commands/hermes.js +320 -0
  56. package/dist/commands/hermes.js.map +1 -0
  57. package/dist/commands/host-cp.d.ts.map +1 -1
  58. package/dist/commands/host-cp.js +17 -0
  59. package/dist/commands/host-cp.js.map +1 -1
  60. package/dist/commands/kg-install-hook.d.ts +7 -1
  61. package/dist/commands/kg-install-hook.d.ts.map +1 -1
  62. package/dist/commands/kg-install-hook.js +122 -6
  63. package/dist/commands/kg-install-hook.js.map +1 -1
  64. package/dist/commands/memory/_paths.d.ts +13 -3
  65. package/dist/commands/memory/_paths.d.ts.map +1 -1
  66. package/dist/commands/memory/_paths.js +25 -22
  67. package/dist/commands/memory/_paths.js.map +1 -1
  68. package/dist/commands/memory/logs.d.ts +8 -4
  69. package/dist/commands/memory/logs.d.ts.map +1 -1
  70. package/dist/commands/memory/logs.js +18 -13
  71. package/dist/commands/memory/logs.js.map +1 -1
  72. package/dist/commands/memory/mode.d.ts.map +1 -1
  73. package/dist/commands/memory/mode.js +7 -3
  74. package/dist/commands/memory/mode.js.map +1 -1
  75. package/dist/commands/memory/start.d.ts +16 -14
  76. package/dist/commands/memory/start.d.ts.map +1 -1
  77. package/dist/commands/memory/start.js +55 -189
  78. package/dist/commands/memory/start.js.map +1 -1
  79. package/dist/commands/memory/status.d.ts +10 -8
  80. package/dist/commands/memory/status.d.ts.map +1 -1
  81. package/dist/commands/memory/status.js +35 -38
  82. package/dist/commands/memory/status.js.map +1 -1
  83. package/dist/commands/memory/stop.d.ts +5 -4
  84. package/dist/commands/memory/stop.d.ts.map +1 -1
  85. package/dist/commands/memory/stop.js +26 -55
  86. package/dist/commands/memory/stop.js.map +1 -1
  87. package/dist/commands/memory-service-container.d.ts +78 -0
  88. package/dist/commands/memory-service-container.d.ts.map +1 -0
  89. package/dist/commands/memory-service-container.js +187 -0
  90. package/dist/commands/memory-service-container.js.map +1 -0
  91. package/dist/commands/services.d.ts +16 -1
  92. package/dist/commands/services.d.ts.map +1 -1
  93. package/dist/commands/services.js +97 -38
  94. package/dist/commands/services.js.map +1 -1
  95. package/dist/commands/substrate.d.ts +19 -1
  96. package/dist/commands/substrate.d.ts.map +1 -1
  97. package/dist/commands/substrate.js +19 -11
  98. package/dist/commands/substrate.js.map +1 -1
  99. package/dist/commands/upgrade.d.ts.map +1 -1
  100. package/dist/commands/upgrade.js +11 -0
  101. package/dist/commands/upgrade.js.map +1 -1
  102. package/dist/image-digests.json +7 -7
  103. package/dist/index.js +3662 -2044
  104. package/dist/index.js.map +1 -1
  105. package/dist/lib/auth-refresh-kubernetes.d.ts +3 -0
  106. package/dist/lib/auth-refresh-kubernetes.d.ts.map +1 -1
  107. package/dist/lib/auth-refresh-kubernetes.js +6 -17
  108. package/dist/lib/auth-refresh-kubernetes.js.map +1 -1
  109. package/dist/lib/health-probes.d.ts +20 -0
  110. package/dist/lib/health-probes.d.ts.map +1 -1
  111. package/dist/lib/health-probes.js +55 -0
  112. package/dist/lib/health-probes.js.map +1 -1
  113. package/dist/lib/k8s-bootstrap.d.ts +120 -0
  114. package/dist/lib/k8s-bootstrap.d.ts.map +1 -0
  115. package/dist/lib/k8s-bootstrap.js +193 -0
  116. package/dist/lib/k8s-bootstrap.js.map +1 -0
  117. package/dist/lib/k8s-secret-render.d.ts +139 -0
  118. package/dist/lib/k8s-secret-render.d.ts.map +1 -0
  119. package/dist/lib/k8s-secret-render.js +281 -0
  120. package/dist/lib/k8s-secret-render.js.map +1 -0
  121. package/dist/lib/kubectl-context.d.ts +38 -0
  122. package/dist/lib/kubectl-context.d.ts.map +1 -0
  123. package/dist/lib/kubectl-context.js +43 -0
  124. package/dist/lib/kubectl-context.js.map +1 -0
  125. package/dist/lib/memory-host-process-migration.d.ts +56 -0
  126. package/dist/lib/memory-host-process-migration.d.ts.map +1 -0
  127. package/dist/lib/memory-host-process-migration.js +156 -0
  128. package/dist/lib/memory-host-process-migration.js.map +1 -0
  129. package/dist/lib/upgrade-kubernetes.d.ts +42 -0
  130. package/dist/lib/upgrade-kubernetes.d.ts.map +1 -1
  131. package/dist/lib/upgrade-kubernetes.js +258 -24
  132. package/dist/lib/upgrade-kubernetes.js.map +1 -1
  133. package/dist/mcp-server.js +56 -22
  134. package/hermes-bundle/kg-first.sh +100 -0
  135. package/hermes-bundle/version.json +4 -0
  136. package/host-cp/k8s/manifests/50-deployment.yaml +54 -27
  137. package/host-cp/k8s/manifests/auth-service/30-configmap.yaml +5 -0
  138. package/host-cp/k8s/manifests/auth-service/50-deployment.yaml +5 -1
  139. package/host-cp/k8s/manifests/kg-service/30-configmap.yaml +5 -0
  140. package/host-cp/k8s/manifests/kg-service/50-deployment.yaml +5 -1
  141. package/host-cp/k8s/manifests/mcp-auth-service/30-configmap.yaml +4 -0
  142. package/host-cp/k8s/manifests/mcp-auth-service/50-deployment.yaml +5 -1
  143. package/host-cp/k8s/manifests/memory-service/30-configmap.yaml +4 -0
  144. package/host-cp/k8s/manifests/memory-service/50-deployment.yaml +5 -1
  145. package/package.json +3 -4
  146. package/memory-service-bundle/scripts/ensure-iii-engine.mjs +0 -179
@@ -43,6 +43,10 @@ spec:
43
43
  # B9 (round 2 recovery): disable k8s automatic Service env injection.
44
44
  # See packages/host-cp/k8s/manifests/50-deployment.yaml for rationale.
45
45
  enableServiceLinks: false
46
+ # R3-C (Decision R3-#3): imagePullSecrets references the ghcr-pull Secret
47
+ # created by `olam upgrade` step 0.4 when GH_TOKEN is available.
48
+ imagePullSecrets:
49
+ - name: ghcr-pull
46
50
  serviceAccountName: olam-mcp-auth-service
47
51
  securityContext:
48
52
  runAsNonRoot: true
@@ -64,7 +68,7 @@ spec:
64
68
  mountPath: /data
65
69
  containers:
66
70
  - name: olam-mcp-auth-service
67
- image: ghcr.io/pleri/olam-mcp-auth@sha256:e4f5276fd8cce0e95d978e58b692244f8393396a01d971e962f3d0ef8f7d3ebd
71
+ image: ghcr.io/pleri/olam-mcp-auth@sha256:500901539eca6de84cf873929b4fcabbef1e40d725d456f744679ae8c6c843f5
68
72
  imagePullPolicy: IfNotPresent
69
73
  securityContext:
70
74
  runAsNonRoot: true
@@ -18,3 +18,7 @@ data:
18
18
  OLAM_AUTH_SERVICE_URL: "http://olam-auth-service.olam.svc.cluster.local:9999"
19
19
  # Health path exposed at /agentmemory/livez (D15 — do not change).
20
20
  OLAM_MEMORY_HEALTH_PATH: "/agentmemory/livez"
21
+ # R3-B defensive (Decision R3-#2): memory-service Dockerfile already sets
22
+ # AGENTMEMORY_HOST=0.0.0.0 but ConfigMap override is explicit defense against
23
+ # a future image regression reverting to 127.0.0.1.
24
+ AGENTMEMORY_HOST: "0.0.0.0"
@@ -40,6 +40,10 @@ spec:
40
40
  # B9 (round 2 recovery): disable k8s automatic Service env injection.
41
41
  # See packages/host-cp/k8s/manifests/50-deployment.yaml for rationale.
42
42
  enableServiceLinks: false
43
+ # R3-C (Decision R3-#3): imagePullSecrets references the ghcr-pull Secret
44
+ # created by `olam upgrade` step 0.4 when GH_TOKEN is available.
45
+ imagePullSecrets:
46
+ - name: ghcr-pull
43
47
  serviceAccountName: olam-memory-service
44
48
  securityContext:
45
49
  runAsNonRoot: true
@@ -66,7 +70,7 @@ spec:
66
70
  # bootstrap-placeholder comment + run `npm run refresh:manifest-digests`
67
71
  # once ghcr.io/pleri/olam-memory-service has a real published digest.
68
72
  # bootstrap-placeholder: pre-publish; refresh after first release
69
- image: ghcr.io/pleri/olam-memory-service@sha256:cc60aee650f6194795a64e469572a1270308a9852690f5b902c6412d7ae0f58c
73
+ image: ghcr.io/pleri/olam-memory-service@sha256:a77779a50d904e78627fb5b09a685220ea995cc8f0df058efcd85caf5c548d94
70
74
  imagePullPolicy: IfNotPresent
71
75
  securityContext:
72
76
  runAsNonRoot: true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pleri/olam-cli",
3
- "version": "0.1.152",
3
+ "version": "0.1.157",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "olam": "./bin/olam.cjs"
@@ -8,8 +8,8 @@
8
8
  "files": [
9
9
  "bin",
10
10
  "dist",
11
+ "hermes-bundle",
11
12
  "host-cp",
12
- "memory-service-bundle",
13
13
  "plugin",
14
14
  "README.md"
15
15
  ],
@@ -47,7 +47,6 @@
47
47
  "@inquirer/prompts": "^7.0.0",
48
48
  "zod-to-json-schema": "^3.24.0",
49
49
  "playwright-core": "~1.59.0",
50
- "@napi-rs/keyring": "^1.1.6",
51
- "@agentmemory/agentmemory": "0.9.6"
50
+ "@napi-rs/keyring": "^1.1.6"
52
51
  }
53
52
  }
@@ -1,179 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * ensure-iii-engine.mjs — install (or verify) the iii-engine v0.11.2
4
- * binary that the agentmemory CLI depends on.
5
- *
6
- * Why this exists:
7
- * `agentmemory` (npm-installed) launches the iii-engine as a subprocess
8
- * but does NOT bundle the engine binary — it expects a system-installed
9
- * `iii` on PATH. Upstream's documented install path A is a `curl`
10
- * recipe that drops the binary into `~/.local/bin`. We do the
11
- * equivalent into `~/.olam/bin/iii` so the engine lives under olam's
12
- * namespace + never collides with an operator's own iii install
13
- * (OQ9 resolved pass 3).
14
- *
15
- * Pinned to iii v0.11.2 exactly. Upstream agentmemory's
16
- * `docker-compose.yml` documents that v0.11.6+ breaks with
17
- * "EPIPE reconnect loops and empty search after save" — bumping is
18
- * not safe until agentmemory is refactored for the new sandbox-worker
19
- * model.
20
- *
21
- * SHA256 integrity: each tarball is verified against a hash pinned
22
- * in this file before extract. Mismatch → exit 1 (defends against
23
- * github.com/iii-hq/iii release tampering — T9).
24
- *
25
- * Hashes captured 2026-05-12 from `.sha256` sidecars at
26
- * https://github.com/iii-hq/iii/releases/tag/iii%2Fv0.11.2
27
- *
28
- * Plan reference: docs/plans/olam-agent-memory-distributed/phase-a-tasks.md A1
29
- * Research: docs/research/agent-memory-distributed/REPORT.md Q1
30
- */
31
-
32
- import { existsSync, mkdirSync, writeFileSync, unlinkSync, chmodSync, statSync } from 'node:fs';
33
- import { homedir, platform, arch } from 'node:os';
34
- import { join } from 'node:path';
35
- import { createHash } from 'node:crypto';
36
- import { execSync } from 'node:child_process';
37
-
38
- export const III_VERSION = '0.11.2';
39
-
40
- /**
41
- * Map of {process.platform-process.arch} → upstream Rust target triple.
42
- * Only host platforms olam supports for local mode. Cloud-mode containers
43
- * (Phase C Dockerfile) handle linux-only via TARGETARCH ARG separately.
44
- */
45
- export const PLATFORM_ARCH_TO_TRIPLE = Object.freeze({
46
- 'darwin-arm64': 'aarch64-apple-darwin',
47
- 'darwin-x64': 'x86_64-apple-darwin',
48
- 'linux-arm64': 'aarch64-unknown-linux-gnu',
49
- 'linux-x64': 'x86_64-unknown-linux-gnu',
50
- });
51
-
52
- /**
53
- * SHA256 hashes of the upstream iii v0.11.2 release tarballs.
54
- * Captured from `.sha256` sidecars on the iii-hq/iii GitHub release.
55
- * If these ever fail to match after `iii v0.11.2` is published, upstream
56
- * has tampered with the release — refuse to install + open an issue.
57
- */
58
- export const SHA256 = Object.freeze({
59
- 'aarch64-apple-darwin': 'e7834c44fefb2b5343d327102a941419245f7fff447f95373857a04b033fb1bd',
60
- 'x86_64-apple-darwin': '2b67e5f18833c415f4cb16a9e13b0e953555e0ca138682bf24894abe8b80b836',
61
- 'aarch64-unknown-linux-gnu': 'e0d35ee54a6b6c8a46576ab661e1711d11eb4dafeb1be8e1dbd1cc0ccb48b615',
62
- 'x86_64-unknown-linux-gnu': '9c83c47788b4ef4beeb65dd9bf37e94f993770cd3db874464c3ce1cdc92352cd',
63
- });
64
-
65
- export function detectTriple(plat = platform(), cpuArch = arch()) {
66
- const key = `${plat}-${cpuArch}`;
67
- const triple = PLATFORM_ARCH_TO_TRIPLE[key];
68
- if (!triple) {
69
- const supported = Object.keys(PLATFORM_ARCH_TO_TRIPLE).join(', ');
70
- throw new Error(
71
- `Unsupported host platform/arch combo: ${key}. ` +
72
- `iii v${III_VERSION} ships for: ${supported}. ` +
73
- `Run agentmemory directly via 'npx @agentmemory/agentmemory' if your platform is missing.`,
74
- );
75
- }
76
- return triple;
77
- }
78
-
79
- export function urlForTriple(triple) {
80
- return `https://github.com/iii-hq/iii/releases/download/iii/v${III_VERSION}/iii-${triple}.tar.gz`;
81
- }
82
-
83
- /**
84
- * Idempotent install + verify. Returns { ok: true, path, cached } on
85
- * success; throws on failure (caller decides exit code).
86
- *
87
- * deps is for testability:
88
- * - fetch — substitutable in tests (default: global fetch)
89
- * - logStream — process.stderr in prod; a fake in tests
90
- */
91
- export async function ensureIiiEngine({
92
- olamHome = join(homedir(), '.olam'),
93
- triple = detectTriple(),
94
- fetchImpl = globalThis.fetch,
95
- logStream = process.stderr,
96
- } = {}) {
97
- const binDir = join(olamHome, 'bin');
98
- const binPath = join(binDir, 'iii');
99
-
100
- // Cached?
101
- if (existsSync(binPath)) {
102
- try {
103
- const out = execSync(`${binPath} --version`, { encoding: 'utf8', timeout: 5_000 });
104
- if (out.includes(III_VERSION)) {
105
- return { ok: true, path: binPath, cached: true };
106
- }
107
- logStream.write(`iii at ${binPath} reports unexpected version: ${out.trim()}; re-installing\n`);
108
- } catch (err) {
109
- logStream.write(`iii at ${binPath} not executable (${err.message}); re-installing\n`);
110
- }
111
- }
112
-
113
- const expectedSha = SHA256[triple];
114
- if (!expectedSha) {
115
- throw new Error(`No SHA256 pinned for triple ${triple} — update ensure-iii-engine.mjs.`);
116
- }
117
-
118
- const url = urlForTriple(triple);
119
- logStream.write(`Downloading iii v${III_VERSION} (${triple}) from ${url}\n`);
120
-
121
- const response = await fetchImpl(url);
122
- if (!response.ok) {
123
- throw new Error(`Failed to download iii v${III_VERSION} (${triple}): HTTP ${response.status}`);
124
- }
125
-
126
- const buf = Buffer.from(await response.arrayBuffer());
127
- const actualSha = createHash('sha256').update(buf).digest('hex');
128
-
129
- if (actualSha !== expectedSha) {
130
- throw new Error(
131
- `iii v${III_VERSION} tarball SHA256 mismatch for ${triple}:\n` +
132
- ` expected: ${expectedSha}\n` +
133
- ` got: ${actualSha}\n` +
134
- `If this is a legitimate upstream change, update SHA256 in ${import.meta.url} ` +
135
- `and rotate the pin (see plan T9).`,
136
- );
137
- }
138
-
139
- mkdirSync(binDir, { recursive: true });
140
-
141
- // Extract via system tar — saves bundling node-tar
142
- const tarPath = join(binDir, '.iii.tar.gz');
143
- writeFileSync(tarPath, buf);
144
- try {
145
- execSync(`tar -xzf '${tarPath}' -C '${binDir}'`, { stdio: 'pipe' });
146
- } finally {
147
- if (existsSync(tarPath)) unlinkSync(tarPath);
148
- }
149
-
150
- if (!existsSync(binPath)) {
151
- throw new Error(`tar extract succeeded but iii binary not found at ${binPath}`);
152
- }
153
- chmodSync(binPath, 0o755);
154
-
155
- // Smoke
156
- const ver = execSync(`${binPath} --version`, { encoding: 'utf8', timeout: 5_000 });
157
- if (!ver.includes(III_VERSION)) {
158
- throw new Error(`iii binary installed but reports unexpected version: ${ver.trim()}`);
159
- }
160
-
161
- return { ok: true, path: binPath, cached: false };
162
- }
163
-
164
- // CLI entry — `node ensure-iii-engine.mjs`
165
- const isDirect = import.meta.url === `file://${process.argv[1]}` ||
166
- process.argv[1]?.endsWith('/ensure-iii-engine.mjs');
167
- if (isDirect) {
168
- ensureIiiEngine()
169
- .then((r) => {
170
- process.stderr.write(
171
- `iii v${III_VERSION} ready at ${r.path}${r.cached ? ' (cached)' : ''}\n`,
172
- );
173
- process.exit(0);
174
- })
175
- .catch((err) => {
176
- process.stderr.write(`ensure-iii-engine failed: ${err.message}\n`);
177
- process.exit(1);
178
- });
179
- }