@lunora/cli 1.0.0-alpha.29 → 1.0.0-alpha.30
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { spawn } from 'node:child_process';
|
|
2
|
-
import { detectAgentRules, resolveRemoteEnabled, readProjectRemotePreference, inferLunoraBindings, packageNamesFromBindings, ensureDevVarsExample, ensureDevVariables, isInteractive, DEV_VARS_FILE, DEV_VARS_EXAMPLE_FILE, fillDevSecrets, claimAgentRulesHint, AGENT_RULES_HINT, materializeRemoteWranglerConfig, formatLunoraEvent } from '@lunora/config';
|
|
2
|
+
import { detectAgentRules, resolveRemoteEnabled, readProjectRemotePreference, inferLunoraBindings, packageNamesFromBindings, ensureDevVarsExample, ensureDevVariables, isInteractive, DEV_VARS_FILE, DEV_VARS_EXAMPLE_FILE, fillDevSecrets, discoverContainerInfo, streamContainerLogs, claimAgentRulesHint, AGENT_RULES_HINT, materializeRemoteWranglerConfig, formatLunoraEvent } from '@lunora/config';
|
|
3
3
|
import { p as parseApiSpec } from '../packem_shared/api-spec-CtA6ilu4.mjs';
|
|
4
4
|
import { existsSync, watch } from 'node:fs';
|
|
5
5
|
import { join } from 'node:path';
|
|
@@ -379,8 +379,35 @@ const printAgentRulesHint = (logger, cwd) => {
|
|
|
379
379
|
logger.info(` ⓘ ${AGENT_RULES_HINT}`);
|
|
380
380
|
logger.info("");
|
|
381
381
|
};
|
|
382
|
+
const startContainerLogStreaming = (cwd, logger) => {
|
|
383
|
+
if (process.env.LUNORA_CONTAINER_LOGS === "0") {
|
|
384
|
+
return void 0;
|
|
385
|
+
}
|
|
386
|
+
const discovery = discoverContainerInfo(cwd, "lunora");
|
|
387
|
+
const containers = discovery.containers.map((container) => {
|
|
388
|
+
return { className: container.className, exportName: container.exportName };
|
|
389
|
+
});
|
|
390
|
+
if (containers.length === 0) {
|
|
391
|
+
return void 0;
|
|
392
|
+
}
|
|
393
|
+
return streamContainerLogs({
|
|
394
|
+
containers,
|
|
395
|
+
onLine: (line) => {
|
|
396
|
+
const tagged = `[container:${line.name}] ${line.text}`;
|
|
397
|
+
if (line.level === "error") {
|
|
398
|
+
logger.warn(tagged);
|
|
399
|
+
} else {
|
|
400
|
+
logger.info(tagged);
|
|
401
|
+
}
|
|
402
|
+
},
|
|
403
|
+
onUnavailable: (message) => {
|
|
404
|
+
logger.warn(`[container] Docker engine unreachable — container logs unavailable (${message})`);
|
|
405
|
+
}
|
|
406
|
+
});
|
|
407
|
+
};
|
|
382
408
|
const teardown = async (handles) => {
|
|
383
409
|
handles.codegen?.close();
|
|
410
|
+
handles.containerLogs?.close();
|
|
384
411
|
await handles.studio?.close().catch(() => void 0);
|
|
385
412
|
try {
|
|
386
413
|
handles.remoteCleanup?.();
|
|
@@ -449,6 +476,10 @@ const runDevCommand = async (options) => {
|
|
|
449
476
|
}
|
|
450
477
|
}
|
|
451
478
|
const worker = (options.startWorker ?? defaultWorkerSpawner)(plan.wrangler, logger);
|
|
479
|
+
try {
|
|
480
|
+
handles.containerLogs = startContainerLogStreaming(cwd, logger);
|
|
481
|
+
} catch {
|
|
482
|
+
}
|
|
452
483
|
printBanner(logger, plan, studioUrl);
|
|
453
484
|
printAgentRulesHint(logger, cwd);
|
|
454
485
|
let sigintCount = 0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/cli",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.30",
|
|
4
4
|
"description": "The Lunora CLI: init, dev, deploy, codegen, run, reset, and migrate commands",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent-skills",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@bomb.sh/tab": "0.0.16",
|
|
55
55
|
"@lunora/codegen": "1.0.0-alpha.12",
|
|
56
|
-
"@lunora/config": "1.0.0-alpha.
|
|
56
|
+
"@lunora/config": "1.0.0-alpha.19",
|
|
57
57
|
"@lunora/container": "1.0.0-alpha.4",
|
|
58
58
|
"@lunora/d1": "1.0.0-alpha.7",
|
|
59
59
|
"@lunora/seed": "1.0.0-alpha.5",
|