refactor: 全面转向 CLI 驱动架构与底层 SDK,裁撤繁杂 MCP 工具并参考 seal-home 规范
This commit is contained in:
1 parent
3d549e2e2f
commit
e7aa8a86cc
19 files changed
+1228
-589
No files matched your search
Executable
+36
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env bun
|
||||
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { dirname } from "node:path";
|
||||
import { runCli } from "./cli/runner.js";
|
||||
|
||||
process.stdout.on("error", (err: any) => {
|
||||
if (err?.code === "EPIPE") process.exit(0);
|
||||
});
|
||||
process.stderr.on("error", (err: any) => {
|
||||
if (err?.code === "EPIPE") process.exit(0);
|
||||
});
|
||||
|
||||
const entryFile = fileURLToPath(import.meta.url);
|
||||
const appRoot = dirname(dirname(entryFile));
|
||||
|
||||
const result = await runCli(process.argv.slice(2), {
|
||||
appRoot,
|
||||
entryFile,
|
||||
});
|
||||
|
||||
try {
|
||||
if (result.stdout) process.stdout.write(result.stdout);
|
||||
} catch (err: any) {
|
||||
if (err?.code !== "EPIPE") throw err;
|
||||
}
|
||||
|
||||
try {
|
||||
if (result.stderr) {
|
||||
process.stderr.write(`${result.stderr}${result.stderr.endsWith("\n") ? "" : "\n"}`);
|
||||
}
|
||||
} catch (err: any) {
|
||||
if (err?.code !== "EPIPE") throw err;
|
||||
}
|
||||
|
||||
process.exitCode = result.exitCode;
|
||||
Reference in new issue
Block a user