mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 02:02:45 +00:00
refactor(agent): dedupe harness and command workflows
This commit is contained in:
@@ -11,28 +11,18 @@ import { createOpenClawTools } from "../../agents/openclaw-tools.js";
|
||||
import { getChannelDock } from "../../channels/dock.js";
|
||||
import { logVerbose } from "../../globals.js";
|
||||
import { resolveGatewayMessageChannel } from "../../utils/message-channel.js";
|
||||
import { listChatCommands } from "../commands-registry.js";
|
||||
import { listSkillCommandsForWorkspace, resolveSkillCommandInvocation } from "../skill-commands.js";
|
||||
import {
|
||||
listReservedChatSlashCommandNames,
|
||||
listSkillCommandsForWorkspace,
|
||||
resolveSkillCommandInvocation,
|
||||
} from "../skill-commands.js";
|
||||
import { getAbortMemory } from "./abort.js";
|
||||
import { buildStatusReply, handleCommands } from "./commands.js";
|
||||
import { isDirectiveOnly } from "./directive-handling.js";
|
||||
import { extractInlineSimpleCommand } from "./reply-inline.js";
|
||||
|
||||
const builtinSlashCommands = (() => {
|
||||
const reserved = new Set<string>();
|
||||
for (const command of listChatCommands()) {
|
||||
if (command.nativeName) {
|
||||
reserved.add(command.nativeName.toLowerCase());
|
||||
}
|
||||
for (const alias of command.textAliases) {
|
||||
const trimmed = alias.trim();
|
||||
if (!trimmed.startsWith("/")) {
|
||||
continue;
|
||||
}
|
||||
reserved.add(trimmed.slice(1).toLowerCase());
|
||||
}
|
||||
}
|
||||
for (const name of [
|
||||
return listReservedChatSlashCommandNames([
|
||||
"think",
|
||||
"verbose",
|
||||
"reasoning",
|
||||
@@ -41,10 +31,7 @@ const builtinSlashCommands = (() => {
|
||||
"model",
|
||||
"status",
|
||||
"queue",
|
||||
]) {
|
||||
reserved.add(name);
|
||||
}
|
||||
return reserved;
|
||||
]);
|
||||
})();
|
||||
|
||||
function resolveSlashCommandName(commandBodyNormalized: string): string | null {
|
||||
|
||||
Reference in New Issue
Block a user