()
| 187 | |
| 188 | |
| 189 | def main(): |
| 190 | print("\n" + "=" * 80) |
| 191 | print(" Slack Integration Setup for AgentSPEX") |
| 192 | print("=" * 80) |
| 193 | |
| 194 | # Step 1: Name your bot |
| 195 | print("\n[1/6] Name Your Bot...") |
| 196 | |
| 197 | existing_name = get_existing_bot_name() |
| 198 | default_name = existing_name or "Sandbox Agent" |
| 199 | |
| 200 | print_box( |
| 201 | [ |
| 202 | "Choose a name for your Slack bot.", |
| 203 | "", |
| 204 | "If multiple people add this bot to the same workspace,", |
| 205 | "each person should pick a unique name to avoid conflicts.", |
| 206 | "", |
| 207 | f"Current default: {default_name}", |
| 208 | ], |
| 209 | title="Bot Naming", |
| 210 | ) |
| 211 | |
| 212 | while True: |
| 213 | bot_app_name = input(f"\n Bot name [{default_name}]: ").strip() |
| 214 | if not bot_app_name: |
| 215 | bot_app_name = default_name |
| 216 | |
| 217 | valid, error = validate_bot_name(bot_app_name) |
| 218 | if valid: |
| 219 | break |
| 220 | print_error(error) |
| 221 | |
| 222 | bot_display_name = make_bot_display_name(bot_app_name) |
| 223 | slash_command = make_slash_command(bot_display_name) |
| 224 | print_success(f"App name: {bot_app_name}") |
| 225 | print_success(f"Display name: @{bot_display_name}") |
| 226 | print_success(f"Slash command: {slash_command}") |
| 227 | |
| 228 | if existing_name and bot_app_name != existing_name: |
| 229 | print_info( |
| 230 | "Name changed — you'll need to create a new Slack app or rename the existing one." |
| 231 | ) |
| 232 | |
| 233 | # Step 2: Show Slack app creation guide |
| 234 | print("\n[2/6] Create Slack App...") |
| 235 | |
| 236 | # Load manifest template and customize with chosen name |
| 237 | if MANIFEST_PATH.exists(): |
| 238 | with open(MANIFEST_PATH, "r") as f: |
| 239 | manifest_template = f.read() |
| 240 | else: |
| 241 | print_error(f"Manifest not found: {MANIFEST_PATH}") |
| 242 | sys.exit(1) |
| 243 | |
| 244 | manifest = customize_manifest( |
| 245 | manifest_template, bot_app_name, bot_display_name, slash_command |
| 246 | ) |
no test coverage detected