feat: add local workflow web console

This commit is contained in:
liujing
2026-07-20 02:48:08 +08:00
parent 84f1dc589e
commit c1a982a179
11 changed files with 3071 additions and 3 deletions
+12 -1
View File
@@ -24,6 +24,7 @@ import {
} from "./workflow-engine.js";
import { WorkflowConfigError } from "./workflow-config.js";
import { WorkflowLockError } from "./workflow-state.js";
import { startWorkflowWebServer } from "./workflow-web.js";
async function main() {
let args: WorkflowArgs;
@@ -91,12 +92,22 @@ async function main() {
});
break;
case "web":
await startWorkflowWebServer(args.port);
// Keep the process alive
await new Promise(() => {});
break;
default: {
const _exhaustive: never = args;
throw new Error(`Unknown subcommand: ${(_exhaustive as any).sub}`);
}
}
} catch (err) {
} catch (err: any) {
if (err && err.code === "EADDRINUSE") {
process.stderr.write(`Error: Port is already in use.\n`);
process.exit(1);
}
if (err instanceof WorkflowEngineError) {
process.stderr.write(`Error: ${err.message}\n`);
process.exit(err.exitCode);