feat: expand skill command registration

This commit is contained in:
Peter Steinberger
2026-01-16 20:11:01 +00:00
parent 69761e8a51
commit 38b49aa0f6
21 changed files with 311 additions and 45 deletions

View File

@@ -1,4 +1,5 @@
import { getChannelDock } from "../../channels/dock.js";
import type { SkillCommandSpec } from "../../agents/skills.js";
import type { ClawdbotConfig } from "../../config/config.js";
import type { SessionEntry } from "../../config/sessions.js";
import type { MsgContext, TemplateContext } from "../templating.js";
@@ -39,6 +40,7 @@ export async function handleInlineActions(params: {
allowTextCommands: boolean;
inlineStatusRequested: boolean;
command: Parameters<typeof handleCommands>[0]["command"];
skillCommands?: SkillCommandSpec[];
directives: InlineDirectives;
cleanedBody: string;
elevatedEnabled: boolean;
@@ -99,13 +101,16 @@ export async function handleInlineActions(params: {
let cleanedBody = initialCleanedBody;
const shouldLoadSkillCommands = command.commandBodyNormalized.startsWith("/");
const skillCommands = shouldLoadSkillCommands
? listSkillCommandsForWorkspace({
workspaceDir,
cfg,
skillFilter,
})
: [];
const skillCommands =
shouldLoadSkillCommands && params.skillCommands
? params.skillCommands
: shouldLoadSkillCommands
? listSkillCommandsForWorkspace({
workspaceDir,
cfg,
skillFilter,
})
: [];
const skillInvocation =
allowTextCommands && skillCommands.length > 0