diff --git a/core/commands/slash/ruleBlockSlashCommand.ts b/core/commands/slash/ruleBlockSlashCommand.ts index 852d131a8..d907768cb 100644 --- a/core/commands/slash/ruleBlockSlashCommand.ts +++ b/core/commands/slash/ruleBlockSlashCommand.ts @@ -4,7 +4,9 @@ export function convertRuleBlockToSlashCommand( rule: RuleWithSource, ): SlashCommandWithSource { return { - name: rule.name || (rule.rule.length > 20 ? rule.rule.substring(0, 20) + "..." : rule.rule), + name: + rule.name || + (rule.rule.length > 20 ? rule.rule.substring(0, 20) + "..." : rule.rule), description: rule.description ?? "", prompt: rule.rule, source: "invokable-rule", diff --git a/core/commands/slash/ruleBlockSlashCommand.vitest.ts b/core/commands/slash/ruleBlockSlashCommand.vitest.ts index 45e9ae316..ccbc2df4f 100644 --- a/core/commands/slash/ruleBlockSlashCommand.vitest.ts +++ b/core/commands/slash/ruleBlockSlashCommand.vitest.ts @@ -47,7 +47,9 @@ describe("convertRuleBlockToSlashCommand", () => { const result = convertRuleBlockToSlashCommand(rule); expect(result.name).toBe("This is a very long ..."); - expect(result.prompt).toBe("This is a very long rule text that should be truncated"); + expect(result.prompt).toBe( + "This is a very long rule text that should be truncated", + ); }); it("should handle a rule without description", () => {