feat: configurable AI-bridge trigger word for telegram listener
gates / consistency-and-conventions (push) Successful in 1m50s
gates / consistency-and-conventions (push) Successful in 1m50s
The listener's "ai " bridge prefix was hard-coded. Messages starting with <prefix> + space (case-insensitive, literal match) are now forwarded to Gemini; default stays "ai". - TELEGRAM_AI_PREFIX in telegram.env (default ai), hot-reloaded per message like the command map — no daemon restart needed - New 'prefix' verb: pos communication telegram listener prefix [word] (validated [A-Za-z0-9][A-Za-z0-9_-]*; writes telegram.env chmod 600) - Field added to the telegram # POS_CONFIG: scope (sender header) so 'pos config telegram' edits it too - --status shows the current prefix; usage + POS_SUBCMDS: prefix (completions regenerated) - Matching via scoped nocasematch + quoted-literal =~ prefix; ai_bridge_prefix() precedence: env file > env var > default ai Verified: routing harness (default/custom/case-insensitive/reset/ fallback/unknown-command) green, CLI verb tests, dispatch smoke, pos config render, gates 0 FAIL 0 WARN.
This commit is contained in:
@@ -3,7 +3,7 @@ set -euo pipefail
|
||||
# POS: communication telegram-sender — Send Telegram messages/files/links/stickers via Bot API (send, test)
|
||||
# POS_FLAGS: --type --caption --parse-mode --no-preview --token --chat-id --markdown
|
||||
# POS_SUBCMDS: send test
|
||||
# POS_CONFIG: telegram | telegram.env | TELEGRAM_BOT_TOKEN=secret:Bot token from @BotFather | TELEGRAM_CHAT_ID=digits:Numeric chat id from @userinfobot
|
||||
# POS_CONFIG: telegram | telegram.env | TELEGRAM_BOT_TOKEN=secret:Bot token from @BotFather | TELEGRAM_CHAT_ID=digits:Numeric chat id from @userinfobot | TELEGRAM_AI_PREFIX=:AI-bridge trigger word in the telegram listener (default ai)::ai
|
||||
|
||||
CONFIG_DIR="${CONFIG_DIR:-${XDG_CONFIG_HOME:-$HOME/.config}/linux_post_install}"
|
||||
CONFIG_FILE="$CONFIG_DIR/telegram.env"
|
||||
|
||||
Reference in New Issue
Block a user