(rootDir: string)
| 9 | } |
| 10 | |
| 11 | export function buildHelpMessage(rootDir: string): string { |
| 12 | const sections: string[] = []; |
| 13 | |
| 14 | const commands = getVisibleCommands(); |
| 15 | const commandLines = commands.map( |
| 16 | (cmd) => `- \`/${cmd.command}\` — ${cmd.description}`, |
| 17 | ); |
| 18 | sections.push(`📋 **Available Commands**\n\n${commandLines.join("\n")}`); |
| 19 | |
| 20 | const configPath = path.resolve(rootDir, "skillpack.json"); |
| 21 | const skills = readInstalledSkills(configPath); |
| 22 | |
| 23 | if (skills.length > 0) { |
| 24 | const skillLines = skills.map( |
| 25 | (skill) => |
| 26 | `- **${skill.name}**${skill.description ? ` — ${skill.description}` : ""}`, |
| 27 | ); |
| 28 | sections.push( |
| 29 | `🧩 **Installed Skills** (${skills.length})\n\n${skillLines.join("\n")}`, |
| 30 | ); |
| 31 | } else { |
| 32 | sections.push("🧩 **Installed Skills**\nNo skills installed."); |
| 33 | } |
| 34 | |
| 35 | sections.push( |
| 36 | [ |
| 37 | "⏰ **Scheduled Tasks**", |
| 38 | "", |
| 39 | "You can set up recurring tasks using natural language. For example:", |
| 40 | "", |
| 41 | '- "Send me a daily market briefing every morning at 9 AM"', |
| 42 | '- "Summarize this week\'s trading data every Friday at 6 PM"', |
| 43 | '- "Check for new announcements every 30 minutes"', |
| 44 | "", |
| 45 | "I will handle the cron scheduling automatically.", |
| 46 | ].join("\n"), |
| 47 | ); |
| 48 | |
| 49 | return sections.join("\n\n"); |
| 50 | } |
| 51 | |
| 52 | export function handleHelpCommand(rootDir: string): CommandResult { |
| 53 | return { |
no test coverage detected