mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-16 03:31:10 +00:00
refactor: split cli backend live helpers
This commit is contained in:
@@ -56,10 +56,6 @@ export const cliCommandCatalog: readonly CliCommandCatalogEntry[] = [
|
||||
policy: { routeConfigGuard: "always" },
|
||||
route: { id: "gateway-status" },
|
||||
},
|
||||
{
|
||||
commandPath: ["cron"],
|
||||
policy: { bypassConfigGuard: true },
|
||||
},
|
||||
{
|
||||
commandPath: ["sessions"],
|
||||
exact: true,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { isGatewayConfigBypassCommandPath } from "../gateway/explicit-connection-policy.js";
|
||||
import { cliCommandCatalog, type CliCommandPathPolicy } from "./command-catalog.js";
|
||||
import { matchesCommandPath } from "./command-path-matches.js";
|
||||
|
||||
@@ -23,5 +24,11 @@ export function resolveCliCommandPathPolicy(commandPath: string[]): CliCommandPa
|
||||
...entry.policy,
|
||||
};
|
||||
}
|
||||
if (isGatewayConfigBypassCommandPath(commandPath)) {
|
||||
resolvedPolicy = {
|
||||
...resolvedPolicy,
|
||||
bypassConfigGuard: true,
|
||||
};
|
||||
}
|
||||
return resolvedPolicy;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user