@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.
- package/dist/commands/bootstrap.d.ts +2 -1
- package/dist/commands/bootstrap.d.ts.map +1 -1
- package/dist/commands/bootstrap.js +8 -10
- package/dist/commands/bootstrap.js.map +1 -1
- package/dist/commands/doctor.d.ts +46 -0
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +146 -8
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/flywheel/check-persona-skeleton.d.ts +7 -0
- package/dist/commands/flywheel/check-persona-skeleton.d.ts.map +1 -0
- package/dist/commands/flywheel/check-persona-skeleton.js +14 -0
- package/dist/commands/flywheel/check-persona-skeleton.js.map +1 -0
- package/dist/commands/flywheel/diversity-check.d.ts +7 -0
- package/dist/commands/flywheel/diversity-check.d.ts.map +1 -0
- package/dist/commands/flywheel/diversity-check.js +14 -0
- package/dist/commands/flywheel/diversity-check.js.map +1 -0
- package/dist/commands/flywheel/emit-breadcrumb.d.ts +20 -0
- package/dist/commands/flywheel/emit-breadcrumb.d.ts.map +1 -0
- package/dist/commands/flywheel/emit-breadcrumb.js +137 -0
- package/dist/commands/flywheel/emit-breadcrumb.js.map +1 -0
- package/dist/commands/flywheel/index.d.ts +27 -0
- package/dist/commands/flywheel/index.d.ts.map +1 -0
- package/dist/commands/flywheel/index.js +48 -0
- package/dist/commands/flywheel/index.js.map +1 -0
- package/dist/commands/flywheel/install-shims.d.ts +8 -0
- package/dist/commands/flywheel/install-shims.d.ts.map +1 -0
- package/dist/commands/flywheel/install-shims.js +15 -0
- package/dist/commands/flywheel/install-shims.js.map +1 -0
- package/dist/commands/flywheel/k10-measure.d.ts +7 -0
- package/dist/commands/flywheel/k10-measure.d.ts.map +1 -0
- package/dist/commands/flywheel/k10-measure.js +14 -0
- package/dist/commands/flywheel/k10-measure.js.map +1 -0
- package/dist/commands/flywheel/k5-score.d.ts +14 -0
- package/dist/commands/flywheel/k5-score.d.ts.map +1 -0
- package/dist/commands/flywheel/k5-score.js +59 -0
- package/dist/commands/flywheel/k5-score.js.map +1 -0
- package/dist/commands/flywheel/k5-validate.d.ts +15 -0
- package/dist/commands/flywheel/k5-validate.d.ts.map +1 -0
- package/dist/commands/flywheel/k5-validate.js +185 -0
- package/dist/commands/flywheel/k5-validate.js.map +1 -0
- package/dist/commands/flywheel/ping.d.ts +21 -0
- package/dist/commands/flywheel/ping.d.ts.map +1 -0
- package/dist/commands/flywheel/ping.js +79 -0
- package/dist/commands/flywheel/ping.js.map +1 -0
- package/dist/commands/flywheel/sanitize-persona-output.d.ts +7 -0
- package/dist/commands/flywheel/sanitize-persona-output.d.ts.map +1 -0
- package/dist/commands/flywheel/sanitize-persona-output.js +14 -0
- package/dist/commands/flywheel/sanitize-persona-output.js.map +1 -0
- package/dist/commands/hermes-kg-hook.d.ts +36 -0
- package/dist/commands/hermes-kg-hook.d.ts.map +1 -0
- package/dist/commands/hermes-kg-hook.js +80 -0
- package/dist/commands/hermes-kg-hook.js.map +1 -0
- package/dist/commands/hermes.d.ts +46 -0
- package/dist/commands/hermes.d.ts.map +1 -0
- package/dist/commands/hermes.js +320 -0
- package/dist/commands/hermes.js.map +1 -0
- package/dist/commands/host-cp.d.ts.map +1 -1
- package/dist/commands/host-cp.js +17 -0
- package/dist/commands/host-cp.js.map +1 -1
- package/dist/commands/kg-install-hook.d.ts +7 -1
- package/dist/commands/kg-install-hook.d.ts.map +1 -1
- package/dist/commands/kg-install-hook.js +122 -6
- package/dist/commands/kg-install-hook.js.map +1 -1
- package/dist/commands/memory/_paths.d.ts +13 -3
- package/dist/commands/memory/_paths.d.ts.map +1 -1
- package/dist/commands/memory/_paths.js +25 -22
- package/dist/commands/memory/_paths.js.map +1 -1
- package/dist/commands/memory/logs.d.ts +8 -4
- package/dist/commands/memory/logs.d.ts.map +1 -1
- package/dist/commands/memory/logs.js +18 -13
- package/dist/commands/memory/logs.js.map +1 -1
- package/dist/commands/memory/mode.d.ts.map +1 -1
- package/dist/commands/memory/mode.js +7 -3
- package/dist/commands/memory/mode.js.map +1 -1
- package/dist/commands/memory/start.d.ts +16 -14
- package/dist/commands/memory/start.d.ts.map +1 -1
- package/dist/commands/memory/start.js +55 -189
- package/dist/commands/memory/start.js.map +1 -1
- package/dist/commands/memory/status.d.ts +10 -8
- package/dist/commands/memory/status.d.ts.map +1 -1
- package/dist/commands/memory/status.js +35 -38
- package/dist/commands/memory/status.js.map +1 -1
- package/dist/commands/memory/stop.d.ts +5 -4
- package/dist/commands/memory/stop.d.ts.map +1 -1
- package/dist/commands/memory/stop.js +26 -55
- package/dist/commands/memory/stop.js.map +1 -1
- package/dist/commands/memory-service-container.d.ts +78 -0
- package/dist/commands/memory-service-container.d.ts.map +1 -0
- package/dist/commands/memory-service-container.js +187 -0
- package/dist/commands/memory-service-container.js.map +1 -0
- package/dist/commands/services.d.ts +16 -1
- package/dist/commands/services.d.ts.map +1 -1
- package/dist/commands/services.js +97 -38
- package/dist/commands/services.js.map +1 -1
- package/dist/commands/substrate.d.ts +19 -1
- package/dist/commands/substrate.d.ts.map +1 -1
- package/dist/commands/substrate.js +19 -11
- package/dist/commands/substrate.js.map +1 -1
- package/dist/commands/upgrade.d.ts.map +1 -1
- package/dist/commands/upgrade.js +11 -0
- package/dist/commands/upgrade.js.map +1 -1
- package/dist/image-digests.json +7 -7
- package/dist/index.js +3662 -2044
- package/dist/index.js.map +1 -1
- package/dist/lib/auth-refresh-kubernetes.d.ts +3 -0
- package/dist/lib/auth-refresh-kubernetes.d.ts.map +1 -1
- package/dist/lib/auth-refresh-kubernetes.js +6 -17
- package/dist/lib/auth-refresh-kubernetes.js.map +1 -1
- package/dist/lib/health-probes.d.ts +20 -0
- package/dist/lib/health-probes.d.ts.map +1 -1
- package/dist/lib/health-probes.js +55 -0
- package/dist/lib/health-probes.js.map +1 -1
- package/dist/lib/k8s-bootstrap.d.ts +120 -0
- package/dist/lib/k8s-bootstrap.d.ts.map +1 -0
- package/dist/lib/k8s-bootstrap.js +193 -0
- package/dist/lib/k8s-bootstrap.js.map +1 -0
- package/dist/lib/k8s-secret-render.d.ts +139 -0
- package/dist/lib/k8s-secret-render.d.ts.map +1 -0
- package/dist/lib/k8s-secret-render.js +281 -0
- package/dist/lib/k8s-secret-render.js.map +1 -0
- package/dist/lib/kubectl-context.d.ts +38 -0
- package/dist/lib/kubectl-context.d.ts.map +1 -0
- package/dist/lib/kubectl-context.js +43 -0
- package/dist/lib/kubectl-context.js.map +1 -0
- package/dist/lib/memory-host-process-migration.d.ts +56 -0
- package/dist/lib/memory-host-process-migration.d.ts.map +1 -0
- package/dist/lib/memory-host-process-migration.js +156 -0
- package/dist/lib/memory-host-process-migration.js.map +1 -0
- package/dist/lib/upgrade-kubernetes.d.ts +42 -0
- package/dist/lib/upgrade-kubernetes.d.ts.map +1 -1
- package/dist/lib/upgrade-kubernetes.js +258 -24
- package/dist/lib/upgrade-kubernetes.js.map +1 -1
- package/dist/mcp-server.js +56 -22
- package/hermes-bundle/kg-first.sh +100 -0
- package/hermes-bundle/version.json +4 -0
- package/host-cp/k8s/manifests/50-deployment.yaml +54 -27
- package/host-cp/k8s/manifests/auth-service/30-configmap.yaml +5 -0
- package/host-cp/k8s/manifests/auth-service/50-deployment.yaml +5 -1
- package/host-cp/k8s/manifests/kg-service/30-configmap.yaml +5 -0
- package/host-cp/k8s/manifests/kg-service/50-deployment.yaml +5 -1
- package/host-cp/k8s/manifests/mcp-auth-service/30-configmap.yaml +4 -0
- package/host-cp/k8s/manifests/mcp-auth-service/50-deployment.yaml +5 -1
- package/host-cp/k8s/manifests/memory-service/30-configmap.yaml +4 -0
- package/host-cp/k8s/manifests/memory-service/50-deployment.yaml +5 -1
- package/package.json +3 -4
- package/memory-service-bundle/scripts/ensure-iii-engine.mjs +0 -179
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mode.js","sourceRoot":"","sources":["../../../src/commands/memory/mode.ts"],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
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* cwd: ~/.olam (so agentmemory writes state under ~/.olam/data/)
|
|
11
|
-
* stdio: append to ~/.olam/memory-service.log
|
|
12
|
-
* detached: true so the child outlives this CLI invocation
|
|
13
|
-
* 5. Write child pid to ~/.olam/memory.pid
|
|
14
|
-
* 6. Poll http://localhost:3111/agentmemory/livez until 200 (timeout 30s)
|
|
4
|
+
* Phase B substrate: delegates to `MemoryServiceContainerController` so the
|
|
5
|
+
* service runs as a Docker container managed by the same lifecycle as
|
|
6
|
+
* kg-service / auth-service / mcp-auth-service. The legacy Phase A host-process
|
|
7
|
+
* model (spawning the `agentmemory` npm bin + writing `~/.olam/memory.pid`)
|
|
8
|
+
* is retired; legacy on-disk state is migrated away on first new-substrate
|
|
9
|
+
* invocation via `migrateFromHostProcess()`.
|
|
15
10
|
*
|
|
16
|
-
*
|
|
11
|
+
* Operator-facing surface unchanged:
|
|
12
|
+
* - `olam memory start` still produces a running service on :3111.
|
|
13
|
+
* - `bootstrap.ts:429` `runOlam(['memory', 'start'])` call site untouched.
|
|
14
|
+
* - `--skip-memory` / `OLAM_BOOTSTRAP_SKIP_MEMORY=1` still skip.
|
|
17
15
|
*
|
|
18
|
-
*
|
|
16
|
+
* Phase C deletes the host-process helpers from `_paths.ts` + drops the
|
|
17
|
+
* `@agentmemory/agentmemory` PUBLISH_DEPS entry. Until then, the host-process
|
|
18
|
+
* code paths are unreachable but present (clean-revert insurance).
|
|
19
|
+
*
|
|
20
|
+
* Plan reference: docs/plans/memory-service-as-docker-peripheral/phase-b-tasks.md B1
|
|
19
21
|
*/
|
|
20
22
|
import type { Command } from 'commander';
|
|
21
23
|
export declare function runMemoryStart(): Promise<number>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../../src/commands/memory/start.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"start.d.ts","sourceRoot":"","sources":["../../../src/commands/memory/start.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQzC,wBAAsB,cAAc,IAAI,OAAO,CAAC,MAAM,CAAC,CA4DtD;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAQtD"}
|
|
@@ -1,217 +1,83 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* olam memory start —
|
|
2
|
+
* olam memory start — bring up the agent-memory service.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* cwd: ~/.olam (so agentmemory writes state under ~/.olam/data/)
|
|
11
|
-
* stdio: append to ~/.olam/memory-service.log
|
|
12
|
-
* detached: true so the child outlives this CLI invocation
|
|
13
|
-
* 5. Write child pid to ~/.olam/memory.pid
|
|
14
|
-
* 6. Poll http://localhost:3111/agentmemory/livez until 200 (timeout 30s)
|
|
4
|
+
* Phase B substrate: delegates to `MemoryServiceContainerController` so the
|
|
5
|
+
* service runs as a Docker container managed by the same lifecycle as
|
|
6
|
+
* kg-service / auth-service / mcp-auth-service. The legacy Phase A host-process
|
|
7
|
+
* model (spawning the `agentmemory` npm bin + writing `~/.olam/memory.pid`)
|
|
8
|
+
* is retired; legacy on-disk state is migrated away on first new-substrate
|
|
9
|
+
* invocation via `migrateFromHostProcess()`.
|
|
15
10
|
*
|
|
16
|
-
*
|
|
11
|
+
* Operator-facing surface unchanged:
|
|
12
|
+
* - `olam memory start` still produces a running service on :3111.
|
|
13
|
+
* - `bootstrap.ts:429` `runOlam(['memory', 'start'])` call site untouched.
|
|
14
|
+
* - `--skip-memory` / `OLAM_BOOTSTRAP_SKIP_MEMORY=1` still skip.
|
|
17
15
|
*
|
|
18
|
-
*
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
import { existsSync, mkdirSync, openSync, readFileSync, writeFileSync } from 'node:fs';
|
|
22
|
-
import { join } from 'node:path';
|
|
23
|
-
import { pathToFileURL } from 'node:url';
|
|
24
|
-
import { printError, printSuccess, printInfo, printHeader } from '../../output.js';
|
|
25
|
-
import { ensureMemorySecret } from '../../lib/memory-secret.js';
|
|
26
|
-
import { III_BINARY_PATH, MEMORY_DATA_DIR, MEMORY_LIVEZ_URL, MEMORY_LOG_PATH, MEMORY_PID_PATH, MEMORY_SERVICE_CANDIDATES, OLAM_BIN_DIR, OLAM_HOME, } from './_paths.js';
|
|
27
|
-
const READINESS_TIMEOUT_MS = 30_000;
|
|
28
|
-
const READINESS_POLL_MS = 500;
|
|
29
|
-
function resolveMemoryServiceDir() {
|
|
30
|
-
for (const c of MEMORY_SERVICE_CANDIDATES) {
|
|
31
|
-
if (existsSync(c))
|
|
32
|
-
return c;
|
|
33
|
-
}
|
|
34
|
-
throw new Error(`Could not find packages/memory-service/. Searched: ${MEMORY_SERVICE_CANDIDATES.join(', ')}. ` +
|
|
35
|
-
`If running from a published @pleri/olam-cli tarball, this is a packaging bug — please file an issue.`);
|
|
36
|
-
}
|
|
37
|
-
function resolveAgentMemoryBin(serviceDir) {
|
|
38
|
-
// npm hoists @agentmemory/agentmemory to the workspace root in monorepo mode.
|
|
39
|
-
// Search likely locations in order.
|
|
40
|
-
const candidates = [
|
|
41
|
-
join(serviceDir, 'node_modules', '.bin', 'agentmemory'),
|
|
42
|
-
join(serviceDir, '..', '..', 'node_modules', '.bin', 'agentmemory'),
|
|
43
|
-
join(serviceDir, '..', '..', '..', 'node_modules', '.bin', 'agentmemory'),
|
|
44
|
-
];
|
|
45
|
-
for (const c of candidates) {
|
|
46
|
-
if (existsSync(c))
|
|
47
|
-
return c;
|
|
48
|
-
}
|
|
49
|
-
throw new Error(`Could not find agentmemory bin. Searched: ${candidates.join(', ')}. ` +
|
|
50
|
-
`Run 'npm install' from the repo root.`);
|
|
51
|
-
}
|
|
52
|
-
function isProcessAlive(pid) {
|
|
53
|
-
try {
|
|
54
|
-
// signal 0 doesn't deliver; just tests existence + permission
|
|
55
|
-
process.kill(pid, 0);
|
|
56
|
-
return true;
|
|
57
|
-
}
|
|
58
|
-
catch {
|
|
59
|
-
return false;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
function readPidFromFile() {
|
|
63
|
-
if (!existsSync(MEMORY_PID_PATH))
|
|
64
|
-
return null;
|
|
65
|
-
const raw = readFileSync(MEMORY_PID_PATH, 'utf8').trim();
|
|
66
|
-
const pid = parseInt(raw, 10);
|
|
67
|
-
if (!Number.isFinite(pid) || pid <= 0)
|
|
68
|
-
return null;
|
|
69
|
-
return pid;
|
|
70
|
-
}
|
|
71
|
-
async function probeLivez(secret, signal) {
|
|
72
|
-
try {
|
|
73
|
-
const resp = await fetch(MEMORY_LIVEZ_URL, {
|
|
74
|
-
headers: { authorization: `Bearer ${secret}` },
|
|
75
|
-
signal,
|
|
76
|
-
});
|
|
77
|
-
if (!resp.ok)
|
|
78
|
-
return false;
|
|
79
|
-
const body = (await resp.json());
|
|
80
|
-
return body.status === 'ok';
|
|
81
|
-
}
|
|
82
|
-
catch {
|
|
83
|
-
return false;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
async function waitForReady(secret) {
|
|
87
|
-
const deadline = Date.now() + READINESS_TIMEOUT_MS;
|
|
88
|
-
while (Date.now() < deadline) {
|
|
89
|
-
if (await probeLivez(secret))
|
|
90
|
-
return true;
|
|
91
|
-
await new Promise((r) => setTimeout(r, READINESS_POLL_MS));
|
|
92
|
-
}
|
|
93
|
-
return false;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Auto-fetch the iii binary via A1's `ensure-iii-engine.mjs` helper.
|
|
16
|
+
* Phase C deletes the host-process helpers from `_paths.ts` + drops the
|
|
17
|
+
* `@agentmemory/agentmemory` PUBLISH_DEPS entry. Until then, the host-process
|
|
18
|
+
* code paths are unreachable but present (clean-revert insurance).
|
|
97
19
|
*
|
|
98
|
-
*
|
|
99
|
-
* the bootstrap-time UX gap surfaced by `olam bootstrap` in CI: A5
|
|
100
|
-
* wires `olam memory start` into the bootstrap flow, but A2's start
|
|
101
|
-
* command previously failed with a "Run: node ... ensure-iii-engine.mjs"
|
|
102
|
-
* remedy that operators on fresh hosts couldn't auto-resolve. Now
|
|
103
|
-
* `olam memory start` (and therefore `olam bootstrap`) auto-fetches the
|
|
104
|
-
* SHA256-pinned binary on first use.
|
|
105
|
-
*
|
|
106
|
-
* Dynamic-imported because the helper is in `packages/memory-service/`,
|
|
107
|
-
* a sibling workspace — resolving statically would invert the package
|
|
108
|
-
* graph. Path resolution reuses `resolveMemoryServiceDir` so the bundle-
|
|
109
|
-
* vs-source layout fallbacks stay consistent.
|
|
20
|
+
* Plan reference: docs/plans/memory-service-as-docker-peripheral/phase-b-tasks.md B1
|
|
110
21
|
*/
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
const result = await mod.ensureIiiEngine();
|
|
115
|
-
if (!result.ok) {
|
|
116
|
-
throw new Error(`ensureIiiEngine returned ok=false (path=${result.path})`);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
22
|
+
import { printError, printSuccess, printInfo, printHeader, printWarning } from '../../output.js';
|
|
23
|
+
import { MEMORY_SERVICE_PORT, MemoryServiceContainerController, } from '../memory-service-container.js';
|
|
24
|
+
import { migrateFromHostProcess } from '../../lib/memory-host-process-migration.js';
|
|
119
25
|
export async function runMemoryStart() {
|
|
120
26
|
printHeader('olam memory start');
|
|
121
|
-
//
|
|
122
|
-
//
|
|
123
|
-
// is
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
catch (err) {
|
|
129
|
-
printError(err instanceof Error ? err.message : String(err));
|
|
130
|
-
return 1;
|
|
131
|
-
}
|
|
132
|
-
// 1. iii binary (A1's deliverable). Auto-fetch when missing so
|
|
133
|
-
// `olam bootstrap` succeeds on fresh hosts (CI runners, new
|
|
134
|
-
// operator machines) without a manual ensure-iii-engine step.
|
|
135
|
-
if (!existsSync(III_BINARY_PATH)) {
|
|
136
|
-
printInfo('iii binary', `missing at ${III_BINARY_PATH} — auto-fetching v0.11.2`);
|
|
137
|
-
try {
|
|
138
|
-
await autoEnsureIiiBinary(serviceDir);
|
|
139
|
-
}
|
|
140
|
-
catch (err) {
|
|
141
|
-
printError(`iii binary auto-fetch failed: ${err instanceof Error ? err.message : String(err)}. ` +
|
|
142
|
-
`Run manually: node packages/memory-service/scripts/ensure-iii-engine.mjs`);
|
|
143
|
-
return 1;
|
|
144
|
-
}
|
|
27
|
+
// 1. Migrate away from any Phase A host-process state on disk. Idempotent
|
|
28
|
+
// no-op on hosts that never ran the legacy substrate. PID-reuse defence
|
|
29
|
+
// is in the helper — we never SIGTERM a process whose comm name isn't
|
|
30
|
+
// `node`.
|
|
31
|
+
const migration = migrateFromHostProcess();
|
|
32
|
+
if (migration.cleaned) {
|
|
33
|
+
printInfo('migration', migration.summary);
|
|
145
34
|
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
const
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
// the auto-fetch path).
|
|
152
|
-
const agentmemoryBin = resolveAgentMemoryBin(serviceDir);
|
|
153
|
-
printInfo('agentmemory', agentmemoryBin);
|
|
154
|
-
// 4. Idempotency: already running?
|
|
155
|
-
const existingPid = readPidFromFile();
|
|
156
|
-
if (existingPid !== null && isProcessAlive(existingPid)) {
|
|
157
|
-
const ready = await probeLivez(secret);
|
|
35
|
+
// 2. Substrate handoff to MemoryServiceContainerController (Phase A A1).
|
|
36
|
+
const controller = new MemoryServiceContainerController();
|
|
37
|
+
const current = controller.status();
|
|
38
|
+
if (current.state === 'running') {
|
|
39
|
+
const ready = await controller.waitForReady(5_000);
|
|
158
40
|
if (ready) {
|
|
159
|
-
printSuccess(`already running
|
|
41
|
+
printSuccess(`olam-memory-service already running on :${current.port}; /agentmemory/livez ok`);
|
|
160
42
|
return 0;
|
|
161
43
|
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
`Run 'olam memory stop' to clear, then retry.`);
|
|
44
|
+
printWarning(`olam-memory-service container is running but /agentmemory/livez did not respond. ` +
|
|
45
|
+
`Run 'olam memory stop' then retry, or 'olam memory logs' to diagnose.`);
|
|
165
46
|
return 1;
|
|
166
47
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
AGENTMEMORY_HOST: '0.0.0.0',
|
|
183
|
-
PATH: `${OLAM_BIN_DIR}:${process.env.PATH ?? ''}`,
|
|
184
|
-
},
|
|
185
|
-
stdio: ['ignore', logFd, logFd],
|
|
186
|
-
detached: true,
|
|
187
|
-
});
|
|
188
|
-
child.unref();
|
|
189
|
-
if (child.pid === undefined) {
|
|
190
|
-
printError('spawn returned no pid (process failed to start)');
|
|
48
|
+
if (controller.imageMissingEverywhere()) {
|
|
49
|
+
printError('olam-memory-service image not found locally. ' +
|
|
50
|
+
'Run `olam bootstrap` to pull the published image, or ' +
|
|
51
|
+
'`node packages/cli/scripts/build-memory-service-image.mjs` to build from source.');
|
|
52
|
+
return 1;
|
|
53
|
+
}
|
|
54
|
+
try {
|
|
55
|
+
controller.start();
|
|
56
|
+
}
|
|
57
|
+
catch (err) {
|
|
58
|
+
const errMsg = err instanceof Error ? err.message : String(err);
|
|
59
|
+
const stderr = err instanceof Error && 'stderr' in err
|
|
60
|
+
? String(err.stderr ?? '').trim()
|
|
61
|
+
: '';
|
|
62
|
+
printError(`olam-memory-service failed to start: ${errMsg}${stderr ? `\n stderr: ${stderr}` : ''}`);
|
|
191
63
|
return 1;
|
|
192
64
|
}
|
|
193
|
-
|
|
194
|
-
writeFileSync(MEMORY_PID_PATH, `${child.pid}\n`, { mode: 0o644 });
|
|
195
|
-
printInfo('pid', `${child.pid}`);
|
|
196
|
-
// 8. Wait for readiness
|
|
197
|
-
printInfo('readiness', `polling ${MEMORY_LIVEZ_URL}`);
|
|
198
|
-
const ready = await waitForReady(secret);
|
|
65
|
+
const ready = await controller.waitForReady();
|
|
199
66
|
if (!ready) {
|
|
200
|
-
printError(`
|
|
201
|
-
`Inspect
|
|
67
|
+
printError(`olam-memory-service started but /agentmemory/livez did not respond within 60s. ` +
|
|
68
|
+
`Inspect logs with 'olam memory logs'.`);
|
|
202
69
|
return 1;
|
|
203
70
|
}
|
|
204
|
-
printSuccess(`memory
|
|
71
|
+
printSuccess(`olam-memory-service started on :${MEMORY_SERVICE_PORT}; /agentmemory/livez ok`);
|
|
205
72
|
return 0;
|
|
206
73
|
}
|
|
207
74
|
export function registerMemoryStart(cmd) {
|
|
208
75
|
cmd
|
|
209
76
|
.command('start')
|
|
210
|
-
.description('Start the
|
|
77
|
+
.description('Start the agent-memory Docker container (Phase B substrate).')
|
|
211
78
|
.action(async () => {
|
|
212
|
-
const
|
|
213
|
-
|
|
214
|
-
process.exitCode = rc;
|
|
79
|
+
const exitCode = await runMemoryStart();
|
|
80
|
+
process.exit(exitCode);
|
|
215
81
|
});
|
|
216
82
|
}
|
|
217
83
|
//# sourceMappingURL=start.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start.js","sourceRoot":"","sources":["../../../src/commands/memory/start.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"start.js","sourceRoot":"","sources":["../../../src/commands/memory/start.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACjG,OAAO,EACL,mBAAmB,EACnB,gCAAgC,GACjC,MAAM,gCAAgC,CAAC;AACxC,OAAO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AG;YACpD,CAAC,CAAC,MAAM,CAAE,GAAmC,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE;YAClE,CAAC,CAAC,EAAE,CAAC;QACP,UAAU,CAAC,wCAAwC,MAAM,GAAG,MAAM,CAAC,CAAC,CAAC,eAAe,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QACrG,OAAO,CAAC,CAAC;IACX,CAAC;IAED,MAAM,KAAK,GAAG,MAAM,UAAU,CAAC,YAAY,EAAE,CAAC;IAC9C,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,UAAU,CACR,iFAAiF;YAC/E,uCAAuC,CAC1C,CAAC;QACF,OAAO,CAAC,CAAC;IACX,CAAC;IAED,YAAY,CAAC,mCAAmC,mBAAmB,yBAAyB,CAAC,CAAC;IAC9F,OAAO,CAAC,CAAC;AACX,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,GAAY;IAC9C,GAAG;SACA,OAAO,CAAC,OAAO,CAAC;SAChB,WAAW,CAAC,8DAA8D,CAAC;SAC3E,MAAM,CAAC,KAAK,IAAI,EAAE;QACjB,MAAM,QAAQ,GAAG,MAAM,cAAc,EAAE,CAAC;QACxC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* olam memory status — diagnostic dump for the
|
|
2
|
+
* olam memory status — diagnostic dump for the agent-memory Docker container.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Phase B substrate: queries `MemoryServiceContainerController.status()` +
|
|
5
|
+
* bearer-authenticated livez probe. Output schema preserves the Phase A
|
|
6
|
+
* shape — `state | livez | secret | port` — but the `state` field now
|
|
7
|
+
* reports container lifecycle (`running | stopped | missing`) instead of
|
|
8
|
+
* pid/alive.
|
|
7
9
|
*
|
|
8
|
-
* Plan reference: docs/plans/
|
|
10
|
+
* Plan reference: docs/plans/memory-service-as-docker-peripheral/phase-b-tasks.md B3
|
|
9
11
|
*/
|
|
10
12
|
import type { Command } from 'commander';
|
|
11
13
|
interface MemoryStatus {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
state: 'running' | 'stopped' | 'missing';
|
|
15
|
+
containerId: string | null;
|
|
14
16
|
livez: 'ok' | 'unreachable' | 'unauthorized' | 'unknown';
|
|
15
17
|
secretSet: boolean;
|
|
16
|
-
iiiBinary: string | null;
|
|
17
18
|
port: number;
|
|
19
|
+
legacyPidfilePresent: boolean;
|
|
18
20
|
}
|
|
19
21
|
export declare function collectMemoryStatus(): Promise<MemoryStatus>;
|
|
20
22
|
export declare function runMemoryStatus(opts?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/commands/memory/status.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/commands/memory/status.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAWzC,UAAU,YAAY;IACpB,KAAK,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;IACzC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,KAAK,EAAE,IAAI,GAAG,aAAa,GAAG,cAAc,GAAG,SAAS,CAAC;IACzD,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,oBAAoB,EAAE,OAAO,CAAC;CAC/B;AAgBD,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,YAAY,CAAC,CAajE;AAED,wBAAsB,eAAe,CAAC,IAAI,GAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CA+CpF;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CASvD"}
|
|
@@ -1,25 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* olam memory status — diagnostic dump for the
|
|
2
|
+
* olam memory status — diagnostic dump for the agent-memory Docker container.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Phase B substrate: queries `MemoryServiceContainerController.status()` +
|
|
5
|
+
* bearer-authenticated livez probe. Output schema preserves the Phase A
|
|
6
|
+
* shape — `state | livez | secret | port` — but the `state` field now
|
|
7
|
+
* reports container lifecycle (`running | stopped | missing`) instead of
|
|
8
|
+
* pid/alive.
|
|
7
9
|
*
|
|
8
|
-
* Plan reference: docs/plans/
|
|
10
|
+
* Plan reference: docs/plans/memory-service-as-docker-peripheral/phase-b-tasks.md B3
|
|
9
11
|
*/
|
|
10
|
-
import { existsSync
|
|
11
|
-
import {
|
|
12
|
+
import { existsSync } from 'node:fs';
|
|
13
|
+
import { printInfo, printHeader, printWarning } from '../../output.js';
|
|
12
14
|
import { hasMemorySecret, readMemorySecretOrNull } from '../../lib/memory-secret.js';
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
try {
|
|
16
|
-
process.kill(pid, 0);
|
|
17
|
-
return true;
|
|
18
|
-
}
|
|
19
|
-
catch {
|
|
20
|
-
return false;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
15
|
+
import { MEMORY_LIVEZ_URL, MEMORY_REST_PORT, MEMORY_PID_PATH, } from './_paths.js';
|
|
16
|
+
import { MemoryServiceContainerController } from '../memory-service-container.js';
|
|
23
17
|
async function probe(secret) {
|
|
24
18
|
try {
|
|
25
19
|
const headers = {};
|
|
@@ -38,22 +32,17 @@ async function probe(secret) {
|
|
|
38
32
|
}
|
|
39
33
|
}
|
|
40
34
|
export async function collectMemoryStatus() {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const raw = readFileSync(MEMORY_PID_PATH, 'utf8').trim();
|
|
44
|
-
const parsed = parseInt(raw, 10);
|
|
45
|
-
pid = Number.isFinite(parsed) && parsed > 0 ? parsed : null;
|
|
46
|
-
}
|
|
47
|
-
const alive = pid === null ? null : isAlive(pid);
|
|
35
|
+
const controller = new MemoryServiceContainerController();
|
|
36
|
+
const containerStatus = controller.status();
|
|
48
37
|
const secret = readMemorySecretOrNull();
|
|
49
38
|
const livez = await probe(secret);
|
|
50
39
|
return {
|
|
51
|
-
|
|
52
|
-
|
|
40
|
+
state: containerStatus.state,
|
|
41
|
+
containerId: containerStatus.containerId ?? null,
|
|
53
42
|
livez,
|
|
54
43
|
secretSet: hasMemorySecret(),
|
|
55
|
-
iiiBinary: existsSync(III_BINARY_PATH) ? III_BINARY_PATH : null,
|
|
56
44
|
port: MEMORY_REST_PORT,
|
|
45
|
+
legacyPidfilePresent: existsSync(MEMORY_PID_PATH),
|
|
57
46
|
};
|
|
58
47
|
}
|
|
59
48
|
export async function runMemoryStatus(opts = {}) {
|
|
@@ -63,24 +52,32 @@ export async function runMemoryStatus(opts = {}) {
|
|
|
63
52
|
return s.livez === 'ok' ? 0 : 1;
|
|
64
53
|
}
|
|
65
54
|
printHeader('olam memory status');
|
|
66
|
-
printInfo('
|
|
67
|
-
|
|
55
|
+
printInfo('state', s.state);
|
|
56
|
+
if (s.containerId)
|
|
57
|
+
printInfo('container', s.containerId.slice(0, 12));
|
|
68
58
|
printInfo('livez', s.livez);
|
|
69
59
|
printInfo('secret', s.secretSet ? '~/.olam/memory-secret (set)' : '(missing)');
|
|
70
|
-
printInfo('iii', s.iiiBinary ?? '(not installed)');
|
|
71
60
|
printInfo('port', `${s.port}`);
|
|
72
|
-
if (s.
|
|
61
|
+
if (s.legacyPidfilePresent) {
|
|
62
|
+
printWarning('~/.olam/memory.pid is present (Phase A legacy artefact). ' +
|
|
63
|
+
'Will be cleaned up on next `olam memory start` or `olam memory stop`.');
|
|
64
|
+
}
|
|
65
|
+
if (s.state === 'running' && s.livez === 'ok')
|
|
73
66
|
return 0;
|
|
74
|
-
if (s.
|
|
75
|
-
printWarning('
|
|
67
|
+
if (s.state === 'missing') {
|
|
68
|
+
printWarning('no olam-memory-service container exists; run `olam memory start`');
|
|
76
69
|
return 1;
|
|
77
70
|
}
|
|
78
|
-
if (s.
|
|
79
|
-
printWarning('
|
|
71
|
+
if (s.livez === 'unauthorized') {
|
|
72
|
+
printWarning('livez returned 401 — the container is up but the local secret does not match. ' +
|
|
73
|
+
'The container was likely started with a different secret. ' +
|
|
74
|
+
'`olam memory stop && olam memory start` will reconcile.');
|
|
80
75
|
return 1;
|
|
81
76
|
}
|
|
82
|
-
if (
|
|
83
|
-
printWarning('
|
|
77
|
+
if (s.livez === 'unreachable' && s.state === 'running') {
|
|
78
|
+
printWarning('container is running but /agentmemory/livez did not respond. ' +
|
|
79
|
+
'Check `olam memory logs` for startup errors.');
|
|
80
|
+
return 1;
|
|
84
81
|
}
|
|
85
82
|
if (!s.secretSet) {
|
|
86
83
|
printWarning('secret missing; `olam memory start` will generate it');
|
|
@@ -90,7 +87,7 @@ export async function runMemoryStatus(opts = {}) {
|
|
|
90
87
|
export function registerMemoryStatus(cmd) {
|
|
91
88
|
cmd
|
|
92
89
|
.command('status')
|
|
93
|
-
.description('Diagnostic dump for the
|
|
90
|
+
.description('Diagnostic dump for the agent-memory Docker container (Phase B substrate).')
|
|
94
91
|
.option('--json', 'Machine-readable JSON output', false)
|
|
95
92
|
.action(async (opts) => {
|
|
96
93
|
const rc = await runMemoryStatus(opts);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../../src/commands/memory/status.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../../src/commands/memory/status.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM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kEAAkE,CAAC,CAAC;QACjF,OAAO,CAAC,CAAC;IACX,CAAC;IACD,IAAI,CAAC,CAAC,KAAK,KAAK,cAAc,EAAE,CAAC;QAC/B,YAAY,CACV,gFAAgF;YAC9E,4DAA4D;YAC5D,yDAAyD,CAC5D,CAAC;QACF,OAAO,CAAC,CAAC;IACX,CAAC;IACD,IAAI,CAAC,CAAC,KAAK,KAAK,aAAa,IAAI,CAAC,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QACvD,YAAY,CACV,+DAA+D;YAC7D,8CAA8C,CACjD,CAAC;QACF,OAAO,CAAC,CAAC;IACX,CAAC;IACD,IAAI,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;QACjB,YAAY,CAAC,sDAAsD,CAAC,CAAC;IACvE,CAAC;IACD,OAAO,CAAC,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAClC,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,GAAY;IAC/C,GAAG;SACA,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,4EAA4E,CAAC;SACzF,MAAM,CAAC,QAAQ,EAAE,8BAA8B,EAAE,KAAK,CAAC;SACvD,MAAM,CAAC,KAAK,EAAE,IAAwB,EAAE,EAAE;QACzC,MAAM,EAAE,GAAG,MAAM,eAAe,CAAC,IAAI,CAAC,CAAC;QACvC,IAAI,EAAE,KAAK,CAAC;YAAE,OAAO,CAAC,QAAQ,GAAG,EAAE,CAAC;IACtC,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* olam memory stop —
|
|
2
|
+
* olam memory stop — stop the agent-memory Docker container.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Phase B substrate: delegates to `MemoryServiceContainerController.stop()`.
|
|
5
|
+
* Also cleans up any residual Phase A legacy state (`~/.olam/memory.pid` +
|
|
6
|
+
* the log file) via `migrateFromHostProcess({ removeLog: true })`.
|
|
6
7
|
*
|
|
7
|
-
* Plan reference: docs/plans/
|
|
8
|
+
* Plan reference: docs/plans/memory-service-as-docker-peripheral/phase-b-tasks.md B2
|
|
8
9
|
*/
|
|
9
10
|
import type { Command } from 'commander';
|
|
10
11
|
export declare function runMemoryStop(): Promise<number>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stop.d.ts","sourceRoot":"","sources":["../../../src/commands/memory/stop.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"stop.d.ts","sourceRoot":"","sources":["../../../src/commands/memory/stop.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKzC,wBAAsB,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC,CA8BrD;AAED,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAQrD"}
|