pyb-ts
Version:
PYB-CLI - Minimal AI Agent with multi-model support and CLI interface
38 lines (35 loc) • 1.26 kB
JavaScript
import { reloadCustomCommands } from "@services/customCommands";
import { getCommands } from "@commands";
const refreshCommands = {
type: "local",
name: "refresh-commands",
description: "Reload custom commands from filesystem",
isEnabled: true,
isHidden: false,
async call(_, context) {
try {
reloadCustomCommands();
getCommands.cache.clear?.();
const commands = await getCommands();
const customCommands = commands.filter(
(cmd) => cmd.name.startsWith("project:") || cmd.name.startsWith("user:")
);
return `\uFFFD\uFFFD?Commands refreshed successfully!
Custom commands reloaded: ${customCommands.length}
- Project commands: ${customCommands.filter((cmd) => cmd.name.startsWith("project:")).length}
- User commands: ${customCommands.filter((cmd) => cmd.name.startsWith("user:")).length}
Use /help to see updated command list.`;
} catch (error) {
console.error("Failed to refresh commands:", error);
return "\uFFFD\uFFFD?Failed to refresh commands. Check console for details.";
}
},
userFacingName() {
return "refresh-commands";
}
};
var refreshCommands_default = refreshCommands;
export {
refreshCommands_default as default
};
//# sourceMappingURL=refreshCommands.js.map