feat: Improve SystemPrompt clarity for terminal, professional, and summary skills, and add interactive execution confirmation to the terminal skill script.
This commit is contained in:
@@ -73,7 +73,9 @@ public static class SkillRegistry
|
|||||||
Hotwords = new[] { "System terminal", "System run", "System execute" },
|
Hotwords = new[] { "System terminal", "System run", "System execute" },
|
||||||
Action = "script",
|
Action = "script",
|
||||||
ScriptPath = "~/.config/toak/skills/terminal_action.sh",
|
ScriptPath = "~/.config/toak/skills/terminal_action.sh",
|
||||||
SystemPrompt = "You are a Linux terminal expert. Translate the user's request into a single, valid bash command. Output ONLY the raw command, no formatting, no markdown."
|
SystemPrompt = @"You are a Linux terminal expert.
|
||||||
|
Translate the user's request into a single, valid bash command.
|
||||||
|
Output ONLY the raw command, no formatting, no markdown."
|
||||||
},
|
},
|
||||||
new SkillDefinition
|
new SkillDefinition
|
||||||
{
|
{
|
||||||
@@ -92,7 +94,12 @@ Output ONLY the final translated text. Do not include markdown, explanations, or
|
|||||||
Description = "Rewrites text into a formal, articulate tone.",
|
Description = "Rewrites text into a formal, articulate tone.",
|
||||||
Hotwords = new[] { "System professional", "System formalize", "System formal" },
|
Hotwords = new[] { "System professional", "System formalize", "System formal" },
|
||||||
Action = "type",
|
Action = "type",
|
||||||
SystemPrompt = "Rewrite the following text to be articulate and formal. Do not add any conversational filler. Text: {transcript}"
|
SystemPrompt = @"Rewrite the following text to be articulate and formal.
|
||||||
|
The text will start with 'System professional', 'System formalize', or 'System formal',
|
||||||
|
or something along the lines of that. You can ignore those words.
|
||||||
|
Do not add any conversational filler.
|
||||||
|
Make sure to preserve the meaning of the original text.
|
||||||
|
Text: {transcript}"
|
||||||
},
|
},
|
||||||
new SkillDefinition
|
new SkillDefinition
|
||||||
{
|
{
|
||||||
@@ -100,7 +107,12 @@ Output ONLY the final translated text. Do not include markdown, explanations, or
|
|||||||
Description = "Provides a direct, crisp summary of the dictation.",
|
Description = "Provides a direct, crisp summary of the dictation.",
|
||||||
Hotwords = new[] { "System summary", "System concise", "System summarize" },
|
Hotwords = new[] { "System summary", "System concise", "System summarize" },
|
||||||
Action = "type",
|
Action = "type",
|
||||||
SystemPrompt = "Summarize the following text to be as concise and direct as possible. Remove all fluff. Text: {transcript}"
|
SystemPrompt = @"Summarize the following text to be as concise
|
||||||
|
and direct as possible.
|
||||||
|
The text will start with 'System summary', 'System concise', or 'System summarize',
|
||||||
|
and you can ignore those words.
|
||||||
|
Remove all fluff.
|
||||||
|
Text: {transcript}"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -115,7 +127,18 @@ Output ONLY the final translated text. Do not include markdown, explanations, or
|
|||||||
string scriptPath = Path.Combine(SkillsDirectory, "terminal_action.sh");
|
string scriptPath = Path.Combine(SkillsDirectory, "terminal_action.sh");
|
||||||
if (!File.Exists(scriptPath))
|
if (!File.Exists(scriptPath))
|
||||||
{
|
{
|
||||||
File.WriteAllText(scriptPath, "#!/bin/bash\n\n# Terminal skill wrapper script.\n# The LLM output is passed as the first argument ($1).\nx-terminal-emulator -e bash -c \"$1; exec bash\"\n");
|
string scriptContent = "#!/bin/bash\n" +
|
||||||
|
"export TOAK_PROPOSED_CMD=\"$1\"\n" +
|
||||||
|
"x-terminal-emulator -e bash -c 'echo -e \"\\033[1;32mToak Terminal Skill\\033[0m\"; " +
|
||||||
|
"echo \"Proposed command:\"; echo; " +
|
||||||
|
"echo -e \" \\033[33m$TOAK_PROPOSED_CMD\\033[0m\"; echo; " +
|
||||||
|
"read -p \"Execute command? [Y/n] \" resp; " +
|
||||||
|
"if [[ $resp =~ ^[Yy]$ ]] || [[ -z $resp ]]; then " +
|
||||||
|
"echo; echo -e \"\\033[1;36m>> Executing...\\033[0m\"; eval \"$TOAK_PROPOSED_CMD\"; " +
|
||||||
|
"else echo; echo \"Aborted.\"; fi; " +
|
||||||
|
"echo; echo \"Process finished. Press Enter to exit.\"; read;'\n";
|
||||||
|
|
||||||
|
File.WriteAllText(scriptPath, scriptContent);
|
||||||
|
|
||||||
// Try to make it executable
|
// Try to make it executable
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user