mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-03 22:34:05 +00:00
perf(cli): cache agent bind command import
This commit is contained in:
@@ -16,6 +16,12 @@ type AgentsIdentityModule = typeof import("../../commands/agents.commands.identi
|
||||
type AgentsListModule = typeof import("../../commands/agents.commands.list.js");
|
||||
type GlobalStateModule = typeof import("../../global-state.js");
|
||||
|
||||
let agentsBindModulePromise: Promise<AgentsBindModule> | undefined;
|
||||
|
||||
function loadAgentsBindModule(): Promise<AgentsBindModule> {
|
||||
return (agentsBindModulePromise ??= import("../../commands/agents.commands.bind.js"));
|
||||
}
|
||||
|
||||
async function loadAgentCliCommand(): Promise<AgentViaGatewayModule["agentCliCommand"]> {
|
||||
return (await import("../../commands/agent-via-gateway.js")).agentCliCommand;
|
||||
}
|
||||
@@ -25,15 +31,15 @@ async function loadAgentsAddCommand(): Promise<AgentsAddModule["agentsAddCommand
|
||||
}
|
||||
|
||||
async function loadAgentsBindCommand(): Promise<AgentsBindModule["agentsBindCommand"]> {
|
||||
return (await import("../../commands/agents.commands.bind.js")).agentsBindCommand;
|
||||
return (await loadAgentsBindModule()).agentsBindCommand;
|
||||
}
|
||||
|
||||
async function loadAgentsBindingsCommand(): Promise<AgentsBindModule["agentsBindingsCommand"]> {
|
||||
return (await import("../../commands/agents.commands.bind.js")).agentsBindingsCommand;
|
||||
return (await loadAgentsBindModule()).agentsBindingsCommand;
|
||||
}
|
||||
|
||||
async function loadAgentsUnbindCommand(): Promise<AgentsBindModule["agentsUnbindCommand"]> {
|
||||
return (await import("../../commands/agents.commands.bind.js")).agentsUnbindCommand;
|
||||
return (await loadAgentsBindModule()).agentsUnbindCommand;
|
||||
}
|
||||
|
||||
async function loadAgentsDeleteCommand(): Promise<AgentsDeleteModule["agentsDeleteCommand"]> {
|
||||
|
||||
Reference in New Issue
Block a user