feat: allow skills starting with underscore to work

This commit is contained in:
larchanka
2026-03-24 16:14:21 +01:00
committed by Mikhail Larchanka
parent d2d9129e1c
commit 9b949f7a3a
2 changed files with 4 additions and 4 deletions

View File

@@ -126,7 +126,7 @@ const HELP_TEXT = `Commands:
- Cancel a reminder: /cancel_reminder <id>
🛠 Skills:
- Add a new skill: /add_skill <URL_TO_SKILL_MD> (downloads to an underscore-prefixed folder)`;
- Add a new skill: /add_skill <URL_TO_SKILL_MD> (git-ignored by default)`;
/** chatId -> current conversation ID for session grouping */
const conversationIdByChat = new Map<number, string>();
@@ -476,7 +476,7 @@ function main(): void {
createWriteStream(targetPath)
);
await sendToUser(chatId, `✅ Skill added to folder: <code>${folderName}</code>\n\nNotes:\n- The skill is currently <b>disabled</b> (starts with <code>_</code>).\n- Rename the folder to remove the underscore to enable it.\n- Use <code>/help</code> to see available commands.`, undefined, undefined, true);
await sendToUser(chatId, `✅ Skill added and <b>enabled</b> in folder: <code>${folderName}</code>\n\nNotes:\n- The folder starts with <code>_</code> to keep it out of Git (ignored).\n- Use <code>/help</code> to see available commands.`, undefined, undefined, true);
} catch (err) {
console.error("[telegram-adapter] /add_skill error:", err);
await sendToUser(chatId, `❌ Error adding skill: ${err instanceof Error ? err.message : String(err)}`);

View File

@@ -31,8 +31,8 @@ export class SkillManager {
const skills: SkillInfo[] = [];
for (const entry of entries) {
// Ignore hidden directories and those starting with underscore (disabled)
if (entry.isDirectory() && !entry.name.startsWith(".") && !entry.name.startsWith("_")) {
// Ignore hidden directories
if (entry.isDirectory() && !entry.name.startsWith(".")) {
const skillMdPath = join(this.skillsDir, entry.name, "SKILL.md");
if (existsSync(skillMdPath)) {
try {