Skip to content

Commit 115b3fb

Browse files
committed
feat(install): update bot onboarding prompts and versioning
- Bump version to 1.6.19 in pyproject.toml and uv.lock - Enhance `install.sh` to always prompt for bot onboarding with clearer messaging - Update integration test to reflect changes in bot onboarding prompt visibility and logic
1 parent 588d432 commit 115b3fb

4 files changed

Lines changed: 59 additions & 52 deletions

File tree

src/praisonai-agents/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "praisonaiagents"
7-
version = "1.6.18"
7+
version = "1.6.19"
88
description = "Praison AI agents for completing complex tasks with Self Reflection Agents"
99
readme = "README.md"
1010
requires-python = ">=3.10"

src/praisonai-agents/uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/praisonai/scripts/install.sh

Lines changed: 46 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,12 @@ print_next_steps() {
503503
echo ""
504504
fi
505505

506+
echo " Set up a messaging bot (Telegram / Discord / Slack / WhatsApp):"
507+
echo -e " ${CYAN}praisonai onboard${NC}"
508+
echo ""
509+
echo " Open the dashboard UI:"
510+
echo -e " ${CYAN}praisonai claw${NC} ${BOLD}${NC} http://127.0.0.1:8082"
511+
echo ""
506512
echo " Quick start:"
507513
echo -e " ${CYAN}python -c \"from praisonaiagents import Agent; Agent(name='test').start('Hello!')\"${NC}"
508514
echo ""
@@ -654,26 +660,28 @@ run_onboarding() {
654660
fi
655661
}
656662

657-
# Offer bot onboarding after setup
663+
# Offer bot onboarding after setup (always prompts when a TTY is available;
664+
# default answer is Yes so curl|bash installs finish with a working bot).
658665
maybe_offer_bot_onboarding() {
659666
local venv_dir="$1"
660-
661-
# Only run after praisonai setup completed interactively
662-
[[ "$NO_ONBOARD" == "1" ]] && return 0
663-
[[ "$NO_PROMPT" == "1" ]] && return 0
664-
[[ "$DRY_RUN" == "1" ]] && return 0
665-
[ -e /dev/tty ] || return 0
666-
667-
local env_file="$HOME/.praisonai/.env"
668-
[[ -f "$env_file" ]] || return 0
669-
670-
# Only if any messaging token already present (user set up bots elsewhere)
671-
# OR if user opts in interactively
672-
local has_token=0
673-
for tok in TELEGRAM_BOT_TOKEN DISCORD_BOT_TOKEN SLACK_BOT_TOKEN WHATSAPP_ACCESS_TOKEN; do
674-
grep -qE "^${tok}=..+" "$env_file" 2>/dev/null && has_token=1 && break
675-
done
676-
667+
668+
if [[ "$NO_ONBOARD" == "1" ]]; then
669+
log_info "Skipping bot onboarding (--no-onboard)"
670+
return 0
671+
fi
672+
if [[ "$NO_PROMPT" == "1" ]]; then
673+
log_info "Skipping bot onboarding (non-interactive mode) — run 'praisonai onboard' later"
674+
return 0
675+
fi
676+
if [[ "$DRY_RUN" == "1" ]]; then
677+
log_info "Dry run — skipping bot onboarding"
678+
return 0
679+
fi
680+
if ! [ -e /dev/tty ]; then
681+
log_info "No TTY available — skipping bot onboarding. Run 'praisonai onboard' later."
682+
return 0
683+
fi
684+
677685
# Prefer venv python, then user-specified, then system python3
678686
local py=""
679687
if [[ -n "$venv_dir" && "$SKIP_VENV" != "1" && -x "$venv_dir/bin/python" ]]; then
@@ -683,29 +691,26 @@ maybe_offer_bot_onboarding() {
683691
else
684692
py="python3"
685693
fi
686-
687-
if [[ "$has_token" == "1" ]]; then
688-
log_info "Detected a messaging token — launching bot onboarding..."
689-
if "$py" -m praisonai onboard < /dev/tty > /dev/tty 2> /dev/tty; then
690-
log_success "Bot onboarding completed!"
691-
else
692-
log_warn "Bot onboarding skipped or failed."
693-
fi
694-
else
695-
# Offer it; default NO so quiet installs stay quiet
696-
echo ""
697-
echo -ne "${CYAN}Set up a messaging bot now? [y/N] ${NC}"
698-
read -r yn < /dev/tty || yn=""
699-
case "$yn" in
700-
[yY]*)
701-
if "$py" -m praisonai onboard < /dev/tty > /dev/tty 2> /dev/tty; then
702-
log_success "Bot onboarding completed!"
703-
else
704-
log_warn "Bot onboarding skipped or failed."
705-
fi
706-
;;
707-
esac
708-
fi
694+
695+
# Always prompt so fresh installs discover the onboard wizard too.
696+
# Default is Yes — users running the curl|bash installer usually want
697+
# to finish end-to-end. They can answer N to skip or pass --no-onboard.
698+
echo ""
699+
echo -ne "${CYAN}Set up a messaging bot (Telegram / Discord / Slack / WhatsApp) now? [Y/n] ${NC}"
700+
local yn=""
701+
read -r yn < /dev/tty || yn=""
702+
case "$yn" in
703+
[nN]*)
704+
log_info "Skipped — run 'praisonai onboard' anytime to set up a bot."
705+
;;
706+
*)
707+
if "$py" -m praisonai onboard < /dev/tty > /dev/tty 2> /dev/tty; then
708+
log_success "Bot onboarding completed!"
709+
else
710+
log_warn "Bot onboarding skipped or failed — you can retry with 'praisonai onboard'."
711+
fi
712+
;;
713+
esac
709714
}
710715

711716
# Main installation function

src/praisonai/tests/integration/test_install_sh_bot_onboarding.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,24 @@ def test_install_sh_mentions_bot_onboarding():
3535
def test_bot_onboarding_function_logic():
3636
"""Test the logic of the bot onboarding function."""
3737
script_path = str(SCRIPT_PATH)
38-
38+
3939
with open(script_path, 'r') as f:
4040
content = f.read()
41-
41+
4242
# Check key environment variable checks
4343
assert "NO_ONBOARD" in content
4444
assert "NO_PROMPT" in content
4545
assert "DRY_RUN" in content
4646
assert "/dev/tty" in content
47-
48-
# Check token detection
49-
assert "TELEGRAM_BOT_TOKEN" in content
50-
assert "DISCORD_BOT_TOKEN" in content
51-
assert "SLACK_BOT_TOKEN" in content
52-
assert "WHATSAPP_ACCESS_TOKEN" in content
53-
47+
48+
# The installer should surface the bot wizard prompt visibly and
49+
# mention all supported platforms (not as token env-var checks,
50+
# but as part of the user-facing prompt copy).
51+
assert "Telegram" in content
52+
assert "Discord" in content
53+
assert "Slack" in content
54+
assert "WhatsApp" in content
55+
5456
# Check the function is called from main
5557
assert "maybe_offer_bot_onboarding" in content
5658

0 commit comments

Comments
 (0)