2.5.2 #12

Merged
rune merged 23 commits from 2.5.2 into main 2026-08-17 08:37:04 +02:00
Showing only changes of commit 7527cc4091 - Show all commits
+5 -4
View File
@@ -1242,12 +1242,13 @@ It's better to admit "I need more information" or "I cannot do that" than to fak
// function call. Quoting the prompt is still the fully robust habit for other shell metacharacters
// (`;`, `|`, backticks, `$()`), but this covers the specific class of crash users are most likely
// to hit by accident (an unquoted question ending in "?").
// Deliberately one line, no backslash continuations: a `\` line-continuation is silently
// broken by a trailing space or a dropped backslash from copy/pasting out of a chat UI or
// browser each following line then gets parsed as its own bogus command ("command not
// found: -H", etc.). A long single line has no continuation character to mangle.
private static let cliShellFunctionSnippet = """
_ai_impl() {
curl -s --unix-socket "$HOME/Library/Application Support/oAI/cli.sock" \\
-H "Content-Type: application/json" \\
-d "$(jq -n --arg p "$*" '{prompt: $p}')" \\
http://localhost/ | jq -r 'if .error then "Error: " + .error else .response end'
curl -s --unix-socket "$HOME/Library/Application Support/oAI/cli.sock" -H "Content-Type: application/json" -d "$(jq -n --arg p "$*" '{prompt: $p}')" http://localhost/ | jq -r 'if .error then "Error: " + .error else .response end'
}
alias ai='noglob _ai_impl'
"""