feat: add gateway daemon runtime selector
This commit is contained in:
27
src/commands/daemon-runtime.ts
Normal file
27
src/commands/daemon-runtime.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
export type GatewayDaemonRuntime = "node" | "bun";
|
||||
|
||||
export const DEFAULT_GATEWAY_DAEMON_RUNTIME: GatewayDaemonRuntime = "node";
|
||||
|
||||
export const GATEWAY_DAEMON_RUNTIME_OPTIONS: Array<{
|
||||
value: GatewayDaemonRuntime;
|
||||
label: string;
|
||||
hint?: string;
|
||||
}> = [
|
||||
{
|
||||
value: "node",
|
||||
label: "Node (recommended)",
|
||||
hint:
|
||||
"Required for WhatsApp (Baileys WebSocket + Bun can corrupt memory on reconnect)",
|
||||
},
|
||||
{
|
||||
value: "bun",
|
||||
label: "Bun (faster)",
|
||||
hint: "Use only when WhatsApp is disabled",
|
||||
},
|
||||
];
|
||||
|
||||
export function isGatewayDaemonRuntime(
|
||||
value: string | undefined,
|
||||
): value is GatewayDaemonRuntime {
|
||||
return value === "node" || value === "bun";
|
||||
}
|
||||
Reference in New Issue
Block a user