mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-01 21:43:37 +00:00
refactor(agents): remove stale wrapper exports
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
// Register agent tests cover agent command registration and option wiring.
|
||||
import { Command } from "commander";
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { registerAgentCommands } from "./register.agent.js";
|
||||
import { registerAgentsCommands } from "./register.agent.js";
|
||||
import { registerAgentTurnCommand } from "./register.agent-turn.js";
|
||||
|
||||
const mocks = vi.hoisted(() => ({
|
||||
agentCliCommandMock: vi.fn(),
|
||||
@@ -65,10 +66,11 @@ vi.mock("../../runtime.js", () => ({
|
||||
defaultRuntime: mocks.runtime,
|
||||
}));
|
||||
|
||||
describe("registerAgentCommands", () => {
|
||||
describe("agent command registration", () => {
|
||||
async function runCli(args: string[]) {
|
||||
const program = new Command();
|
||||
registerAgentCommands(program, { agentChannelOptions: "last|telegram|discord" });
|
||||
registerAgentTurnCommand(program, { agentChannelOptions: "last|telegram|discord" });
|
||||
registerAgentsCommands(program);
|
||||
await program.parseAsync(args, { from: "user" });
|
||||
}
|
||||
|
||||
@@ -220,7 +222,7 @@ describe("registerAgentCommands", () => {
|
||||
|
||||
it("documents bind accountId resolution behavior in help text", () => {
|
||||
const program = new Command();
|
||||
registerAgentCommands(program, { agentChannelOptions: "last|telegram|discord" });
|
||||
registerAgentsCommands(program);
|
||||
const agents = program.commands.find((command) => command.name() === "agents");
|
||||
const bind = agents?.commands.find((command) => command.name() === "bind");
|
||||
const help = bind?.helpInformation() ?? "";
|
||||
|
||||
@@ -5,7 +5,6 @@ import { theme } from "../../../packages/terminal-core/src/theme.js";
|
||||
import { hasExplicitOptions } from "../command-options.js";
|
||||
import { formatHelpExamples } from "../help-format.js";
|
||||
import { collectOption } from "./helpers.js";
|
||||
import { registerAgentTurnCommand } from "./register.agent-turn.js";
|
||||
|
||||
type AgentsAddModule = typeof import("../../commands/agents.commands.add.js");
|
||||
type AgentsBindModule = typeof import("../../commands/agents.commands.bind.js");
|
||||
@@ -71,15 +70,6 @@ async function runAgentsCommandAction(
|
||||
});
|
||||
}
|
||||
|
||||
/** Register single-turn `agent` plus multi-agent management commands. */
|
||||
export function registerAgentCommands(
|
||||
program: Command,
|
||||
args: { agentChannelOptions: string },
|
||||
): void {
|
||||
registerAgentTurnCommand(program, args);
|
||||
registerAgentsCommands(program);
|
||||
}
|
||||
|
||||
/** Register `agents` management subcommands for config, bindings, identity, and deletion. */
|
||||
export function registerAgentsCommands(program: Command): void {
|
||||
const agents = program
|
||||
|
||||
Reference in New Issue
Block a user