feat: removed conditional fallback of LLM_*_RAW_JSON from built-ins
This commit is contained in:
@@ -10,6 +10,9 @@ set -e
|
||||
source "$LLM_PROMPT_UTILS_FILE"
|
||||
|
||||
main() {
|
||||
# shellcheck disable=SC2154
|
||||
argc_command="$(jq -r '.command' <<< "$LLM_TOOL_RAW_JSON")"
|
||||
|
||||
guard_operation
|
||||
local script
|
||||
script="$(mktemp)"
|
||||
|
||||
@@ -14,6 +14,8 @@ source "$LLM_PROMPT_UTILS_FILE"
|
||||
|
||||
# shellcheck disable=SC2154
|
||||
main() {
|
||||
argc_code="$(jq -r '.code' <<< "$LLM_TOOL_RAW_JSON")"
|
||||
|
||||
if ! grep -qi '^select' <<<"$argc_code"; then
|
||||
guard_operation ""
|
||||
fi
|
||||
|
||||
@@ -16,6 +16,9 @@ source "$LLM_PROMPT_UTILS_FILE"
|
||||
|
||||
# shellcheck disable=SC2154
|
||||
main() {
|
||||
argc_contents="$(jq -r '.contents' <<< "$LLM_TOOL_RAW_JSON")"
|
||||
argc_path="$(jq -r '.path' <<< "$LLM_TOOL_RAW_JSON")"
|
||||
|
||||
if [[ ! -f "$argc_path" ]]; then
|
||||
error "Unable to find the specified file: $argc_path"
|
||||
exit 1
|
||||
|
||||
@@ -15,6 +15,9 @@ source "$LLM_PROMPT_UTILS_FILE"
|
||||
|
||||
# shellcheck disable=SC2154
|
||||
main() {
|
||||
argc_contents="$(jq -r '.contents' <<< "$LLM_TOOL_RAW_JSON")"
|
||||
argc_path="$(jq -r '.path' <<< "$LLM_TOOL_RAW_JSON")"
|
||||
|
||||
if [[ -f "$argc_path" ]]; then
|
||||
printf "%s" "$argc_contents" | git diff --no-index "$argc_path" - || true
|
||||
guard_operation "Apply changes?"
|
||||
|
||||
@@ -14,6 +14,10 @@ set -e
|
||||
|
||||
# shellcheck disable=SC2154
|
||||
main() {
|
||||
argc_recipient="$(jq -r '.recipient' <<< "$LLM_TOOL_RAW_JSON")"
|
||||
argc_subject="$(jq -r '.subject' <<< "$LLM_TOOL_RAW_JSON")"
|
||||
argc_body="$(jq -r '.body' <<< "$LLM_TOOL_RAW_JSON")"
|
||||
|
||||
sender_name="${EMAIL_SENDER_NAME:-$(echo "$EMAIL_SMTP_USER" | awk -F'@' '{print $1}')}"
|
||||
printf "%s\n" "From: $sender_name <$EMAIL_SMTP_USER>
|
||||
To: $argc_recipient
|
||||
|
||||
Reference in New Issue
Block a user