18 lines
763 B
Bash
Executable File
18 lines
763 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Read JSON input from stdin and extract the prompt field
|
|
prompt=$(cat | jq -r '.prompt // empty')
|
|
|
|
# Check if the prompt ends with a question mark (ignoring trailing whitespace)
|
|
if echo "$prompt" | grep -qE '\?\s*$'; then
|
|
# Use JSON additionalContext for discrete injection (not shown to user)
|
|
cat <<'EOF'
|
|
{
|
|
"hookSpecificOutput": {
|
|
"hookEventName": "UserPromptSubmit",
|
|
"additionalContext": "STOP: This is a QUESTION. Suspend the current task, if any, and answer the question directly and concisely. Do NOT take any further actions, run any tools (except as necessary to answer the question), or continue previous work until instructed to 'resume' or otherwise continue the task. Wait for the user's next instruction."
|
|
}
|
|
}
|
|
EOF
|
|
fi
|