@telorun/cli 0.2.5 → 0.2.7
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.js +9 -141
- 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 +10 -0
- package/dist/commands/publish.d.ts.map +1 -0
- package/dist/commands/publish.js +301 -0
- package/dist/commands/publish.js.map +1 -0
- package/dist/commands/run.d.ts +11 -0
- package/dist/commands/run.d.ts.map +1 -0
- package/dist/commands/run.js +193 -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/dist/publishers/interface.d.ts +32 -0
- package/dist/publishers/interface.d.ts.map +1 -0
- package/dist/publishers/interface.js +2 -0
- package/dist/publishers/interface.js.map +1 -0
- package/dist/publishers/npm.d.ts +3 -0
- package/dist/publishers/npm.d.ts.map +1 -0
- package/dist/publishers/npm.js +48 -0
- package/dist/publishers/npm.js.map +1 -0
- package/dist/publishers/registry.d.ts +3 -0
- package/dist/publishers/registry.d.ts.map +1 -0
- package/dist/publishers/registry.js +6 -0
- package/dist/publishers/registry.js.map +1 -0
- package/package.json +5 -2
package/dist/cli.js
CHANGED
|
@@ -1,148 +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
|
-
import { fileURLToPath } from "url";
|
|
6
2
|
import yargs from "yargs";
|
|
7
3
|
import { hideBin } from "yargs/helpers";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
info: (...args) => console.log(...args),
|
|
13
|
-
ok: (text) => wrap("32", text),
|
|
14
|
-
warn: (text) => wrap("33", text),
|
|
15
|
-
error: (text) => wrap("31", text),
|
|
16
|
-
dim: (text) => wrap("2", text),
|
|
17
|
-
verbose,
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
function setupWatchMode(kernel, log) {
|
|
21
|
-
const watchers = new Map();
|
|
22
|
-
const debounceTimers = new Map();
|
|
23
|
-
const reloading = new Set();
|
|
24
|
-
let active = true;
|
|
25
|
-
function watchFile(filePath) {
|
|
26
|
-
if (!active || watchers.has(filePath))
|
|
27
|
-
return;
|
|
28
|
-
// getSourceFiles() returns file:// URLs; fs.watch needs a filesystem path
|
|
29
|
-
const fsPath = filePath.startsWith("file://") ? fileURLToPath(filePath) : filePath;
|
|
30
|
-
let watcher;
|
|
31
|
-
try {
|
|
32
|
-
watcher = fs.watch(fsPath, () => {
|
|
33
|
-
if (!active)
|
|
34
|
-
return;
|
|
35
|
-
const existing = debounceTimers.get(filePath);
|
|
36
|
-
if (existing)
|
|
37
|
-
clearTimeout(existing);
|
|
38
|
-
debounceTimers.set(filePath, setTimeout(() => {
|
|
39
|
-
debounceTimers.delete(filePath);
|
|
40
|
-
void handleChange(filePath);
|
|
41
|
-
}, 150));
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
catch {
|
|
45
|
-
return; // file may not exist yet
|
|
46
|
-
}
|
|
47
|
-
watcher.on("error", () => {
|
|
48
|
-
// OS invalidated the watch (e.g. file deleted). Remove and re-establish.
|
|
49
|
-
if (watchers.get(filePath) === watcher) {
|
|
50
|
-
watchers.delete(filePath);
|
|
51
|
-
setTimeout(() => {
|
|
52
|
-
if (active)
|
|
53
|
-
watchFile(filePath);
|
|
54
|
-
}, 50);
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
watchers.set(filePath, watcher);
|
|
58
|
-
}
|
|
59
|
-
async function handleChange(filePath) {
|
|
60
|
-
// Prevent concurrent reloads for the same file
|
|
61
|
-
if (reloading.has(filePath))
|
|
62
|
-
return;
|
|
63
|
-
reloading.add(filePath);
|
|
64
|
-
log.info(`[watch] reloading ${filePath}`);
|
|
65
|
-
try {
|
|
66
|
-
// await kernel.reloadSource(filePath);
|
|
67
|
-
// Watch any new files that appeared after reload
|
|
68
|
-
// for (const f of kernel.getSourceFiles()) watchFile(f);
|
|
69
|
-
log.info(log.ok(`[watch] complete`));
|
|
70
|
-
}
|
|
71
|
-
catch (err) {
|
|
72
|
-
log.info(log.error(`[watch] error: ${err instanceof Error ? err.message : String(err)}`));
|
|
73
|
-
}
|
|
74
|
-
finally {
|
|
75
|
-
reloading.delete(filePath);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
function cleanup() {
|
|
79
|
-
active = false;
|
|
80
|
-
for (const t of debounceTimers.values())
|
|
81
|
-
clearTimeout(t);
|
|
82
|
-
debounceTimers.clear();
|
|
83
|
-
for (const w of watchers.values())
|
|
84
|
-
w.close();
|
|
85
|
-
watchers.clear();
|
|
86
|
-
}
|
|
87
|
-
// for (const f of kernel.getSourceFiles()) watchFile(f);
|
|
88
|
-
return { cleanup };
|
|
89
|
-
}
|
|
90
|
-
async function run(argv) {
|
|
91
|
-
const log = createLogger(argv.verbose);
|
|
92
|
-
try {
|
|
93
|
-
const kernel = new Kernel();
|
|
94
|
-
if (argv.verbose) {
|
|
95
|
-
kernel.on("*", (event) => {
|
|
96
|
-
log.info(`${event.name}: ${JSON.stringify(event.payload)}`);
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
if (argv.debug) {
|
|
100
|
-
const debugDir = path.join(process.cwd(), ".telo-debug");
|
|
101
|
-
const eventStreamPath = path.join(debugDir, "events.jsonl");
|
|
102
|
-
await kernel.enableEventStream(eventStreamPath);
|
|
103
|
-
log.info(`Event stream enabled: ${eventStreamPath}`);
|
|
104
|
-
}
|
|
105
|
-
let watchHandle = null;
|
|
106
|
-
if (argv.watch) {
|
|
107
|
-
// Acquire a hold BEFORE start() to keep the kernel alive for apps that
|
|
108
|
-
// don't have their own holds (e.g. script-only manifests).
|
|
109
|
-
// shutdown() will force-resolve waitForIdle() on Ctrl+C regardless of
|
|
110
|
-
// how many holds are active (e.g. Http.Server may hold its own).
|
|
111
|
-
kernel.acquireHold("watch-mode");
|
|
112
|
-
kernel.on("Kernel.Started", () => {
|
|
113
|
-
// const files = kernel.getSourceFiles();
|
|
114
|
-
// log.info(`[watch] watching ${files.length} file(s)`);
|
|
115
|
-
watchHandle = setupWatchMode(kernel, log);
|
|
116
|
-
});
|
|
117
|
-
const shutdown = () => {
|
|
118
|
-
log.info("\n[watch] stopping...");
|
|
119
|
-
watchHandle?.cleanup();
|
|
120
|
-
kernel.shutdown();
|
|
121
|
-
};
|
|
122
|
-
process.once("SIGINT", shutdown);
|
|
123
|
-
process.once("SIGTERM", shutdown);
|
|
124
|
-
}
|
|
125
|
-
await kernel.loadFromConfig(argv.path);
|
|
126
|
-
await kernel.start();
|
|
127
|
-
if (kernel.exitCode !== 0) {
|
|
128
|
-
process.exit(kernel.exitCode);
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
catch (error) {
|
|
132
|
-
console.error("Error loading runtime:", error instanceof Error ? (error.stack ?? error.message) : String(error));
|
|
133
|
-
process.exit(1);
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
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))
|
|
137
8
|
.scriptName("telo")
|
|
138
|
-
.usage("$0 <command> [options]")
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}), async (argv) => {
|
|
144
|
-
await run(argv);
|
|
145
|
-
})
|
|
9
|
+
.usage("$0 <command> [options]");
|
|
10
|
+
cli = checkCommand(cli);
|
|
11
|
+
cli = publishCommand(cli);
|
|
12
|
+
cli = runCommand(cli);
|
|
13
|
+
cli
|
|
146
14
|
.option("verbose", {
|
|
147
15
|
type: "boolean",
|
|
148
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,IAAI,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;KACnC,UAAU,CAAC,MAAM,CAAC;KAClB,KAAK,CAAC,wBAAwB,CAAC,CAAC;AAEnC,GAAG,GAAG,YAAY,CAAC,GAAG,CAAe,CAAC;AACtC,GAAG,GAAG,cAAc,CAAC,GAAG,CAAe,CAAC;AACxC,GAAG,GAAG,UAAU,CAAC,GAAG,CAAe,CAAC;AAEpC,GAAG;KACA,MAAM,CAAC,SAAS,EAAE;IACjB,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,KAAK;IACd,QAAQ,EAAE,wBAAwB;CACnC,CAAC;KACD,MAAM,CAAC,OAAO,EAAE;IACf,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,KAAK;IACd,QAAQ,EAAE,8BAA8B;CACzC,CAAC;KACD,MAAM,CAAC,kBAAkB,EAAE;IAC1B,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,KAAK;IACd,QAAQ,EAAE,4BAA4B;CACvC,CAAC;KACD,MAAM,CAAC,OAAO,EAAE;IACf,KAAK,EAAE,GAAG;IACV,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,KAAK;IACd,QAAQ,EAAE,2CAA2C;CACtD,CAAC;KACD,aAAa,CAAC,CAAC,EAAE,yCAAyC,CAAC;KAC3D,MAAM,EAAE;KACR,IAAI,EAAE;KACN,OAAO,EAAE;KACT,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/commands/check.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AA4ElC,wBAAsB,KAAK,CAAC,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuBpE;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,IAAI,GAAG,IAAI,CAe9C"}
|
|
@@ -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,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AE,CAAC,CAAC;IACvC,CAAC;IAED,IAAI,WAAW,GAAG,CAAC;QAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,KAAW;IACtC,OAAO,KAAK,CAAC,OAAO,CAClB,iBAAiB,EACjB,kEAAkE,EAClE,CAAC,CAAC,EAAE,EAAE,CACJ,CAAC,CAAC,UAAU,CAAC,OAAO,EAAE;QACpB,QAAQ,EAAE,8EAA8E;QACxF,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,IAAI;QACX,YAAY,EAAE,IAAI;KACnB,CAAC,EACJ,KAAK,EAAE,IAAI,EAAE,EAAE;QACb,MAAM,KAAK,CAAC,IAAW,CAAC,CAAC;IAC3B,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Argv } from "yargs";
|
|
2
|
+
import type { BumpLevel } from "../publishers/interface.js";
|
|
3
|
+
export declare function publish(argv: {
|
|
4
|
+
paths: string[];
|
|
5
|
+
registry: string;
|
|
6
|
+
bump?: BumpLevel;
|
|
7
|
+
dryRun: boolean;
|
|
8
|
+
}): Promise<void>;
|
|
9
|
+
export declare function publishCommand(yargs: Argv): Argv;
|
|
10
|
+
//# sourceMappingURL=publish.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../src/commands/publish.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,KAAK,EAAE,SAAS,EAAoB,MAAM,4BAA4B,CAAC;AAwT9E,wBAAsB,OAAO,CAAC,IAAI,EAAE;IAClC,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;CACjB,GAAG,OAAO,CAAC,IAAI,CAAC,CAYhB;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,IAAI,GAAG,IAAI,CA+BhD"}
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
import * as fs from "fs";
|
|
2
|
+
import { PackageURL } from "packageurl-js";
|
|
3
|
+
import * as path from "path";
|
|
4
|
+
import { createLogger } from "../logger.js";
|
|
5
|
+
import { getPublisher } from "../publishers/registry.js";
|
|
6
|
+
// ---------------------------------------------------------------------------
|
|
7
|
+
// PURL parsing
|
|
8
|
+
// ---------------------------------------------------------------------------
|
|
9
|
+
function parsePurl(purl, manifestDir) {
|
|
10
|
+
let parsed;
|
|
11
|
+
try {
|
|
12
|
+
parsed = PackageURL.parseString(purl);
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
const [type, namespace, name, versionSpec, qualifiers] = parsed;
|
|
18
|
+
const entry = parsed[5] ?? "";
|
|
19
|
+
const localPathRel = qualifiers?.get("local_path");
|
|
20
|
+
if (!localPathRel)
|
|
21
|
+
return null;
|
|
22
|
+
if (!type || !name)
|
|
23
|
+
return null;
|
|
24
|
+
// Reconstruct the package name as it appears in the PURL (e.g. "@telorun/run")
|
|
25
|
+
const packageName = namespace ? `${namespace}/${name}` : name;
|
|
26
|
+
return {
|
|
27
|
+
purl,
|
|
28
|
+
type,
|
|
29
|
+
packageName,
|
|
30
|
+
versionSpec: versionSpec ?? "",
|
|
31
|
+
localPath: path.resolve(manifestDir, localPathRel),
|
|
32
|
+
entry,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
/** Extract every unique local_path controller from all YAML documents in the file */
|
|
36
|
+
function extractControllers(content, manifestDir) {
|
|
37
|
+
const seen = new Set();
|
|
38
|
+
const result = [];
|
|
39
|
+
for (const m of content.matchAll(/^\s*-\s+(pkg:[^\s]+)/gm)) {
|
|
40
|
+
const purl = m[1].trim();
|
|
41
|
+
if (seen.has(purl))
|
|
42
|
+
continue;
|
|
43
|
+
seen.add(purl);
|
|
44
|
+
const parsed = parsePurl(purl, manifestDir);
|
|
45
|
+
if (parsed)
|
|
46
|
+
result.push(parsed);
|
|
47
|
+
}
|
|
48
|
+
return result;
|
|
49
|
+
}
|
|
50
|
+
/** Bump the version field in the first YAML document's metadata block */
|
|
51
|
+
function bumpModuleVersion(content, level) {
|
|
52
|
+
const match = content.match(/^(\s{2,4}version:\s*)(\d+\.\d+\.\d+)/m);
|
|
53
|
+
if (!match)
|
|
54
|
+
return null;
|
|
55
|
+
const parts = match[2].split(".").map(Number);
|
|
56
|
+
if (level === "major") {
|
|
57
|
+
parts[0]++;
|
|
58
|
+
parts[1] = 0;
|
|
59
|
+
parts[2] = 0;
|
|
60
|
+
}
|
|
61
|
+
else if (level === "minor") {
|
|
62
|
+
parts[1]++;
|
|
63
|
+
parts[2] = 0;
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
parts[2]++;
|
|
67
|
+
}
|
|
68
|
+
const newVersion = parts.join(".");
|
|
69
|
+
return {
|
|
70
|
+
content: content.replace(match[0], `${match[1]}${newVersion}`),
|
|
71
|
+
from: match[2],
|
|
72
|
+
to: newVersion,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
/** Rewrite all PURL version specs for a given packageName to an exact static version */
|
|
76
|
+
function rewritePurls(content, packageName, newVersion) {
|
|
77
|
+
// Escape special regex chars in the package name (handles @scope/name)
|
|
78
|
+
const escapedName = packageName.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
79
|
+
return content.replace(new RegExp(`(pkg:[^/]+/${escapedName}@)[^?#]+(\\?[^#]*)?(#[^\\s]*)?`, "g"), (_, prefix, qs, frag) => `${prefix}${newVersion}${qs ?? ""}${frag ?? ""}`);
|
|
80
|
+
}
|
|
81
|
+
// ---------------------------------------------------------------------------
|
|
82
|
+
// Telo registry push
|
|
83
|
+
// ---------------------------------------------------------------------------
|
|
84
|
+
async function pushToTeloRegistry(content, filePath, registry, log) {
|
|
85
|
+
const firstDoc = content.split(/^---$/m)[0].trim() || content.split(/^---\n/m)[1]?.trim() || content;
|
|
86
|
+
const nsMatch = firstDoc.match(/^\s{2,4}namespace:\s*["']?([^\s"']+)["']?/m);
|
|
87
|
+
const nameMatch = firstDoc.match(/^\s{2,4}name:\s*["']?([^\s"']+)["']?/m);
|
|
88
|
+
const versionMatch = firstDoc.match(/^\s{2,4}version:\s*["']?([^\s"']+)["']?/m);
|
|
89
|
+
const namespace = nsMatch?.[1];
|
|
90
|
+
const name = nameMatch?.[1];
|
|
91
|
+
const version = versionMatch?.[1];
|
|
92
|
+
if (!namespace || !name || !version) {
|
|
93
|
+
console.error(log.error("error") +
|
|
94
|
+
` ${filePath}: metadata must include namespace, name, and version.\n` +
|
|
95
|
+
` Found: namespace=${namespace ?? "(missing)"}, name=${name ?? "(missing)"}, version=${version ?? "(missing)"}`);
|
|
96
|
+
return { ok: false, label: "", url: "" };
|
|
97
|
+
}
|
|
98
|
+
const url = `${registry.replace(/\/$/, "")}/${namespace}/${name}/${version}`;
|
|
99
|
+
const label = `${namespace}/${name}@${version}`;
|
|
100
|
+
let res;
|
|
101
|
+
try {
|
|
102
|
+
res = await fetch(url, {
|
|
103
|
+
method: "PUT",
|
|
104
|
+
headers: { "content-type": "text/yaml" },
|
|
105
|
+
body: content,
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
catch (err) {
|
|
109
|
+
console.error(log.error("error") + ` Network error: ${err instanceof Error ? err.message : String(err)}`);
|
|
110
|
+
return { ok: false, label, url };
|
|
111
|
+
}
|
|
112
|
+
if (!res.ok) {
|
|
113
|
+
const contentType = res.headers.get("content-type") ?? "";
|
|
114
|
+
const body = contentType.includes("application/json") ? await res.json() : await res.text();
|
|
115
|
+
console.error(log.error("error") + ` Push failed (${res.status}): ${JSON.stringify(body)}`);
|
|
116
|
+
return { ok: false, label, url };
|
|
117
|
+
}
|
|
118
|
+
return { ok: true, label, url };
|
|
119
|
+
}
|
|
120
|
+
// ---------------------------------------------------------------------------
|
|
121
|
+
// Formatting helpers
|
|
122
|
+
// ---------------------------------------------------------------------------
|
|
123
|
+
const STEP_WIDTH = 9; // "publish " column width
|
|
124
|
+
function step(log, label, status) {
|
|
125
|
+
console.log(` ${label.padEnd(STEP_WIDTH)}${status}`);
|
|
126
|
+
}
|
|
127
|
+
function stepOk(log, label, detail) {
|
|
128
|
+
step(log, label, log.ok("✓") + (detail ? ` ${detail}` : ""));
|
|
129
|
+
}
|
|
130
|
+
function stepWarn(log, label, detail) {
|
|
131
|
+
step(log, label, log.warn("skipped") + ` ${detail}`);
|
|
132
|
+
}
|
|
133
|
+
function stepDry(log, label, detail) {
|
|
134
|
+
step(log, label, log.dim(`dry-run ${detail}`));
|
|
135
|
+
}
|
|
136
|
+
// ---------------------------------------------------------------------------
|
|
137
|
+
// Main per-manifest publish
|
|
138
|
+
// ---------------------------------------------------------------------------
|
|
139
|
+
async function publishOne(filePath, registry, bump, dryRun, log) {
|
|
140
|
+
let content;
|
|
141
|
+
try {
|
|
142
|
+
content = fs.readFileSync(filePath, "utf-8");
|
|
143
|
+
}
|
|
144
|
+
catch {
|
|
145
|
+
console.error(log.error("error") + ` Cannot read file: ${filePath}`);
|
|
146
|
+
return false;
|
|
147
|
+
}
|
|
148
|
+
const manifestDir = path.dirname(filePath);
|
|
149
|
+
const controllers = extractControllers(content, manifestDir);
|
|
150
|
+
// Deduplicate by resolved localPath so each package is processed once
|
|
151
|
+
const byLocalPath = new Map();
|
|
152
|
+
for (const c of controllers) {
|
|
153
|
+
if (!byLocalPath.has(c.localPath))
|
|
154
|
+
byLocalPath.set(c.localPath, c);
|
|
155
|
+
}
|
|
156
|
+
const uniqueControllers = Array.from(byLocalPath.values());
|
|
157
|
+
// --- Controller packages ---
|
|
158
|
+
for (const ctrl of uniqueControllers) {
|
|
159
|
+
const publisher = getPublisher(ctrl.type);
|
|
160
|
+
console.log(`\n ${log.dim(ctrl.packageName)}`);
|
|
161
|
+
if (!publisher) {
|
|
162
|
+
step(log, "publish", log.warn("skipped") + ` no publisher for type "${ctrl.type}"`);
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
165
|
+
if (!fs.existsSync(ctrl.localPath)) {
|
|
166
|
+
step(log, "publish", log.error("error") + ` local_path not found: ${ctrl.localPath}`);
|
|
167
|
+
return false;
|
|
168
|
+
}
|
|
169
|
+
// Bump
|
|
170
|
+
if (bump) {
|
|
171
|
+
if (dryRun) {
|
|
172
|
+
const current = await publisher.readVersion(ctrl.localPath);
|
|
173
|
+
stepDry(log, "bump", `${current} → ? (${bump})`);
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
const before = await publisher.readVersion(ctrl.localPath);
|
|
177
|
+
const after = await publisher.bumpVersion(ctrl.localPath, bump);
|
|
178
|
+
stepOk(log, "bump", `${before} → ${after}`);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
const version = await publisher.readVersion(ctrl.localPath);
|
|
182
|
+
// Build
|
|
183
|
+
if (dryRun) {
|
|
184
|
+
stepDry(log, "build", `${ctrl.packageName}@${version}`);
|
|
185
|
+
}
|
|
186
|
+
else {
|
|
187
|
+
try {
|
|
188
|
+
await publisher.build(ctrl.localPath);
|
|
189
|
+
stepOk(log, "build");
|
|
190
|
+
}
|
|
191
|
+
catch (err) {
|
|
192
|
+
step(log, "build", log.error("error"));
|
|
193
|
+
console.error((err instanceof Error ? err.message : String(err))
|
|
194
|
+
.split("\n")
|
|
195
|
+
.map((l) => ` ${l}`)
|
|
196
|
+
.join("\n"));
|
|
197
|
+
return false;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
// Publish to code registry
|
|
201
|
+
if (dryRun) {
|
|
202
|
+
stepDry(log, "publish", `${ctrl.packageName}@${version} → ${ctrl.type}`);
|
|
203
|
+
}
|
|
204
|
+
else {
|
|
205
|
+
const published = await publisher.publish(ctrl.localPath, version);
|
|
206
|
+
if (!published) {
|
|
207
|
+
stepWarn(log, "publish", `${version} already exists on ${ctrl.type}`);
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
stepOk(log, "publish", `${ctrl.packageName}@${version}`);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
// Rewrite PURLs
|
|
214
|
+
if (dryRun) {
|
|
215
|
+
stepDry(log, "purl", `→ @${version}`);
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
const oldSpec = ctrl.versionSpec;
|
|
219
|
+
content = rewritePurls(content, ctrl.packageName, version);
|
|
220
|
+
stepOk(log, "purl", `@${oldSpec} → @${version}`);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
// Bump the module's own metadata.version when --bump is set
|
|
224
|
+
let bumpedVersion = null;
|
|
225
|
+
if (bump) {
|
|
226
|
+
const bumped = bumpModuleVersion(content, bump);
|
|
227
|
+
if (bumped) {
|
|
228
|
+
content = bumped.content;
|
|
229
|
+
bumpedVersion = { from: bumped.from, to: bumped.to };
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
// Write updated module.yaml back to disk
|
|
233
|
+
const dirty = uniqueControllers.length > 0 || bump != null;
|
|
234
|
+
if (!dryRun && dirty) {
|
|
235
|
+
fs.writeFileSync(filePath, content, "utf-8");
|
|
236
|
+
}
|
|
237
|
+
// --- Manifest ---
|
|
238
|
+
console.log(`\n ${log.dim("manifest")}`);
|
|
239
|
+
if (bumpedVersion) {
|
|
240
|
+
if (dryRun) {
|
|
241
|
+
stepDry(log, "version", `${bumpedVersion.from} → ${bumpedVersion.to}`);
|
|
242
|
+
}
|
|
243
|
+
else {
|
|
244
|
+
stepOk(log, "version", `${bumpedVersion.from} → ${bumpedVersion.to}`);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
if (dryRun) {
|
|
248
|
+
stepDry(log, "push", "Telo registry");
|
|
249
|
+
return true;
|
|
250
|
+
}
|
|
251
|
+
const { ok, label, url } = await pushToTeloRegistry(content, filePath, registry, log);
|
|
252
|
+
if (!ok)
|
|
253
|
+
return false;
|
|
254
|
+
stepOk(log, "push", `${label} → ${url}`);
|
|
255
|
+
return true;
|
|
256
|
+
}
|
|
257
|
+
// ---------------------------------------------------------------------------
|
|
258
|
+
// Command
|
|
259
|
+
// ---------------------------------------------------------------------------
|
|
260
|
+
export async function publish(argv) {
|
|
261
|
+
const log = createLogger(false);
|
|
262
|
+
let failed = false;
|
|
263
|
+
for (const p of argv.paths) {
|
|
264
|
+
const filePath = path.resolve(process.cwd(), p);
|
|
265
|
+
const relPath = path.relative(process.cwd(), filePath);
|
|
266
|
+
console.log(`\nPublishing ${log.dim(relPath)}`);
|
|
267
|
+
const ok = await publishOne(filePath, argv.registry, argv.bump, argv.dryRun, log);
|
|
268
|
+
if (!ok)
|
|
269
|
+
failed = true;
|
|
270
|
+
}
|
|
271
|
+
console.log("");
|
|
272
|
+
if (failed)
|
|
273
|
+
process.exit(1);
|
|
274
|
+
}
|
|
275
|
+
export function publishCommand(yargs) {
|
|
276
|
+
return yargs.command("publish <paths..>", "Publish one or more module manifests to the Telo registry", (y) => y
|
|
277
|
+
.positional("paths", {
|
|
278
|
+
describe: "Paths to module.yaml files to publish",
|
|
279
|
+
type: "string",
|
|
280
|
+
array: true,
|
|
281
|
+
demandOption: true,
|
|
282
|
+
})
|
|
283
|
+
.option("registry", {
|
|
284
|
+
type: "string",
|
|
285
|
+
default: "https://registry.telo.run",
|
|
286
|
+
describe: "Registry base URL",
|
|
287
|
+
})
|
|
288
|
+
.option("bump", {
|
|
289
|
+
type: "string",
|
|
290
|
+
choices: ["patch", "minor", "major"],
|
|
291
|
+
describe: "Bump controller package versions before publishing",
|
|
292
|
+
})
|
|
293
|
+
.option("dry-run", {
|
|
294
|
+
type: "boolean",
|
|
295
|
+
default: false,
|
|
296
|
+
describe: "Show what would happen without making any changes",
|
|
297
|
+
}), async (argv) => {
|
|
298
|
+
await publish(argv);
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
//# sourceMappingURL=publish.js.map
|
|
@@ -0,0 +1 @@
|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
+
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
|
+
"--"?: string[];
|
|
9
|
+
}): Promise<void>;
|
|
10
|
+
export declare function runCommand(yargs: Argv): Argv;
|
|
11
|
+
//# 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;IACf,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB,GAAG,OAAO,CAAC,IAAI,CAAC,CAwEhB;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,IAAI,GAAG,IAAI,CA6B5C"}
|
|
@@ -0,0 +1,193 @@
|
|
|
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({ argv: argv["--"] });
|
|
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
|
|
171
|
+
.positional("path", {
|
|
172
|
+
describe: "Path to YAML manifest, directory containing module.yaml, or HTTP(S) URL",
|
|
173
|
+
type: "string",
|
|
174
|
+
demandOption: true,
|
|
175
|
+
})
|
|
176
|
+
.strict(false), async (argv) => {
|
|
177
|
+
// Everything after the manifest path that isn't a known telo flag
|
|
178
|
+
// becomes argv for the kernel. We extract it from process.argv by
|
|
179
|
+
// finding the manifest path and taking everything after it, excluding
|
|
180
|
+
// known telo flags.
|
|
181
|
+
const knownFlags = new Set([
|
|
182
|
+
"--verbose", "--debug", "--snapshot-on-exit", "--watch", "-w",
|
|
183
|
+
"--help", "--version",
|
|
184
|
+
]);
|
|
185
|
+
const rawArgs = process.argv;
|
|
186
|
+
const pathIdx = rawArgs.indexOf(argv.path);
|
|
187
|
+
const extraArgs = pathIdx >= 0
|
|
188
|
+
? rawArgs.slice(pathIdx + 1).filter((a) => !knownFlags.has(a) && a !== "--")
|
|
189
|
+
: [];
|
|
190
|
+
await run({ ...argv, "--": extraArgs });
|
|
191
|
+
});
|
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UAAU,CAAC,KAAW;IACpC,OAAO,KAAK,CAAC,OAAO,CAClB,CAAC,iBAAiB,EAAE,gBAAgB,CAAC,EACrC,sDAAsD,EACtD,CAAC,CAAC,EAAE,EAAE,CACJ,CAAC;SACE,UAAU,CAAC,MAAM,EAAE;QAClB,QAAQ,EAAE,yEAAyE;QACnF,IAAI,EAAE,QAAQ;QACd,YAAY,EAAE,IAAI;KACnB,CAAC;SACD,MAAM,CAAC,KAAK,CAAC,EAClB,KAAK,EAAE,IAAI,EAAE,EAAE;QACb,kEAAkE;QAClE,kEAAkE;QAClE,sEAAsE;QACtE,oBAAoB;QACpB,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC;YACzB,WAAW,EAAE,SAAS,EAAE,oBAAoB,EAAE,SAAS,EAAE,IAAI;YAC7D,QAAQ,EAAE,WAAW;SACtB,CAAC,CAAC;QACH,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;QAC7B,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,IAAc,CAAC,CAAC;QACrD,MAAM,SAAS,GAAG,OAAO,IAAI,CAAC;YAC5B,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;YAC5E,CAAC,CAAC,EAAE,CAAC;QACP,MAAM,GAAG,CAAC,EAAE,GAAI,IAAY,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC;IACnD,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,CAAC,CAAC;IAC/F,OAAO;QACL,IAAI,EAAE,CAAC,GAAG,IAAW,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;QAC9C,EAAE,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC;QACtC,IAAI,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC;QACxC,KAAK,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC;QACzC,GAAG,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC;QACtC,OAAO;KACR,CAAC;AACJ,CAAC;AAID,MAAM,UAAU,iBAAiB,CAC/B,WAAgC,EAChC,GAAW,EACX,WAAmB;IAEnB,KAAK,MAAM,CAAC,IAAI,WAAW,EAAE,CAAC;QAC5B,MAAM,aAAa,GAAG,CAAC,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC1F,MAAM,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QAChD,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAClD,OAAO,CAAC,KAAK,CAAC,GAAG,WAAW,KAAK,aAAa,KAAK,GAAG,GAAG,CAAC,CAAC,OAAO,GAAG,IAAI,EAAE,CAAC,CAAC;IAC/E,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export type BumpLevel = "patch" | "minor" | "major";
|
|
2
|
+
export interface ParsedController {
|
|
3
|
+
/** Full original PURL string */
|
|
4
|
+
purl: string;
|
|
5
|
+
/** PURL type: "npm", "cargo", etc. */
|
|
6
|
+
type: string;
|
|
7
|
+
/** Scoped package name, e.g. "@telorun/run" */
|
|
8
|
+
packageName: string;
|
|
9
|
+
/** Version spec from the PURL, e.g. ">=1.0.0" or "0.1.1" */
|
|
10
|
+
versionSpec: string;
|
|
11
|
+
/** Resolved absolute path to the package directory */
|
|
12
|
+
localPath: string;
|
|
13
|
+
/** Entry point fragment, e.g. "sequence" */
|
|
14
|
+
entry: string;
|
|
15
|
+
}
|
|
16
|
+
export interface ControllerPublisher {
|
|
17
|
+
/** PURL type this publisher handles, e.g. "npm" */
|
|
18
|
+
type: string;
|
|
19
|
+
/** Return the current version from the package manifest (e.g. package.json) */
|
|
20
|
+
readVersion(localPath: string): Promise<string>;
|
|
21
|
+
/** Bump the version in the package manifest and return the new version string */
|
|
22
|
+
bumpVersion(localPath: string, level: BumpLevel): Promise<string>;
|
|
23
|
+
/** Build the package */
|
|
24
|
+
build(localPath: string): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Publish the package to its registry.
|
|
27
|
+
* If the version already exists, resolve without throwing — return false to
|
|
28
|
+
* indicate it was skipped (caller should warn), true if published.
|
|
29
|
+
*/
|
|
30
|
+
publish(localPath: string, version: string): Promise<boolean>;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../src/publishers/interface.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,CAAC;AAEpD,MAAM,WAAW,gBAAgB;IAC/B,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,+CAA+C;IAC/C,WAAW,EAAE,MAAM,CAAC;IACpB,4DAA4D;IAC5D,WAAW,EAAE,MAAM,CAAC;IACpB,sDAAsD;IACtD,SAAS,EAAE,MAAM,CAAC;IAClB,4CAA4C;IAC5C,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IAEb,+EAA+E;IAC/E,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEhD,iFAAiF;IACjF,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAElE,wBAAwB;IACxB,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAExC;;;;OAIG;IACH,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC/D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../src/publishers/interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"npm.d.ts","sourceRoot":"","sources":["../../src/publishers/npm.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAa,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAErE,eAAO,MAAM,YAAY,EAAE,mBAgD1B,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { execSync, spawnSync } from "child_process";
|
|
2
|
+
import * as fs from "fs";
|
|
3
|
+
import * as path from "path";
|
|
4
|
+
export const npmPublisher = {
|
|
5
|
+
type: "npm",
|
|
6
|
+
async readVersion(localPath) {
|
|
7
|
+
const pkgPath = path.join(localPath, "package.json");
|
|
8
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
|
|
9
|
+
return pkg.version;
|
|
10
|
+
},
|
|
11
|
+
async bumpVersion(localPath, level) {
|
|
12
|
+
execSync(`npm version ${level} --no-git-tag-version --loglevel=error`, {
|
|
13
|
+
cwd: localPath,
|
|
14
|
+
stdio: "inherit",
|
|
15
|
+
});
|
|
16
|
+
return this.readVersion(localPath);
|
|
17
|
+
},
|
|
18
|
+
async build(localPath) {
|
|
19
|
+
const result = spawnSync("npm", ["--loglevel=error", "run", "build"], {
|
|
20
|
+
cwd: localPath,
|
|
21
|
+
encoding: "utf-8",
|
|
22
|
+
});
|
|
23
|
+
if (result.status !== 0) {
|
|
24
|
+
const output = [result.stdout, result.stderr].filter(Boolean).join("\n");
|
|
25
|
+
throw new Error(`Build failed:\n${output}`);
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
async publish(localPath, version) {
|
|
29
|
+
const pkgPath = path.join(localPath, "package.json");
|
|
30
|
+
const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf-8"));
|
|
31
|
+
const packageName = pkg.name;
|
|
32
|
+
// Check if the version already exists on the registry
|
|
33
|
+
try {
|
|
34
|
+
execSync(`npm view ${packageName}@${version} version --loglevel=error`, {
|
|
35
|
+
cwd: localPath,
|
|
36
|
+
stdio: "pipe",
|
|
37
|
+
});
|
|
38
|
+
// If this succeeds, the version already exists — skip and signal caller
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
// npm view throws when the version is not found — proceed to publish
|
|
43
|
+
}
|
|
44
|
+
execSync("npm publish --access public --loglevel=error", { cwd: localPath, stdio: "inherit" });
|
|
45
|
+
return true;
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=npm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"npm.js","sourceRoot":"","sources":["../../src/publishers/npm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAG7B,MAAM,CAAC,MAAM,YAAY,GAAwB;IAC/C,IAAI,EAAE,KAAK;IAEX,KAAK,CAAC,WAAW,CAAC,SAAiB;QACjC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;QACrD,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAwB,CAAC;QACjF,OAAO,GAAG,CAAC,OAAO,CAAC;IACrB,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,SAAiB,EAAE,KAAgB;QACnD,QAAQ,CAAC,eAAe,KAAK,wCAAwC,EAAE;YACrE,GAAG,EAAE,SAAS;YACd,KAAK,EAAE,SAAS;SACjB,CAAC,CAAC;QACH,OAAO,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IACrC,CAAC;IAED,KAAK,CAAC,KAAK,CAAC,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names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAK1D,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS,CAE1E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/publishers/registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,MAAM,UAAU,GAA0B,CAAC,YAAY,CAAC,CAAC;AAEzD,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;AACjD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telorun/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.7",
|
|
4
4
|
"description": "Telo CLI - Command-line interface for the Telo runtime.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -20,8 +20,11 @@
|
|
|
20
20
|
"runtime"
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
|
+
"packageurl-js": "^2.0.1",
|
|
23
24
|
"yargs": "^17.7.2",
|
|
24
|
-
"
|
|
25
|
+
"dotenv": "^17.4.0",
|
|
26
|
+
"@telorun/analyzer": "0.1.2",
|
|
27
|
+
"@telorun/kernel": "0.2.7"
|
|
25
28
|
},
|
|
26
29
|
"devDependencies": {
|
|
27
30
|
"@types/node": "^20.0.0",
|