UNPKG

openclaw

Version:

Multi-channel AI gateway with extensible messaging integrations

22 lines (21 loc) • 964 B
import { t as resolveCliArgvInvocation } from "./argv-invocation-C9SmXUsh.mjs"; import { n as isTruthyEnvValue } from "./env-HehwidXj.mjs"; //#region src/cli/command-registration-policy.ts const RESERVED_NON_PLUGIN_COMMAND_ROOTS = /* @__PURE__ */ new Set([ "auth", "tool", "tools" ]); function isReservedNonPluginCommandRoot(e) { return typeof e === "string" && RESERVED_NON_PLUGIN_COMMAND_ROOTS.has(e); } function shouldSkipPluginCommandRegistration(e) { const t = resolveCliArgvInvocation(e.argv); if (e.primary === "help") return t.hasHelpOrVersion && t.commandPath.length <= 1; return e.hasBuiltinPrimary || isReservedNonPluginCommandRoot(e.primary) || !e.primary && t.hasHelpOrVersion; } function shouldEagerRegisterSubcommands(e = process.env) { return isTruthyEnvValue(e.OPENCLAW_DISABLE_LAZY_SUBCOMMANDS); } //#endregion export { shouldEagerRegisterSubcommands as n, shouldSkipPluginCommandRegistration as r, isReservedNonPluginCommandRoot as t };