MCPcopy
hub / github.com/zai-org/Open-AutoGLM / main

Function main

ios.py:446–546  ·  view source on GitHub ↗

Main entry point.

()

Source from the content-addressed store, hash-verified

444
445
446def main():
447 """Main entry point."""
448 args = parse_args()
449
450 # Handle --list-apps (no system check needed)
451 if args.list_apps:
452 print("Supported iOS apps:")
453 print("\nNote: For iOS apps, Bundle IDs are configured in:")
454 print(" phone_agent/config/apps_ios.py")
455 print("\nCurrently configured apps:")
456 for app in sorted(list_supported_apps()):
457 print(f" - {app}")
458 print(
459 "\nTo add iOS apps, find the Bundle ID and add to APP_PACKAGES_IOS dictionary."
460 )
461 return
462
463 # Handle device commands (these may need partial system checks)
464 if handle_device_commands(args):
465 return
466
467 # Run system requirements check before proceeding
468 if not check_system_requirements(wda_url=args.wda_url):
469 sys.exit(1)
470
471 # Check model API connectivity and model availability
472 # if not check_model_api(args.base_url, args.api_key, args.model):
473 # sys.exit(1)
474
475 # Create configurations
476 model_config = ModelConfig(
477 base_url=args.base_url,
478 model_name=args.model,
479 api_key=args.api_key
480 )
481
482 agent_config = IOSAgentConfig(
483 max_steps=args.max_steps,
484 wda_url=args.wda_url,
485 device_id=args.device_id,
486 verbose=not args.quiet,
487 lang=args.lang,
488 )
489
490 # Create iOS agent
491 agent = IOSPhoneAgent(
492 model_config=model_config,
493 agent_config=agent_config,
494 )
495
496 # Print header
497 print("=" * 50)
498 print("Phone Agent iOS - AI-powered iOS automation")
499 print("=" * 50)
500 print(f"Model: {model_config.model_name}")
501 print(f"Base URL: {model_config.base_url}")
502 print(f"WDA URL: {args.wda_url}")
503 print(f"Max Steps: {agent_config.max_steps}")

Callers 1

ios.pyFile · 0.70

Calls 10

runMethod · 0.95
resetMethod · 0.95
list_supported_appsFunction · 0.90
ModelConfigClass · 0.90
IOSAgentConfigClass · 0.90
IOSPhoneAgentClass · 0.90
list_devicesFunction · 0.90
parse_argsFunction · 0.70
handle_device_commandsFunction · 0.70

Tested by

no test coverage detected