@telorun/cli 0.2.4 → 0.2.6
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/cli.d.ts +1 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +9 -128
- package/dist/cli.js.map +1 -1
- package/dist/commands/check.d.ts +6 -0
- package/dist/commands/check.d.ts.map +1 -0
- package/dist/commands/check.js +92 -0
- package/dist/commands/check.js.map +1 -0
- package/dist/commands/publish.d.ts +7 -0
- package/dist/commands/publish.d.ts.map +1 -0
- package/dist/commands/publish.js +85 -0
- package/dist/commands/publish.js.map +1 -0
- package/dist/commands/run.d.ts +10 -0
- package/dist/commands/run.d.ts.map +1 -0
- package/dist/commands/run.js +178 -0
- package/dist/commands/run.js.map +1 -0
- package/dist/logger.d.ts +12 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +21 -0
- package/dist/logger.js.map +1 -0
- package/package.json +4 -2
package/dist/cli.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli.js
CHANGED
|
@@ -1,135 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { Kernel } from "@telorun/kernel";
|
|
3
|
-
import * as fs from "fs";
|
|
4
|
-
import * as path from "path";
|
|
5
2
|
import yargs from "yargs";
|
|
6
3
|
import { hideBin } from "yargs/helpers";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
info: (...args) => console.log(...args),
|
|
12
|
-
ok: (text) => wrap("32", text),
|
|
13
|
-
warn: (text) => wrap("33", text),
|
|
14
|
-
error: (text) => wrap("31", text),
|
|
15
|
-
dim: (text) => wrap("2", text),
|
|
16
|
-
verbose,
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
function setupWatchMode(kernel, log) {
|
|
20
|
-
const watchers = new Map();
|
|
21
|
-
const debounceTimers = new Map();
|
|
22
|
-
let active = true;
|
|
23
|
-
function watchFile(filePath) {
|
|
24
|
-
if (!active || watchers.has(filePath))
|
|
25
|
-
return;
|
|
26
|
-
let watcher;
|
|
27
|
-
try {
|
|
28
|
-
watcher = fs.watch(filePath, { persistent: false }, () => {
|
|
29
|
-
const existing = debounceTimers.get(filePath);
|
|
30
|
-
if (existing)
|
|
31
|
-
clearTimeout(existing);
|
|
32
|
-
debounceTimers.set(filePath, setTimeout(() => {
|
|
33
|
-
debounceTimers.delete(filePath);
|
|
34
|
-
watchers.get(filePath)?.close();
|
|
35
|
-
watchers.delete(filePath);
|
|
36
|
-
void handleChange(filePath);
|
|
37
|
-
}, 150));
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
catch {
|
|
41
|
-
return; // file may not exist yet
|
|
42
|
-
}
|
|
43
|
-
watcher.on("error", () => watchers.delete(filePath));
|
|
44
|
-
watchers.set(filePath, watcher);
|
|
45
|
-
}
|
|
46
|
-
async function handleChange(filePath) {
|
|
47
|
-
log.info(`[watch] reloading ${filePath}`);
|
|
48
|
-
try {
|
|
49
|
-
await kernel.reloadSource(filePath);
|
|
50
|
-
// Refresh watchers — new files may have been loaded after reload
|
|
51
|
-
for (const f of kernel.getSourceFiles())
|
|
52
|
-
watchFile(f);
|
|
53
|
-
log.info(log.ok(`[watch] complete`));
|
|
54
|
-
}
|
|
55
|
-
catch (err) {
|
|
56
|
-
log.info(log.error(`[watch] error: ${err instanceof Error ? err.message : String(err)}`));
|
|
57
|
-
}
|
|
58
|
-
// Re-establish watcher regardless of outcome (handles atomic rename saves)
|
|
59
|
-
setTimeout(() => {
|
|
60
|
-
if (active)
|
|
61
|
-
watchFile(filePath);
|
|
62
|
-
}, 50);
|
|
63
|
-
}
|
|
64
|
-
function cleanup() {
|
|
65
|
-
active = false;
|
|
66
|
-
for (const t of debounceTimers.values())
|
|
67
|
-
clearTimeout(t);
|
|
68
|
-
debounceTimers.clear();
|
|
69
|
-
for (const w of watchers.values())
|
|
70
|
-
w.close();
|
|
71
|
-
watchers.clear();
|
|
72
|
-
}
|
|
73
|
-
for (const f of kernel.getSourceFiles())
|
|
74
|
-
watchFile(f);
|
|
75
|
-
return { cleanup };
|
|
76
|
-
}
|
|
77
|
-
async function run(argv) {
|
|
78
|
-
const log = createLogger(argv.verbose);
|
|
79
|
-
try {
|
|
80
|
-
const kernel = new Kernel();
|
|
81
|
-
if (argv.verbose) {
|
|
82
|
-
kernel.on("*", (event) => {
|
|
83
|
-
log.info(`${event.name}: ${JSON.stringify(event.payload)}`);
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
if (argv.debug) {
|
|
87
|
-
const debugDir = path.join(process.cwd(), ".telo-debug");
|
|
88
|
-
const eventStreamPath = path.join(debugDir, "events.jsonl");
|
|
89
|
-
await kernel.enableEventStream(eventStreamPath);
|
|
90
|
-
log.info(`Event stream enabled: ${eventStreamPath}`);
|
|
91
|
-
}
|
|
92
|
-
let watchHandle = null;
|
|
93
|
-
if (argv.watch) {
|
|
94
|
-
// Acquire a hold BEFORE start() to keep the kernel alive for apps that
|
|
95
|
-
// don't have their own holds (e.g. script-only manifests).
|
|
96
|
-
// shutdown() will force-resolve waitForIdle() on Ctrl+C regardless of
|
|
97
|
-
// how many holds are active (e.g. Http.Server may hold its own).
|
|
98
|
-
kernel.acquireHold("watch-mode");
|
|
99
|
-
kernel.on("Runtime.Started", () => {
|
|
100
|
-
const files = kernel.getSourceFiles();
|
|
101
|
-
log.info(`[watch] watching ${files.length} file(s)`);
|
|
102
|
-
watchHandle = setupWatchMode(kernel, log);
|
|
103
|
-
});
|
|
104
|
-
const shutdown = () => {
|
|
105
|
-
log.info("\n[watch] stopping...");
|
|
106
|
-
watchHandle?.cleanup();
|
|
107
|
-
kernel.shutdown();
|
|
108
|
-
};
|
|
109
|
-
process.once("SIGINT", shutdown);
|
|
110
|
-
process.once("SIGTERM", shutdown);
|
|
111
|
-
}
|
|
112
|
-
await kernel.loadFromConfig(argv.path);
|
|
113
|
-
await kernel.start();
|
|
114
|
-
if (kernel.exitCode !== 0) {
|
|
115
|
-
process.exit(kernel.exitCode);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
catch (error) {
|
|
119
|
-
console.error("Error loading runtime:", error instanceof Error ? error.stack : String(error));
|
|
120
|
-
process.exit(1);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
yargs(hideBin(process.argv))
|
|
4
|
+
import { checkCommand } from "./commands/check.js";
|
|
5
|
+
import { publishCommand } from "./commands/publish.js";
|
|
6
|
+
import { runCommand } from "./commands/run.js";
|
|
7
|
+
let cli = yargs(hideBin(process.argv))
|
|
124
8
|
.scriptName("telo")
|
|
125
|
-
.usage("$0 <command> [options]")
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}), async (argv) => {
|
|
131
|
-
await run(argv);
|
|
132
|
-
})
|
|
9
|
+
.usage("$0 <command> [options]");
|
|
10
|
+
cli = checkCommand(cli);
|
|
11
|
+
cli = publishCommand(cli);
|
|
12
|
+
cli = runCommand(cli);
|
|
13
|
+
cli
|
|
133
14
|
.option("verbose", {
|
|
134
15
|
type: "boolean",
|
|
135
16
|
default: false,
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/C,IAA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Ae9C"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { DiagnosticSeverity, Loader, NodeAdapter, StaticAnalyzer } from "@telorun/analyzer";
|
|
2
|
+
import * as path from "path";
|
|
3
|
+
import { createLogger, formatDiagnostics } from "../logger.js";
|
|
4
|
+
async function checkOne(inputPath, log) {
|
|
5
|
+
const isUrl = inputPath.startsWith("http://") || inputPath.startsWith("https://");
|
|
6
|
+
const entryPath = isUrl ? inputPath : path.resolve(process.cwd(), inputPath);
|
|
7
|
+
const cwd = isUrl ? process.cwd() : path.dirname(entryPath);
|
|
8
|
+
const loader = new Loader([new NodeAdapter(cwd)]);
|
|
9
|
+
let manifests;
|
|
10
|
+
try {
|
|
11
|
+
manifests = await loader.loadManifests(entryPath);
|
|
12
|
+
}
|
|
13
|
+
catch (err) {
|
|
14
|
+
const sourceLine = err.sourceLine;
|
|
15
|
+
const displayPath = isUrl ? entryPath : path.relative(process.cwd(), entryPath);
|
|
16
|
+
const loc = sourceLine !== undefined ? `:${sourceLine + 1}` : "";
|
|
17
|
+
formatDiagnostics([{ message: err instanceof Error ? err.message : String(err) }], log, `${displayPath}${loc}`);
|
|
18
|
+
return { errorCount: 1, warnCount: 0 };
|
|
19
|
+
}
|
|
20
|
+
const diagnostics = new StaticAnalyzer().analyze(manifests);
|
|
21
|
+
const manifestByKey = new Map();
|
|
22
|
+
for (const m of manifests) {
|
|
23
|
+
if (m.kind && m.metadata?.name) {
|
|
24
|
+
manifestByKey.set(`${m.kind}.${m.metadata.name}`, m);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
let errorCount = 0;
|
|
28
|
+
let warnCount = 0;
|
|
29
|
+
for (const d of diagnostics) {
|
|
30
|
+
const resource = d.data?.resource;
|
|
31
|
+
const m = resource ? manifestByKey.get(`${resource.kind}.${resource.name}`) : undefined;
|
|
32
|
+
const absSource = m?.metadata?.source;
|
|
33
|
+
const displaySource = absSource
|
|
34
|
+
? isUrl
|
|
35
|
+
? absSource
|
|
36
|
+
: path.relative(process.cwd(), absSource)
|
|
37
|
+
: isUrl
|
|
38
|
+
? entryPath
|
|
39
|
+
: path.relative(process.cwd(), entryPath);
|
|
40
|
+
const sourceLine = m?.metadata?.sourceLine;
|
|
41
|
+
const positionIndex = m?.metadata?.positionIndex;
|
|
42
|
+
const fieldPath = d.data?.path;
|
|
43
|
+
const fieldRange = fieldPath !== undefined && positionIndex ? positionIndex.get(fieldPath) : undefined;
|
|
44
|
+
const line = (fieldRange?.start.line ?? sourceLine ?? 0) + 1;
|
|
45
|
+
const col = (fieldRange?.start.character ?? 0) + 1;
|
|
46
|
+
const loc = `${displaySource}:${line}:${col}`;
|
|
47
|
+
const severityLabel = (d.severity ?? DiagnosticSeverity.Warning) <= DiagnosticSeverity.Error
|
|
48
|
+
? log.error("error")
|
|
49
|
+
: log.warn("warning");
|
|
50
|
+
const code = d.code ? ` ${log.dim(String(d.code))}` : "";
|
|
51
|
+
console.log(`${loc} ${severityLabel} ${d.message}${code}`);
|
|
52
|
+
if ((d.severity ?? DiagnosticSeverity.Warning) <= DiagnosticSeverity.Error)
|
|
53
|
+
errorCount++;
|
|
54
|
+
else
|
|
55
|
+
warnCount++;
|
|
56
|
+
}
|
|
57
|
+
return { errorCount, warnCount };
|
|
58
|
+
}
|
|
59
|
+
export async function check(argv) {
|
|
60
|
+
const log = createLogger(false);
|
|
61
|
+
let totalErrors = 0;
|
|
62
|
+
let totalWarns = 0;
|
|
63
|
+
for (const p of argv.paths) {
|
|
64
|
+
const { errorCount, warnCount } = await checkOne(p, log);
|
|
65
|
+
totalErrors += errorCount;
|
|
66
|
+
totalWarns += warnCount;
|
|
67
|
+
}
|
|
68
|
+
if (totalErrors === 0 && totalWarns === 0) {
|
|
69
|
+
console.log(log.ok("✓") + " No issues found");
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
const parts = [];
|
|
73
|
+
if (totalErrors > 0)
|
|
74
|
+
parts.push(log.error(`${totalErrors} error${totalErrors !== 1 ? "s" : ""}`));
|
|
75
|
+
if (totalWarns > 0)
|
|
76
|
+
parts.push(log.warn(`${totalWarns} warning${totalWarns !== 1 ? "s" : ""}`));
|
|
77
|
+
console.log(`\n${parts.join(", ")}`);
|
|
78
|
+
}
|
|
79
|
+
if (totalErrors > 0)
|
|
80
|
+
process.exit(1);
|
|
81
|
+
}
|
|
82
|
+
export function checkCommand(yargs) {
|
|
83
|
+
return yargs.command("check <paths..>", "Check one or more Telo manifests for errors without running them", (y) => y.positional("paths", {
|
|
84
|
+
describe: "Paths to YAML manifests, directories containing module.yaml, or HTTP(S) URLs",
|
|
85
|
+
type: "string",
|
|
86
|
+
array: true,
|
|
87
|
+
demandOption: true,
|
|
88
|
+
}), async (argv) => {
|
|
89
|
+
await check(argv);
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check.js","sourceRoot":"","sources":["../../src/commands/check.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAC5F,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAe,MAAM,cAAc,CAAC;AAE5E,KAAK,UAAU,QAAQ,CACrB,SAAiB,EACjB,GAAW;IAEX,MAAM,KAAK,GAAG,SAAS,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IAClF,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,SAAS,CAAC,CAAC;IAC7E,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,O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|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../src/commands/publish.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAoElC,wBAAsB,OAAO,CAAC,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CASxF;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,IAAI,GAAG,IAAI,CAqBhD"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import * as fs from "fs";
|
|
2
|
+
import * as path from "path";
|
|
3
|
+
import { createLogger } from "../logger.js";
|
|
4
|
+
async function publishOne(filePath, registry, log) {
|
|
5
|
+
let content;
|
|
6
|
+
try {
|
|
7
|
+
content = fs.readFileSync(filePath, "utf-8");
|
|
8
|
+
}
|
|
9
|
+
catch {
|
|
10
|
+
console.error(log.error("error") + ` Cannot read file: ${filePath}`);
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
// Parse first YAML document to extract metadata
|
|
14
|
+
const firstDoc = content.split(/^---$/m)[0].trim() || content.split(/^---\n/m)[1]?.trim() || content;
|
|
15
|
+
const nsMatch = firstDoc.match(/^\s{2,4}namespace:\s*["']?([^\s"']+)["']?/m);
|
|
16
|
+
const nameMatch = firstDoc.match(/^\s{2,4}name:\s*["']?([^\s"']+)["']?/m);
|
|
17
|
+
const versionMatch = firstDoc.match(/^\s{2,4}version:\s*["']?([^\s"']+)["']?/m);
|
|
18
|
+
const namespace = nsMatch?.[1];
|
|
19
|
+
const name = nameMatch?.[1];
|
|
20
|
+
const version = versionMatch?.[1];
|
|
21
|
+
if (!namespace || !name || !version) {
|
|
22
|
+
console.error(log.error("error") +
|
|
23
|
+
` ${filePath}: metadata must include namespace, name, and version.\n` +
|
|
24
|
+
` Found: namespace=${namespace ?? "(missing)"}, name=${name ?? "(missing)"}, version=${version ?? "(missing)"}`);
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
const url = `${registry.replace(/\/$/, "")}/${namespace}/${name}/${version}`;
|
|
28
|
+
console.log(log.dim(`Publishing ${namespace}/${name}@${version} → ${url}`));
|
|
29
|
+
let res;
|
|
30
|
+
try {
|
|
31
|
+
res = await fetch(url, {
|
|
32
|
+
method: "PUT",
|
|
33
|
+
headers: { "content-type": "text/yaml" },
|
|
34
|
+
body: content,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
catch (err) {
|
|
38
|
+
console.error(log.error("error") + ` Network error: ${err instanceof Error ? err.message : String(err)}`);
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
let body;
|
|
42
|
+
const contentType = res.headers.get("content-type") ?? "";
|
|
43
|
+
if (contentType.includes("application/json")) {
|
|
44
|
+
body = await res.json();
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
body = await res.text();
|
|
48
|
+
}
|
|
49
|
+
if (!res.ok) {
|
|
50
|
+
console.error(log.error("error") + ` Publish failed (${res.status}): ${JSON.stringify(body)}`);
|
|
51
|
+
return false;
|
|
52
|
+
}
|
|
53
|
+
const published = body?.published ?? `${namespace}/${name}@${version}`;
|
|
54
|
+
console.log(log.ok("✓") + ` Published: ${published}`);
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
export async function publish(argv) {
|
|
58
|
+
const log = createLogger(false);
|
|
59
|
+
let failed = false;
|
|
60
|
+
for (const p of argv.paths) {
|
|
61
|
+
const filePath = path.resolve(process.cwd(), p);
|
|
62
|
+
const ok = await publishOne(filePath, argv.registry, log);
|
|
63
|
+
if (!ok)
|
|
64
|
+
failed = true;
|
|
65
|
+
}
|
|
66
|
+
if (failed)
|
|
67
|
+
process.exit(1);
|
|
68
|
+
}
|
|
69
|
+
export function publishCommand(yargs) {
|
|
70
|
+
return yargs.command("publish <paths..>", "Publish one or more module manifests to the Telo registry", (y) => y
|
|
71
|
+
.positional("paths", {
|
|
72
|
+
describe: "Paths to module.yaml files to publish",
|
|
73
|
+
type: "string",
|
|
74
|
+
array: true,
|
|
75
|
+
demandOption: true,
|
|
76
|
+
})
|
|
77
|
+
.option("registry", {
|
|
78
|
+
type: "string",
|
|
79
|
+
default: "https://registry.telo.run",
|
|
80
|
+
describe: "Registry base URL",
|
|
81
|
+
}), async (argv) => {
|
|
82
|
+
await publish(argv);
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=publish.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish.js","sourceRoot":"","sources":["../../src/commands/publish.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,OAAO,EAAE,YAAY,EAAe,MAAM,cAAc,CAAC;AAEzD,KAAK,UAAU,UAAU,CAAC,QAAgB,EAAE,QAAgB,EAAE,GAAW;IACvE,IAAI,OAAe,CAAC;IACpB,IAAI,CAAC;QACH,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC/C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,uBAAuB,QAAQ,EAAE,CAAC,CAAC;QACtE,OAAO,KAAK,CAAC;IACf,CAAC;IAED,gDAAgD;IAChD,MAAM,QAAQ,GACZ,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,OAAO,CAAC;IAEtF,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,4CAA4C,CAAC,CAAC;IAC7E,MAAM,SAAS,GAAG,QAA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,EAAE,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;QAC1D,IAAI,CAAC,EAAE;YAAE,MAAM,GAAG,IAAI,CAAC;IACzB,CAAC;IACD,IAAI,MAAM;QAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAC9B,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,KAAW;IACxC,OAAO,KAAK,CAAC,OAAO,CAClB,mBAAmB,EACnB,2DAA2D,EAC3D,CAAC,CAAC,EAAE,EAAE,CACJ,CAAC;SACE,UAAU,CAAC,OAAO,EAAE;QACnB,QAAQ,EAAE,uCAAuC;QACjD,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,IAAI;QACX,YAAY,EAAE,IAAI;KACnB,CAAC;SACD,MAAM,CAAC,UAAU,EAAE;QAClB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,2BAA2B;QACpC,QAAQ,EAAE,mBAAmB;KAC9B,CAAC,EACN,KAAK,EAAE,IAAI,EAAE,EAAE;QACb,MAAM,OAAO,CAAC,IAAW,CAAC,CAAC;IAC7B,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Argv } from "yargs";
|
|
2
|
+
export declare function run(argv: {
|
|
3
|
+
path: string;
|
|
4
|
+
verbose: boolean;
|
|
5
|
+
debug: boolean;
|
|
6
|
+
snapshotOnExit: boolean;
|
|
7
|
+
watch: boolean;
|
|
8
|
+
}): Promise<void>;
|
|
9
|
+
export declare function runCommand(yargs: Argv): Argv;
|
|
10
|
+
//# sourceMappingURL=run.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../../src/commands/run.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAiGlC,wBAAsB,GAAG,CAAC,IAAI,EAAE;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,cAAc,EAAE,OAAO,CAAC;IACxB,KAAK,EAAE,OAAO,CAAC;CAChB,GAAG,OAAO,CAAC,IAAI,CAAC,CAwEhB;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,IAAI,GAAG,IAAI,CAc5C"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { Kernel } from "@telorun/kernel";
|
|
2
|
+
import * as dotenv from "dotenv";
|
|
3
|
+
import * as fs from "fs";
|
|
4
|
+
import * as path from "path";
|
|
5
|
+
import { fileURLToPath } from "url";
|
|
6
|
+
import { createLogger, formatDiagnostics } from "../logger.js";
|
|
7
|
+
/**
|
|
8
|
+
* Load .env and .env.local from the manifest's directory into process.env.
|
|
9
|
+
* Priority (highest to lowest): process.env > .env.local > .env
|
|
10
|
+
* Keys already present in process.env are never overwritten.
|
|
11
|
+
*/
|
|
12
|
+
function loadEnvFiles(manifestPath) {
|
|
13
|
+
const dir = path.dirname(path.resolve(manifestPath));
|
|
14
|
+
const base = tryReadFile(path.join(dir, ".env"));
|
|
15
|
+
const local = tryReadFile(path.join(dir, ".env.local"));
|
|
16
|
+
const merged = { ...dotenv.parse(base), ...dotenv.parse(local) };
|
|
17
|
+
for (const [key, value] of Object.entries(merged)) {
|
|
18
|
+
if (!(key in process.env))
|
|
19
|
+
process.env[key] = value;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function tryReadFile(filePath) {
|
|
23
|
+
try {
|
|
24
|
+
return fs.readFileSync(filePath, "utf8");
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
return "";
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function setupWatchMode(kernel, log) {
|
|
31
|
+
const watchers = new Map();
|
|
32
|
+
const debounceTimers = new Map();
|
|
33
|
+
const reloading = new Set();
|
|
34
|
+
let active = true;
|
|
35
|
+
function watchFile(filePath) {
|
|
36
|
+
if (!active || watchers.has(filePath))
|
|
37
|
+
return;
|
|
38
|
+
// getSourceFiles() returns file:// URLs; fs.watch needs a filesystem path
|
|
39
|
+
const fsPath = filePath.startsWith("file://") ? fileURLToPath(filePath) : filePath;
|
|
40
|
+
let watcher;
|
|
41
|
+
try {
|
|
42
|
+
watcher = fs.watch(fsPath, () => {
|
|
43
|
+
if (!active)
|
|
44
|
+
return;
|
|
45
|
+
const existing = debounceTimers.get(filePath);
|
|
46
|
+
if (existing)
|
|
47
|
+
clearTimeout(existing);
|
|
48
|
+
debounceTimers.set(filePath, setTimeout(() => {
|
|
49
|
+
debounceTimers.delete(filePath);
|
|
50
|
+
void handleChange(filePath);
|
|
51
|
+
}, 150));
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
return; // file may not exist yet
|
|
56
|
+
}
|
|
57
|
+
watcher.on("error", () => {
|
|
58
|
+
// OS invalidated the watch (e.g. file deleted). Remove and re-establish.
|
|
59
|
+
if (watchers.get(filePath) === watcher) {
|
|
60
|
+
watchers.delete(filePath);
|
|
61
|
+
setTimeout(() => {
|
|
62
|
+
if (active)
|
|
63
|
+
watchFile(filePath);
|
|
64
|
+
}, 50);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
watchers.set(filePath, watcher);
|
|
68
|
+
}
|
|
69
|
+
async function handleChange(filePath) {
|
|
70
|
+
// Prevent concurrent reloads for the same file
|
|
71
|
+
if (reloading.has(filePath))
|
|
72
|
+
return;
|
|
73
|
+
reloading.add(filePath);
|
|
74
|
+
log.info(`[watch] reloading ${filePath}`);
|
|
75
|
+
try {
|
|
76
|
+
// await kernel.reloadSource(filePath);
|
|
77
|
+
// Watch any new files that appeared after reload
|
|
78
|
+
// for (const f of kernel.getSourceFiles()) watchFile(f);
|
|
79
|
+
log.info(log.ok(`[watch] complete`));
|
|
80
|
+
}
|
|
81
|
+
catch (err) {
|
|
82
|
+
log.info(log.error(`[watch] error: ${err instanceof Error ? err.message : String(err)}`));
|
|
83
|
+
}
|
|
84
|
+
finally {
|
|
85
|
+
reloading.delete(filePath);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function cleanup() {
|
|
89
|
+
active = false;
|
|
90
|
+
for (const t of debounceTimers.values())
|
|
91
|
+
clearTimeout(t);
|
|
92
|
+
debounceTimers.clear();
|
|
93
|
+
for (const w of watchers.values())
|
|
94
|
+
w.close();
|
|
95
|
+
watchers.clear();
|
|
96
|
+
}
|
|
97
|
+
// for (const f of kernel.getSourceFiles()) watchFile(f);
|
|
98
|
+
return { cleanup };
|
|
99
|
+
}
|
|
100
|
+
export async function run(argv) {
|
|
101
|
+
const log = createLogger(argv.verbose);
|
|
102
|
+
try {
|
|
103
|
+
const kernel = new Kernel();
|
|
104
|
+
if (argv.verbose) {
|
|
105
|
+
kernel.on("*", (event) => {
|
|
106
|
+
log.info(`${event.name}: ${JSON.stringify(event.payload)}`);
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
if (argv.debug) {
|
|
110
|
+
const debugDir = path.join(process.cwd(), ".telo-debug");
|
|
111
|
+
const eventStreamPath = path.join(debugDir, "events.jsonl");
|
|
112
|
+
await kernel.enableEventStream(eventStreamPath);
|
|
113
|
+
log.info(`Event stream enabled: ${eventStreamPath}`);
|
|
114
|
+
}
|
|
115
|
+
let watchHandle = null;
|
|
116
|
+
const shutdown = () => {
|
|
117
|
+
if (argv.watch)
|
|
118
|
+
log.info("\n[watch] stopping...");
|
|
119
|
+
watchHandle?.cleanup();
|
|
120
|
+
kernel.shutdown();
|
|
121
|
+
};
|
|
122
|
+
process.once("SIGINT", shutdown);
|
|
123
|
+
process.once("SIGTERM", shutdown);
|
|
124
|
+
if (argv.watch) {
|
|
125
|
+
// Acquire a hold BEFORE start() to keep the kernel alive for apps that
|
|
126
|
+
// don't have their own holds (e.g. script-only manifests).
|
|
127
|
+
// shutdown() will force-resolve waitForIdle() on Ctrl+C regardless of
|
|
128
|
+
// how many holds are active (e.g. Http.Server may hold its own).
|
|
129
|
+
kernel.acquireHold("watch-mode");
|
|
130
|
+
kernel.on("Kernel.Started", () => {
|
|
131
|
+
// const files = kernel.getSourceFiles();
|
|
132
|
+
// log.info(`[watch] watching ${files.length} file(s)`);
|
|
133
|
+
watchHandle = setupWatchMode(kernel, log);
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
loadEnvFiles(argv.path);
|
|
137
|
+
await kernel.loadFromConfig(argv.path);
|
|
138
|
+
await kernel.start();
|
|
139
|
+
if (kernel.exitCode !== 0) {
|
|
140
|
+
process.exit(kernel.exitCode);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
catch (error) {
|
|
144
|
+
const isUrl = argv.path.startsWith("http://") || argv.path.startsWith("https://");
|
|
145
|
+
const displayPath = isUrl
|
|
146
|
+
? argv.path
|
|
147
|
+
: path.relative(process.cwd(), path.resolve(process.cwd(), argv.path));
|
|
148
|
+
const attached = error?.diagnostics;
|
|
149
|
+
const diags = attached?.length
|
|
150
|
+
? attached
|
|
151
|
+
: [
|
|
152
|
+
{
|
|
153
|
+
message: error instanceof Error ? error.message : String(error),
|
|
154
|
+
code: error?.code,
|
|
155
|
+
},
|
|
156
|
+
];
|
|
157
|
+
formatDiagnostics(diags, log, displayPath);
|
|
158
|
+
const errorCount = diags.filter((d) => d.severity !== "warning").length;
|
|
159
|
+
const warnCount = diags.filter((d) => d.severity === "warning").length;
|
|
160
|
+
const parts = [];
|
|
161
|
+
if (errorCount > 0)
|
|
162
|
+
parts.push(log.error(`${errorCount} error${errorCount !== 1 ? "s" : ""}`));
|
|
163
|
+
if (warnCount > 0)
|
|
164
|
+
parts.push(log.warn(`${warnCount} warning${warnCount !== 1 ? "s" : ""}`));
|
|
165
|
+
console.error(`\n${parts.join(", ")}`);
|
|
166
|
+
process.exit(1);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
export function runCommand(yargs) {
|
|
170
|
+
return yargs.command(["run <path>", "$0 <path>"], "Run a Telo runtime from a manifest file or directory", (y) => y.positional("path", {
|
|
171
|
+
describe: "Path to YAML manifest, directory containing module.yaml, or HTTP(S) URL",
|
|
172
|
+
type: "string",
|
|
173
|
+
demandOption: true,
|
|
174
|
+
}), async (argv) => {
|
|
175
|
+
await run(argv);
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
//# sourceMappingURL=run.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../../src/commands/run.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAA0B,MAAM,iBAAiB,CAAC;AACjE,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAe,MAAM,cAAc,CAAC;AAE5E;;;;GAIG;AACH,SAAS,YAAY,CAAC,YAAoB;IACxC,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC;IACrD,MAAM,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC;IACjD,MAAM,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,YAAY,CAAC,CAAC,CAAC;IAExD,MAAM,MAAM,GAAG,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;IACjE,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAClD,IAAI,CAAC,CAAC,GAAG,IAAI,OAAO,CAAC,GAA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AAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACvC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,KAAW;IACpC,OAAO,KAAK,CAAC,OAAO,CAClB,CAAC,YAAY,EAAE,WAAW,CAAC,EAC3B,sDAAsD,EACtD,CAAC,CAAC,EAAE,EAAE,CACJ,CAAC,CAAC,UAAU,CAAC,MAAM,EAAE;QACnB,QAAQ,EAAE,yEAAyE;QACnF,IAAI,EAAE,QAAQ;QACd,YAAY,EAAE,IAAI;KACnB,CAAC,EACJ,KAAK,EAAE,IAAI,EAAE,EAAE;QACb,MAAM,GAAG,CAAC,IAAW,CAAC,CAAC;IACzB,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/dist/logger.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { RuntimeDiagnostic } from "@telorun/kernel";
|
|
2
|
+
export declare function createLogger(verbose: boolean): {
|
|
3
|
+
info: (...args: any[]) => void;
|
|
4
|
+
ok: (text: string) => string;
|
|
5
|
+
warn: (text: string) => string;
|
|
6
|
+
error: (text: string) => string;
|
|
7
|
+
dim: (text: string) => string;
|
|
8
|
+
verbose: boolean;
|
|
9
|
+
};
|
|
10
|
+
export type Logger = ReturnType<typeof createLogger>;
|
|
11
|
+
export declare function formatDiagnostics(diagnostics: RuntimeDiagnostic[], log: Logger, displayPath: string): void;
|
|
12
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO;oBAIzB,GAAG,EAAE;eACV,MAAM;iBACJ,MAAM;kBACL,MAAM;gBACR,MAAM;;EAGrB;AAED,MAAM,MAAM,MAAM,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;AAErD,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,iBAAiB,EAAE,EAChC,GAAG,EAAE,MAAM,EACX,WAAW,EAAE,MAAM,GAClB,IAAI,CAON"}
|
package/dist/logger.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export function createLogger(verbose) {
|
|
2
|
+
const useColor = process.stdout.isTTY;
|
|
3
|
+
const wrap = (code, text) => (useColor ? `\x1b[${code}m${text}\x1b[0m` : text);
|
|
4
|
+
return {
|
|
5
|
+
info: (...args) => console.log(...args),
|
|
6
|
+
ok: (text) => wrap("32", text),
|
|
7
|
+
warn: (text) => wrap("33", text),
|
|
8
|
+
error: (text) => wrap("31", text),
|
|
9
|
+
dim: (text) => wrap("2", text),
|
|
10
|
+
verbose,
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export function formatDiagnostics(diagnostics, log, displayPath) {
|
|
14
|
+
for (const d of diagnostics) {
|
|
15
|
+
const severityLabel = d.severity === "warning" ? log.warn("warning") : log.error("error");
|
|
16
|
+
const who = d.resource ? `${d.resource}: ` : "";
|
|
17
|
+
const code = d.code ? ` ${log.dim(d.code)}` : "";
|
|
18
|
+
console.error(`${displayPath} ${severityLabel} ${who}${d.message}${code}`);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,YAAY,CAAC,OAAgB;IAC3C,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC;IACtC,MAAM,IAAI,GAAG,CAAC,IAAY,EAAE,IAAY,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,IAAI,IAAI,IAAI,SAAS,CAAC,CAAC,CAAC,IAAI,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 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telorun/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"description": "Telo CLI - Command-line interface for the Telo runtime.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -21,7 +21,9 @@
|
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"yargs": "^17.7.2",
|
|
24
|
-
"
|
|
24
|
+
"dotenv": "^17.4.0",
|
|
25
|
+
"@telorun/analyzer": "0.1.1",
|
|
26
|
+
"@telorun/kernel": "0.2.6"
|
|
25
27
|
},
|
|
26
28
|
"devDependencies": {
|
|
27
29
|
"@types/node": "^20.0.0",
|