Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,25 @@ NC='\033[0m'
# --- Channel registry ---
# Single source of truth. Add new channels here and everything else adapts.

ALL_CHANNELS=(discord whatsapp telegram)
ALL_CHANNELS=(discord whatsapp telegram msteams)

declare -A CHANNEL_DISPLAY=(
[discord]="Discord"
[whatsapp]="WhatsApp"
[telegram]="Telegram"
[msteams]="Microsoft Teams"
)
declare -A CHANNEL_SCRIPT=(
[discord]="dist/channels/discord-client.js"
[whatsapp]="dist/channels/whatsapp-client.js"
[telegram]="dist/channels/telegram-client.js"
[msteams]="dist/channels/teams-client.js"
)
declare -A CHANNEL_ALIAS=(
[discord]="dc"
[whatsapp]="wa"
[telegram]="tg"
[msteams]="teams"
)
declare -A CHANNEL_TOKEN_KEY=(
[discord]="discord_bot_token"
Expand Down
50 changes: 47 additions & 3 deletions lib/setup-wizard.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ echo ""

# --- Channel registry ---
# To add a new channel, add its ID here and fill in the config arrays below.
ALL_CHANNELS=(telegram discord whatsapp)
ALL_CHANNELS=(telegram discord whatsapp msteams)

declare -A CHANNEL_DISPLAY=(
[telegram]="Telegram"
[discord]="Discord"
[whatsapp]="WhatsApp"
[msteams]="Microsoft Teams"
)
declare -A CHANNEL_TOKEN_KEY=(
[discord]="discord_bot_token"
Expand All @@ -40,7 +41,7 @@ declare -A CHANNEL_TOKEN_HELP=(
)

# Channel selection - simple checklist
echo "Which messaging channels (Telegram, Discord, WhatsApp) do you want to enable?"
echo "Which messaging channels (Telegram, Discord, WhatsApp, Microsoft Teams) do you want to enable?"
echo ""

ENABLED_CHANNELS=()
Expand Down Expand Up @@ -78,6 +79,44 @@ for ch in "${ENABLED_CHANNELS[@]}"; do
fi
done

# Collect Teams credentials
TEAMS_APP_ID=""
TEAMS_APP_PASSWORD=""
TEAMS_PORT="3978"
if printf '%s\n' "${ENABLED_CHANNELS[@]}" | grep -qx "msteams"; then
echo "Enter your Microsoft Teams App ID:"
echo -e "${YELLOW}(From your Microsoft Entra app registration)${NC}"
echo ""
read -rp "App ID: " TEAMS_APP_ID

if [ -z "$TEAMS_APP_ID" ]; then
echo -e "${RED}Microsoft Teams App ID is required${NC}"
exit 1
fi

echo ""
echo "Enter your Microsoft Teams App Password (client secret):"
read -rs -p "App Password: " TEAMS_APP_PASSWORD
echo ""

if [ -z "$TEAMS_APP_PASSWORD" ]; then
echo -e "${RED}Microsoft Teams App Password is required${NC}"
exit 1
fi

read -rp "Teams bot port [default: 3978]: " TEAMS_PORT_INPUT
if [ -n "$TEAMS_PORT_INPUT" ]; then
if [[ "$TEAMS_PORT_INPUT" =~ ^[0-9]+$ ]]; then
TEAMS_PORT="$TEAMS_PORT_INPUT"
else
echo -e "${YELLOW}Invalid port, using default 3978${NC}"
fi
fi

echo -e "${GREEN}✓ Microsoft Teams credentials saved${NC}"
echo ""
fi

# Provider selection
echo "Which AI provider?"
echo ""
Expand Down Expand Up @@ -288,7 +327,12 @@ cat > "$SETTINGS_FILE" <<EOF
"telegram": {
"bot_token": "${TELEGRAM_TOKEN}"
},
"whatsapp": {}
"whatsapp": {},
"teams": {
"app_id": "${TEAMS_APP_ID}",
"app_password": "${TEAMS_APP_PASSWORD}",
"port": ${TEAMS_PORT}
}
},
${AGENTS_JSON}
${MODELS_SECTION},
Expand Down
Loading