chore: rename project to clawdbot
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
#!/usr/bin/env node
|
||||
import process from "node:process";
|
||||
|
||||
declare const __CLAWDIS_VERSION__: string;
|
||||
declare const __CLAWDBOT_VERSION__: string;
|
||||
|
||||
const BUNDLED_VERSION =
|
||||
typeof __CLAWDIS_VERSION__ === "string" ? __CLAWDIS_VERSION__ : "0.0.0";
|
||||
typeof __CLAWDBOT_VERSION__ === "string" ? __CLAWDBOT_VERSION__ : "0.0.0";
|
||||
|
||||
function argValue(args: string[], flag: string): string | undefined {
|
||||
const idx = args.indexOf(flag);
|
||||
@@ -23,7 +23,7 @@ type GatewayWsLogStyle = "auto" | "full" | "compact";
|
||||
|
||||
async function main() {
|
||||
if (hasFlag(args, "--version") || hasFlag(args, "-v")) {
|
||||
// Match `clawdis --version` behavior for Swift env/version checks.
|
||||
// Match `clawdbot --version` behavior for Swift env/version checks.
|
||||
// Keep output a single line.
|
||||
console.log(BUNDLED_VERSION);
|
||||
process.exit(0);
|
||||
@@ -64,7 +64,7 @@ async function main() {
|
||||
const cfg = loadConfig();
|
||||
const portRaw =
|
||||
argValue(args, "--port") ??
|
||||
process.env.CLAWDIS_GATEWAY_PORT ??
|
||||
process.env.CLAWDBOT_GATEWAY_PORT ??
|
||||
(typeof cfg.gateway?.port === "number" ? String(cfg.gateway.port) : "") ??
|
||||
"18789";
|
||||
const port = Number.parseInt(portRaw, 10);
|
||||
@@ -75,7 +75,7 @@ async function main() {
|
||||
|
||||
const bindRaw =
|
||||
argValue(args, "--bind") ??
|
||||
process.env.CLAWDIS_GATEWAY_BIND ??
|
||||
process.env.CLAWDBOT_GATEWAY_BIND ??
|
||||
cfg.gateway?.bind ??
|
||||
"loopback";
|
||||
const bind =
|
||||
@@ -93,7 +93,7 @@ async function main() {
|
||||
}
|
||||
|
||||
const token = argValue(args, "--token");
|
||||
if (token) process.env.CLAWDIS_GATEWAY_TOKEN = token;
|
||||
if (token) process.env.CLAWDBOT_GATEWAY_TOKEN = token;
|
||||
|
||||
let server: Awaited<ReturnType<typeof startGatewayServer>> | null = null;
|
||||
let shuttingDown = false;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#!/usr/bin/env node
|
||||
import process from "node:process";
|
||||
|
||||
declare const __CLAWDIS_VERSION__: string | undefined;
|
||||
declare const __CLAWDBOT_VERSION__: string | undefined;
|
||||
|
||||
const BUNDLED_VERSION =
|
||||
typeof __CLAWDIS_VERSION__ === "string" ? __CLAWDIS_VERSION__ : "0.0.0";
|
||||
typeof __CLAWDBOT_VERSION__ === "string" ? __CLAWDBOT_VERSION__ : "0.0.0";
|
||||
|
||||
function hasFlag(args: string[], flag: string): boolean {
|
||||
return args.includes(flag);
|
||||
@@ -37,8 +37,8 @@ async function main() {
|
||||
const { default: dotenv } = await import("dotenv");
|
||||
dotenv.config({ quiet: true });
|
||||
|
||||
const { ensureClawdisCliOnPath } = await import("../infra/path-env.js");
|
||||
ensureClawdisCliOnPath();
|
||||
const { ensureClawdbotCliOnPath } = await import("../infra/path-env.js");
|
||||
ensureClawdbotCliOnPath();
|
||||
|
||||
const { enableConsoleCapture } = await import("../logging.js");
|
||||
enableConsoleCapture();
|
||||
@@ -51,7 +51,7 @@ async function main() {
|
||||
|
||||
process.on("unhandledRejection", (reason, _promise) => {
|
||||
console.error(
|
||||
"[clawdis] Unhandled promise rejection:",
|
||||
"[clawdbot] Unhandled promise rejection:",
|
||||
reason instanceof Error ? (reason.stack ?? reason.message) : reason,
|
||||
);
|
||||
process.exit(1);
|
||||
@@ -59,7 +59,7 @@ async function main() {
|
||||
|
||||
process.on("uncaughtException", (error) => {
|
||||
console.error(
|
||||
"[clawdis] Uncaught exception:",
|
||||
"[clawdbot] Uncaught exception:",
|
||||
error.stack ?? error.message,
|
||||
);
|
||||
process.exit(1);
|
||||
|
||||
Reference in New Issue
Block a user