Files
oh-my-pi/packages/coding-agent/src/capability/slash-command.ts
T
can1357 779ca4872b style(deps): migrated from Prettier to Biome and updated formatting rules
- Removed Prettier configuration files (.prettierignore and .prettierrc) and migrated formatting to Biome.
- Updated Biome configuration from version 2.3.11 to 2.3.12 and changed arrowParentheses rule from 'always' to 'asNeeded'.
- Pinned @biomejs/biome dependency to exact version 2.3.12 in package.json and bun.lock.
- Applied consistent arrow function formatting across 489 files by removing unnecessary parentheses around single parameters.
- Removed blank lines after comment blocks and reorganized imports for consistency across the codebase.
2026-01-24 04:20:19 +01:00

40 lines
1.1 KiB
TypeScript

/**
* Slash Commands Capability
*
* File-based slash commands defined as markdown files.
*/
import { defineCapability } from ".";
import type { SourceMeta } from "./types";
/**
* A file-based slash command.
*/
export interface SlashCommand {
/** Command name (without leading slash) */
name: string;
/** Absolute path to command file */
path: string;
/** Command content (markdown template) */
content: string;
/** Source level */
level: "user" | "project" | "native";
/** Source metadata */
_source: SourceMeta;
}
export const slashCommandCapability = defineCapability<SlashCommand>({
id: "slash-commands",
displayName: "Slash Commands",
description: "Custom slash commands defined as markdown files",
key: cmd => cmd.name,
validate: cmd => {
if (!cmd.name) return "Missing name";
if (!cmd.path) return "Missing path";
if (cmd.content === undefined) return "Missing content";
if (cmd.level !== "user" && cmd.level !== "project" && cmd.level !== "native") {
return "Invalid level: must be 'user', 'project', or 'native'";
}
return undefined;
},
});