@pleri/olam-cli 0.1.147 → 0.1.150
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/agent-stream/agent-sdk-to-chunks.js +276 -0
- package/dist/agent-stream/agent-stream-launch.js +348 -0
- package/dist/agent-stream/chunks-subscriber-transport.js +262 -0
- package/dist/agent-stream/codex-runner.js +188 -0
- package/dist/agent-stream/driver-runner.js +347 -0
- package/dist/agent-stream/operator-subscription.js +179 -0
- package/dist/commands/auth.d.ts.map +1 -1
- package/dist/commands/auth.js +26 -1
- package/dist/commands/auth.js.map +1 -1
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +39 -0
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/doctor.d.ts +54 -3
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +348 -6
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/init.d.ts +46 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +90 -0
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/kg-build.d.ts +23 -0
- package/dist/commands/kg-build.d.ts.map +1 -1
- package/dist/commands/kg-build.js +104 -2
- package/dist/commands/kg-build.js.map +1 -1
- package/dist/commands/restart.d.ts +18 -0
- package/dist/commands/restart.d.ts.map +1 -0
- package/dist/commands/restart.js +113 -0
- package/dist/commands/restart.js.map +1 -0
- package/dist/commands/services.d.ts +41 -3
- package/dist/commands/services.d.ts.map +1 -1
- package/dist/commands/services.js +221 -13
- package/dist/commands/services.js.map +1 -1
- package/dist/commands/setup-linux-gate.d.ts +26 -0
- package/dist/commands/setup-linux-gate.d.ts.map +1 -0
- package/dist/commands/setup-linux-gate.js +42 -0
- package/dist/commands/setup-linux-gate.js.map +1 -0
- package/dist/commands/setup-metrics.d.ts +26 -0
- package/dist/commands/setup-metrics.d.ts.map +1 -0
- package/dist/commands/setup-metrics.js +57 -0
- package/dist/commands/setup-metrics.js.map +1 -0
- package/dist/commands/setup-phase-5a-skill-source.d.ts +68 -0
- package/dist/commands/setup-phase-5a-skill-source.d.ts.map +1 -0
- package/dist/commands/setup-phase-5a-skill-source.js +196 -0
- package/dist/commands/setup-phase-5a-skill-source.js.map +1 -0
- package/dist/commands/setup-phase-5b-project-sweep.d.ts +38 -0
- package/dist/commands/setup-phase-5b-project-sweep.d.ts.map +1 -0
- package/dist/commands/setup-phase-5b-project-sweep.js +176 -0
- package/dist/commands/setup-phase-5b-project-sweep.js.map +1 -0
- package/dist/commands/setup.d.ts +19 -0
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +22 -0
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/skills-10x.d.ts +23 -0
- package/dist/commands/skills-10x.d.ts.map +1 -0
- package/dist/commands/skills-10x.js +308 -0
- package/dist/commands/skills-10x.js.map +1 -0
- package/dist/commands/substrate-audit-log.d.ts +2 -0
- package/dist/commands/substrate-audit-log.d.ts.map +1 -1
- package/dist/commands/substrate-audit-log.js +13 -0
- package/dist/commands/substrate-audit-log.js.map +1 -1
- package/dist/image-digests.json +7 -7
- package/dist/index.js +18102 -15234
- package/dist/index.js.map +1 -1
- package/dist/lib/auth-refresh-kubernetes.d.ts +62 -0
- package/dist/lib/auth-refresh-kubernetes.d.ts.map +1 -0
- package/dist/lib/auth-refresh-kubernetes.js +127 -0
- package/dist/lib/auth-refresh-kubernetes.js.map +1 -0
- package/dist/lib/build-if-stale.d.ts +33 -0
- package/dist/lib/build-if-stale.d.ts.map +1 -0
- package/dist/lib/build-if-stale.js +156 -0
- package/dist/lib/build-if-stale.js.map +1 -0
- package/dist/lib/bundle-freshness.d.ts +57 -0
- package/dist/lib/bundle-freshness.d.ts.map +1 -0
- package/dist/lib/bundle-freshness.js +223 -0
- package/dist/lib/bundle-freshness.js.map +1 -0
- package/dist/lib/bundle-source.d.ts +52 -0
- package/dist/lib/bundle-source.d.ts.map +1 -0
- package/dist/lib/bundle-source.js +83 -0
- package/dist/lib/bundle-source.js.map +1 -0
- package/dist/lib/kubectl-wrap.d.ts +6 -0
- package/dist/lib/kubectl-wrap.d.ts.map +1 -1
- package/dist/lib/kubectl-wrap.js +6 -1
- package/dist/lib/kubectl-wrap.js.map +1 -1
- package/dist/lib/manifest-refresh.d.ts +42 -1
- package/dist/lib/manifest-refresh.d.ts.map +1 -1
- package/dist/lib/manifest-refresh.js +83 -7
- package/dist/lib/manifest-refresh.js.map +1 -1
- package/dist/lib/peripheral-registry.d.ts +36 -0
- package/dist/lib/peripheral-registry.d.ts.map +1 -0
- package/dist/lib/peripheral-registry.js +55 -0
- package/dist/lib/peripheral-registry.js.map +1 -0
- package/dist/lib/port-forward.d.ts +67 -0
- package/dist/lib/port-forward.d.ts.map +1 -1
- package/dist/lib/port-forward.js +153 -0
- package/dist/lib/port-forward.js.map +1 -1
- package/dist/lib/upgrade-kubernetes.d.ts +52 -12
- package/dist/lib/upgrade-kubernetes.d.ts.map +1 -1
- package/dist/lib/upgrade-kubernetes.js +390 -22
- package/dist/lib/upgrade-kubernetes.js.map +1 -1
- package/dist/mcp-server.js +84 -58
- package/host-cp/compose.yaml +6 -0
- package/host-cp/k8s/manifests/30-configmap.yaml +6 -0
- package/host-cp/k8s/manifests/50-deployment.yaml +46 -9
- package/host-cp/k8s/manifests/auth-service/10-serviceaccount.yaml +8 -0
- package/host-cp/k8s/manifests/auth-service/20-rbac.yaml +34 -0
- package/host-cp/k8s/manifests/auth-service/30-configmap.yaml +24 -0
- package/host-cp/k8s/manifests/auth-service/45-pvc.yaml +25 -0
- package/host-cp/k8s/manifests/auth-service/50-deployment.yaml +117 -0
- package/host-cp/k8s/manifests/auth-service/60-service.yaml +21 -0
- package/host-cp/k8s/manifests/kg-service/10-serviceaccount.yaml +8 -0
- package/host-cp/k8s/manifests/kg-service/20-rbac.yaml +34 -0
- package/host-cp/k8s/manifests/kg-service/30-configmap.yaml +18 -0
- package/host-cp/k8s/manifests/kg-service/45-pvc.yaml +25 -0
- package/host-cp/k8s/manifests/kg-service/50-deployment.yaml +108 -0
- package/host-cp/k8s/manifests/kg-service/60-service.yaml +21 -0
- package/host-cp/k8s/manifests/mcp-auth-service/10-serviceaccount.yaml +8 -0
- package/host-cp/k8s/manifests/mcp-auth-service/20-rbac.yaml +34 -0
- package/host-cp/k8s/manifests/mcp-auth-service/30-configmap.yaml +18 -0
- package/host-cp/k8s/manifests/mcp-auth-service/45-pvc.yaml +25 -0
- package/host-cp/k8s/manifests/mcp-auth-service/50-deployment.yaml +117 -0
- package/host-cp/k8s/manifests/mcp-auth-service/60-service.yaml +21 -0
- package/host-cp/k8s/manifests/memory-service/10-serviceaccount.yaml +8 -0
- package/host-cp/k8s/manifests/memory-service/20-rbac.yaml +34 -0
- package/host-cp/k8s/manifests/memory-service/30-configmap.yaml +20 -0
- package/host-cp/k8s/manifests/memory-service/45-pvc.yaml +25 -0
- package/host-cp/k8s/manifests/memory-service/50-deployment.yaml +121 -0
- package/host-cp/k8s/manifests/memory-service/60-service.yaml +21 -0
- package/host-cp/k8s/templates/auth-service-secret-template.yaml +28 -0
- package/host-cp/k8s/templates/kg-service-secret-template.yaml +28 -0
- package/host-cp/k8s/templates/mcp-auth-service-secret-template.yaml +28 -0
- package/host-cp/k8s/templates/memory-service-secret-template.yaml +29 -0
- package/host-cp/src/agent-runtime-trigger.mjs +7 -5
- package/host-cp/src/plan-chat-secret.mjs +13 -2
- package/host-cp/src/plan-chat-service.mjs +116 -15
- package/host-cp/src/server.mjs +23 -11
- package/host-cp/src/upgrade-spawner.mjs +10 -5
- package/package.json +4 -2
|
@@ -22,18 +22,21 @@
|
|
|
22
22
|
// Configuration is environment-driven so a single binary works in laptop
|
|
23
23
|
// (the K3 container-spike), in a devbox container, and on a host-cp Mac:
|
|
24
24
|
//
|
|
25
|
-
// OLAM_PLAN_CHAT_PORT (default 3112
|
|
25
|
+
// OLAM_PLAN_CHAT_PORT (default 3200; moved off 3112 — see
|
|
26
|
+
// olam-chunks-subscriber-long-poll Phase A.
|
|
27
|
+
// agentmemory iii/node claim 3111-3113.)
|
|
26
28
|
// OLAM_PLAN_CHAT_DATABASE_URL (default postgres://postgres:spike@localhost:54321/chunks)
|
|
27
29
|
// OLAM_PLAN_CHAT_ELECTRIC_URL (default http://localhost:30001)
|
|
28
30
|
// OLAM_PLAN_CHAT_SECRET_PATH (default ~/.olam/plan-chat-secret)
|
|
29
31
|
|
|
30
32
|
import http from 'node:http';
|
|
33
|
+
import { performance } from 'node:perf_hooks';
|
|
31
34
|
import { Readable } from 'node:stream';
|
|
32
35
|
import { URL } from 'node:url';
|
|
33
36
|
import pg from 'pg';
|
|
34
37
|
import { ensureSecret, timingSafeEqual, SECRET_PATH } from './plan-chat-secret.mjs';
|
|
35
38
|
|
|
36
|
-
const DEFAULT_PORT =
|
|
39
|
+
const DEFAULT_PORT = 3200;
|
|
37
40
|
const DEFAULT_DB_URL = 'postgres://postgres:spike@localhost:54321/chunks';
|
|
38
41
|
const DEFAULT_ELECTRIC_URL = 'http://localhost:30001';
|
|
39
42
|
|
|
@@ -176,13 +179,36 @@ function validateChunkInput(body) {
|
|
|
176
179
|
/**
|
|
177
180
|
* Build the HTTP request handler. Pure factory — easy to test against a
|
|
178
181
|
* stubbed pool. Production callers pass a real pg.Pool.
|
|
182
|
+
*
|
|
183
|
+
* Phase A A2 (olam-spa-electric-subscription-staleness): when `shapeDebug`
|
|
184
|
+
* is true OR `OLAM_PLAN_CHAT_SHAPE_DEBUG=1` is set in the environment,
|
|
185
|
+
* `handleGetShape` emits two structured log lines per long-poll cycle —
|
|
186
|
+
* one BEFORE the upstream fetch (with the rewritten `where` predicate +
|
|
187
|
+
* forwarded params) and one AFTER (with upstream status + electric-*
|
|
188
|
+
* response headers). Log lines go to `shapeDebugLog` (default
|
|
189
|
+
* `console.error`); tests inject a spy. Flag defaults OFF — production
|
|
190
|
+
* shapes incur a single boolean check per cycle and zero log I/O.
|
|
179
191
|
*/
|
|
180
|
-
export function createHandler({
|
|
192
|
+
export function createHandler({
|
|
193
|
+
pool,
|
|
194
|
+
bearer,
|
|
195
|
+
electricUrl,
|
|
196
|
+
shapeDebug,
|
|
197
|
+
shapeDebugLog,
|
|
198
|
+
}) {
|
|
181
199
|
if (!pool) throw new Error('createHandler: { pool } required');
|
|
182
200
|
if (typeof bearer !== 'string' || bearer.length === 0) {
|
|
183
201
|
throw new Error('createHandler: { bearer } required');
|
|
184
202
|
}
|
|
185
203
|
const electricBase = electricUrl ?? DEFAULT_ELECTRIC_URL;
|
|
204
|
+
const shapeDebugEnabled =
|
|
205
|
+
typeof shapeDebug === 'boolean'
|
|
206
|
+
? shapeDebug
|
|
207
|
+
: process.env.OLAM_PLAN_CHAT_SHAPE_DEBUG === '1';
|
|
208
|
+
const shapeLog =
|
|
209
|
+
typeof shapeDebugLog === 'function'
|
|
210
|
+
? shapeDebugLog
|
|
211
|
+
: (msg, details) => console.error(msg, details);
|
|
186
212
|
|
|
187
213
|
function checkAuth(req) {
|
|
188
214
|
const header = req.headers.authorization;
|
|
@@ -280,29 +306,76 @@ export function createHandler({ pool, bearer, electricUrl }) {
|
|
|
280
306
|
`session_id='${sessionId}' AND world_id='${worldId}'`,
|
|
281
307
|
);
|
|
282
308
|
|
|
309
|
+
// Phase A A2 — log BEFORE upstream fetch. Includes the rewritten
|
|
310
|
+
// `where` predicate so an operator can correlate client-supplied
|
|
311
|
+
// offset/handle with the server-derived scope. Cheap when off: one
|
|
312
|
+
// boolean check.
|
|
313
|
+
if (shapeDebugEnabled) {
|
|
314
|
+
shapeLog('[plan-chat-service:shape] → upstream', {
|
|
315
|
+
upstream: upstream.pathname + upstream.search,
|
|
316
|
+
offset: url.searchParams.get('offset'),
|
|
317
|
+
handle: url.searchParams.get('handle'),
|
|
318
|
+
live: url.searchParams.get('live'),
|
|
319
|
+
where: upstream.searchParams.get('where'),
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
|
|
283
323
|
let upstreamRes;
|
|
324
|
+
const upstreamStartedAt = shapeDebugEnabled ? performance.now() : 0;
|
|
284
325
|
try {
|
|
285
326
|
upstreamRes = await fetch(upstream, {
|
|
286
327
|
method: 'GET',
|
|
287
328
|
headers: { accept: 'application/json' },
|
|
288
329
|
});
|
|
289
330
|
} catch (err) {
|
|
331
|
+
if (shapeDebugEnabled) {
|
|
332
|
+
shapeLog('[plan-chat-service:shape] ✖ upstream-error', {
|
|
333
|
+
upstream: upstream.pathname + upstream.search,
|
|
334
|
+
err: String(err?.message ?? err),
|
|
335
|
+
});
|
|
336
|
+
}
|
|
290
337
|
return send(res, 502, {
|
|
291
338
|
error: 'shape-upstream-unreachable',
|
|
292
339
|
message: String(err?.message ?? err),
|
|
293
340
|
});
|
|
294
341
|
}
|
|
295
342
|
|
|
296
|
-
//
|
|
297
|
-
// res.writeHead fires
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
343
|
+
// Phase A A2 — log AFTER upstream returns headers but BEFORE
|
|
344
|
+
// `res.writeHead` fires (Seam: must not touch the body stream;
|
|
345
|
+
// logging post-pipe risks hanging the response on a sync exception
|
|
346
|
+
// in the logger). Captures the electric-* response headers to
|
|
347
|
+
// disambiguate offset-cursor staleness from handle eviction.
|
|
348
|
+
if (shapeDebugEnabled) {
|
|
349
|
+
const elapsedMs = Math.round(performance.now() - upstreamStartedAt);
|
|
350
|
+
shapeLog(
|
|
351
|
+
`[plan-chat-service:shape] ← upstream ${upstreamRes.status} ${elapsedMs}ms`,
|
|
352
|
+
{
|
|
353
|
+
resHandle: upstreamRes.headers.get('electric-handle'),
|
|
354
|
+
resOffset: upstreamRes.headers.get('electric-offset'),
|
|
355
|
+
resUpToDate: upstreamRes.headers.get('electric-up-to-date'),
|
|
356
|
+
resSchema: upstreamRes.headers.get('electric-schema'),
|
|
357
|
+
},
|
|
358
|
+
);
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
// Forward every upstream `electric-*` header BEFORE the stream starts.
|
|
362
|
+
// Once `res.writeHead` fires, headers are locked.
|
|
363
|
+
//
|
|
364
|
+
// Phase B B4 (olam-spa-electric-subscription-staleness) — prefix-match
|
|
365
|
+
// the entire `electric-*` namespace upstream owns instead of a static
|
|
366
|
+
// four-header whitelist. ElectricSQL 1.6.3 added `electric-cursor` to
|
|
367
|
+
// the live-mode response contract; the old whitelist dropped it; the
|
|
368
|
+
// SPA's TanStack Electric collection raised `MissingHeadersError` and
|
|
369
|
+
// stopped processing the long-poll stream. Mirror-all-electric closes
|
|
370
|
+
// the class — any future header upstream adds inside this namespace
|
|
371
|
+
// flows through with zero proxy changes. See plan
|
|
372
|
+
// `~/.claude/plans/olam-spa-electric-subscription-staleness.md` § Phase B
|
|
373
|
+
// and Phase A A3 evidence at
|
|
374
|
+
// `docs/screenshots/olam-spa-electric-subscription-staleness/a3-evidence-2026-05-18/`.
|
|
375
|
+
for (const [header, value] of upstreamRes.headers) {
|
|
376
|
+
if (header.toLowerCase().startsWith('electric-')) {
|
|
377
|
+
res.setHeader(header, value);
|
|
378
|
+
}
|
|
306
379
|
}
|
|
307
380
|
const upstreamContentType = upstreamRes.headers.get('content-type');
|
|
308
381
|
if (upstreamContentType) res.setHeader('content-type', upstreamContentType);
|
|
@@ -360,11 +433,22 @@ export async function startService(opts = {}) {
|
|
|
360
433
|
opts.databaseUrl ?? process.env.OLAM_PLAN_CHAT_DATABASE_URL ?? DEFAULT_DB_URL;
|
|
361
434
|
const electricUrl =
|
|
362
435
|
opts.electricUrl ?? process.env.OLAM_PLAN_CHAT_ELECTRIC_URL ?? DEFAULT_ELECTRIC_URL;
|
|
436
|
+
// Layered defense: SECRET_PATH (imported above) is itself env-aware at
|
|
437
|
+
// module load. Reading OLAM_PLAN_CHAT_SECRET_PATH here too lets explicit
|
|
438
|
+
// opts.secretPath callers and env-changes-since-import still win. Do not
|
|
439
|
+
// collapse either layer — direct callers in server.mjs (readPlanChatSecret
|
|
440
|
+
// with no arg) rely on the module-const path being env-aware.
|
|
363
441
|
const secretPath = opts.secretPath ?? process.env.OLAM_PLAN_CHAT_SECRET_PATH ?? SECRET_PATH;
|
|
364
442
|
const bearer = opts.bearer ?? ensureSecret(secretPath);
|
|
365
443
|
|
|
366
444
|
const pool = opts.pool ?? new pg.Pool({ connectionString: databaseUrl, max: 8 });
|
|
367
|
-
const handler = createHandler({
|
|
445
|
+
const handler = createHandler({
|
|
446
|
+
pool,
|
|
447
|
+
bearer,
|
|
448
|
+
electricUrl,
|
|
449
|
+
shapeDebug: opts.shapeDebug,
|
|
450
|
+
shapeDebugLog: opts.shapeDebugLog,
|
|
451
|
+
});
|
|
368
452
|
const server = http.createServer((req, res) => {
|
|
369
453
|
handler(req, res).catch((err) => {
|
|
370
454
|
try {
|
|
@@ -374,7 +458,24 @@ export async function startService(opts = {}) {
|
|
|
374
458
|
});
|
|
375
459
|
|
|
376
460
|
await new Promise((resolve, reject) => {
|
|
377
|
-
server.once('error',
|
|
461
|
+
server.once('error', (err) => {
|
|
462
|
+
if (err && err.code === 'EADDRINUSE') {
|
|
463
|
+
// A3 — port-collision diagnostic. Prevents silent half-start when the
|
|
464
|
+
// target port is held by another process. agentmemory's `iii` has
|
|
465
|
+
// historically claimed 3111-3113 (motivated the 3112 → 3200 move in
|
|
466
|
+
// olam-chunks-subscriber-long-poll Phase A); flag it so the next
|
|
467
|
+
// collision is debuggable in one log line, not three rounds of grep.
|
|
468
|
+
// eslint-disable-next-line no-console
|
|
469
|
+
console.error(`[plan-chat-service] EADDRINUSE on :${port} — port already in use.`);
|
|
470
|
+
// eslint-disable-next-line no-console
|
|
471
|
+
console.error(`[plan-chat-service] Check: lsof -i:${port}`);
|
|
472
|
+
// eslint-disable-next-line no-console
|
|
473
|
+
console.error(`[plan-chat-service] Note: agentmemory's iii claims 3111-3113 (motivated 3112 → 3200 move).`);
|
|
474
|
+
// eslint-disable-next-line no-console
|
|
475
|
+
console.error(`[plan-chat-service] Override: OLAM_PLAN_CHAT_PORT=<free-port>`);
|
|
476
|
+
}
|
|
477
|
+
reject(err);
|
|
478
|
+
});
|
|
378
479
|
server.listen(port, () => resolve(undefined));
|
|
379
480
|
});
|
|
380
481
|
|
package/host-cp/src/server.mjs
CHANGED
|
@@ -95,14 +95,26 @@ const WORLD_HOST = HOST_CP_MODE === 'container' ? 'host.docker.internal' : '127.
|
|
|
95
95
|
const HOST_CP_ENGINE = resolveHostCpEngine();
|
|
96
96
|
|
|
97
97
|
const PORT = parseInt(process.env.OLAM_HOST_CP_PORT ?? '19000', 10);
|
|
98
|
-
//
|
|
99
|
-
//
|
|
100
|
-
//
|
|
101
|
-
//
|
|
102
|
-
//
|
|
103
|
-
//
|
|
98
|
+
// D1 (Phase 2 Phase D) — substrate-conditional docker socket transport.
|
|
99
|
+
//
|
|
100
|
+
// Compose substrate (HOST_CP_ENGINE === 'docker', container mode):
|
|
101
|
+
// tcp://docker-socket-proxy:2375 — the compose sidecar enforces the
|
|
102
|
+
// read-only API allow-list. Zero behavior change from pre-D1.
|
|
103
|
+
//
|
|
104
|
+
// Kubernetes substrate (HOST_CP_ENGINE === 'kubernetes'):
|
|
105
|
+
// unix:///var/run/docker.sock — direct hostPath bind-mount per Decision #3
|
|
106
|
+
// (architecture a2). The init container (socket-perm) chmods the socket
|
|
107
|
+
// to 666 before the main container starts (Decision #15).
|
|
108
|
+
//
|
|
109
|
+
// Bare-node mode (HOST_CP_MODE !== 'container'):
|
|
110
|
+
// 'docker-cli' — sentinel that triggers docker-exec path in
|
|
111
|
+
// fetchContainerSecret (bare-node safeguard, unchanged).
|
|
104
112
|
const DOCKER_HOST = process.env.DOCKER_HOST
|
|
105
|
-
?? (HOST_CP_MODE
|
|
113
|
+
?? (HOST_CP_MODE !== 'container'
|
|
114
|
+
? 'docker-cli'
|
|
115
|
+
: HOST_CP_ENGINE === 'kubernetes'
|
|
116
|
+
? 'unix:///var/run/docker.sock'
|
|
117
|
+
: 'tcp://docker-socket-proxy:2375');
|
|
106
118
|
const TTL_SEC = parseInt(process.env.OLAM_SECRET_CACHE_TTL_SEC ?? '300', 10);
|
|
107
119
|
const HOST_FOR_WORLD = process.env.OLAM_HOST_FOR_WORLD ?? WORLD_HOST;
|
|
108
120
|
const TOKEN_PATH = process.env.OLAM_HOST_CP_TOKEN_PATH ?? '/data/host-cp.token';
|
|
@@ -1921,7 +1933,7 @@ const server = http.createServer(async (req, res) => {
|
|
|
1921
1933
|
// the host-cp service name. Default: host.docker.internal for the
|
|
1922
1934
|
// operator-local demo flow.
|
|
1923
1935
|
const hostCpUrlForContainer =
|
|
1924
|
-
process.env.OLAM_AGENT_RUNTIME_HOST_CP_URL ?? 'http://host.docker.internal:
|
|
1936
|
+
process.env.OLAM_AGENT_RUNTIME_HOST_CP_URL ?? 'http://host.docker.internal:3200';
|
|
1925
1937
|
try {
|
|
1926
1938
|
const result = await triggerAgentRuntime({
|
|
1927
1939
|
worldId: body.worldId,
|
|
@@ -1940,7 +1952,7 @@ const server = http.createServer(async (req, res) => {
|
|
|
1940
1952
|
}
|
|
1941
1953
|
|
|
1942
1954
|
// /api/plan-chat/* — passthrough proxy to plan-chat-service.
|
|
1943
|
-
// The sidecar runs on PLAN_CHAT_SERVICE_URL (default http://127.0.0.1:
|
|
1955
|
+
// The sidecar runs on PLAN_CHAT_SERVICE_URL (default http://127.0.0.1:3200).
|
|
1944
1956
|
// Strips the /api/plan-chat prefix; forwards method, headers, body, and
|
|
1945
1957
|
// query verbatim. Streams the response (Electric SQL long-poll friendly).
|
|
1946
1958
|
// Auth: client supplies Bearer; we don't add or strip it.
|
|
@@ -1950,8 +1962,8 @@ const server = http.createServer(async (req, res) => {
|
|
|
1950
1962
|
// Default depends on where host-cp runs. In-container = host.docker.internal;
|
|
1951
1963
|
// bare-node = 127.0.0.1. DOCKER_HOST=tcp://* implies container mode.
|
|
1952
1964
|
((process.env.DOCKER_HOST ?? '').startsWith('tcp://')
|
|
1953
|
-
? 'http://host.docker.internal:
|
|
1954
|
-
: 'http://127.0.0.1:
|
|
1965
|
+
? 'http://host.docker.internal:3200'
|
|
1966
|
+
: 'http://127.0.0.1:3200');
|
|
1955
1967
|
const subPath = url.pathname === '/api/plan-chat'
|
|
1956
1968
|
? '/'
|
|
1957
1969
|
: url.pathname.slice('/api/plan-chat'.length);
|
|
@@ -145,13 +145,18 @@ export async function spawnUpgraderContainer({
|
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
// Bare-node (operator's host docker CLI on PATH) is documented but
|
|
148
|
-
// out of scope for the trigger feature —
|
|
149
|
-
// (compose stack
|
|
148
|
+
// out of scope for the trigger feature — container + unix-socket paths
|
|
149
|
+
// are supported (compose stack and k8s hostPath socket mount).
|
|
150
150
|
if (dockerHost === 'docker-cli') {
|
|
151
|
-
// The
|
|
152
|
-
// the deployment
|
|
151
|
+
// The literals below (`unix:///var/run/docker.sock` and `tcp://docker-socket-proxy:2375`)
|
|
152
|
+
// are diagnostic text naming the deployment shapes that ARE supported,
|
|
153
|
+
// not hostnames being used as transport — error-message-only.
|
|
153
154
|
throw new Error(
|
|
154
|
-
'upgrade-trigger requires
|
|
155
|
+
'upgrade-trigger requires a docker socket (unix:///var/run/docker.sock via k8s hostPath mount, ' + // bare-node-allow: diagnostic-text
|
|
156
|
+
'or tcp://docker-socket-proxy:2375 via compose); bare-node not yet supported. ' + // bare-node-allow: diagnostic-text
|
|
157
|
+
'For k8s: ensure the cluster was created with ' +
|
|
158
|
+
'--volume /var/run/docker.sock:/var/run/docker.sock@server:* ' +
|
|
159
|
+
'and olam doctor reports probeDockerSocketBindMount [PASS].',
|
|
155
160
|
);
|
|
156
161
|
}
|
|
157
162
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pleri/olam-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.150",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"olam": "./bin/olam.cjs"
|
|
@@ -32,7 +32,8 @@
|
|
|
32
32
|
"test:ci": "vitest run --reporter=basic --passWithNoTests",
|
|
33
33
|
"test:docker": "vitest run --config vitest.config.docker.ts",
|
|
34
34
|
"audit:publish-deps": "node scripts/audit-publish-deps.mjs",
|
|
35
|
-
"audit:cli-bundle-k8s": "node scripts/audit-cli-bundle-k8s.mjs"
|
|
35
|
+
"audit:cli-bundle-k8s": "node scripts/audit-cli-bundle-k8s.mjs",
|
|
36
|
+
"audit:cli-package-contents": "node scripts/audit-cli-package-contents.mjs"
|
|
36
37
|
},
|
|
37
38
|
"dependencies": {
|
|
38
39
|
"better-sqlite3": "^12.0.0",
|
|
@@ -43,6 +44,7 @@
|
|
|
43
44
|
"picocolors": "^1.1.0",
|
|
44
45
|
"ssh2": "^1.16.0",
|
|
45
46
|
"yaml": "^2.7.0",
|
|
47
|
+
"@inquirer/prompts": "^7.0.0",
|
|
46
48
|
"zod-to-json-schema": "^3.24.0",
|
|
47
49
|
"playwright-core": "~1.59.0",
|
|
48
50
|
"@napi-rs/keyring": "^1.1.6",
|