system_init.py 698 B

1234567891011121314151617181920212223
  1. from __future__ import annotations
  2. from .commands import built_in_command_names, get_commands
  3. from .setup import run_setup
  4. from .tools import get_tools
  5. def build_system_init_message(trusted: bool = True) -> str:
  6. setup = run_setup(trusted=trusted)
  7. commands = get_commands()
  8. tools = get_tools()
  9. lines = [
  10. '# System Init',
  11. '',
  12. f'Trusted: {setup.trusted}',
  13. f'Built-in command names: {len(built_in_command_names())}',
  14. f'Loaded command entries: {len(commands)}',
  15. f'Loaded tool entries: {len(tools)}',
  16. '',
  17. 'Startup steps:',
  18. *(f'- {step}' for step in setup.setup.startup_steps()),
  19. ]
  20. return '\n'.join(lines)