chore: Introduce Qodana static analysis configuration and apply minor code formatting and C# 12 collection expressions.
This commit is contained in:
@@ -10,7 +10,7 @@ public class DynamicSkill : ISkill
|
||||
public string Name => _def.Name;
|
||||
public string Description => _def.Description;
|
||||
public string[] Hotwords => _def.Hotwords;
|
||||
|
||||
|
||||
public bool HandlesExecution => _def.Action.ToLowerInvariant() == "script";
|
||||
|
||||
public DynamicSkill(SkillDefinition def)
|
||||
|
||||
@@ -5,9 +5,9 @@ public interface ISkill
|
||||
string Name { get; }
|
||||
string Description { get; }
|
||||
string[] Hotwords { get; }
|
||||
|
||||
|
||||
bool HandlesExecution { get; }
|
||||
|
||||
|
||||
string GetSystemPrompt(string rawTranscript);
|
||||
void Execute(string llmResult);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ public static class SkillRegistry
|
||||
public static List<ISkill> AllSkills = new List<ISkill>();
|
||||
|
||||
public static string SkillsDirectory => Path.Combine(
|
||||
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
|
||||
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
|
||||
".config", "toak", "skills");
|
||||
|
||||
public static void Initialize()
|
||||
@@ -48,7 +48,7 @@ public static class SkillRegistry
|
||||
|
||||
var activeSkills = AllSkills.Where(s => activeSkillNames.Contains(s.Name, StringComparer.OrdinalIgnoreCase)).ToList();
|
||||
string normalizedTranscript = transcript.Trim();
|
||||
|
||||
|
||||
foreach (var skill in activeSkills)
|
||||
{
|
||||
foreach (var hotword in skill.Hotwords)
|
||||
@@ -70,7 +70,7 @@ public static class SkillRegistry
|
||||
{
|
||||
Name = "Terminal",
|
||||
Description = "Translates the spoken command into a bash command and types it.",
|
||||
Hotwords = new[] { "System terminal", "System run", "System execute" },
|
||||
Hotwords = ["System terminal", "System run", "System execute"],
|
||||
Action = "type",
|
||||
SystemPrompt = @"You are a Linux terminal expert.
|
||||
Translate the user's request into a single, valid bash command.
|
||||
@@ -80,7 +80,7 @@ Output ONLY the raw command, no formatting, no markdown."
|
||||
{
|
||||
Name = "Translate",
|
||||
Description = "Translates the spoken text into another language on the fly.",
|
||||
Hotwords = new[] { "System translate to", "System translate into" },
|
||||
Hotwords = ["System translate to", "System translate into"],
|
||||
Action = "type",
|
||||
SystemPrompt = @"You are an expert translator. The user wants to translate the following text.
|
||||
The first few words identify the target language (e.g. 'Translate to Spanish:', 'Translate into Hungarian:').
|
||||
@@ -91,7 +91,7 @@ Output ONLY the final translated text. Do not include markdown, explanations, or
|
||||
{
|
||||
Name = "Professional",
|
||||
Description = "Rewrites text into a formal, articulate tone.",
|
||||
Hotwords = new[] { "System professional", "System formalize", "System formal" },
|
||||
Hotwords = ["System professional", "System formalize", "System formal"],
|
||||
Action = "type",
|
||||
SystemPrompt = @"Rewrite the following text to be articulate and formal.
|
||||
The text will start with 'System professional', 'System formalize', or 'System formal',
|
||||
@@ -105,7 +105,7 @@ Text: {transcript}"
|
||||
{
|
||||
Name = "Summary",
|
||||
Description = "Provides a direct, crisp summary of the dictation.",
|
||||
Hotwords = new[] { "System summary", "System concise", "System summarize" },
|
||||
Hotwords = ["System summary", "System concise", "System summarize"],
|
||||
Action = "type",
|
||||
SystemPrompt = @"Summarize the following text to be as concise
|
||||
and direct as possible.
|
||||
|
||||
Reference in New Issue
Block a user