sycommon-python-lib 0.2.1a51__tar.gz → 0.2.1a52__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (205) hide show
  1. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/PKG-INFO +1 -1
  2. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/pyproject.toml +1 -1
  3. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycli/agents/factory.py +60 -46
  4. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycli/core/__init__.py +1 -1
  5. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycli/core/backend.py +8 -8
  6. sycommon_python_lib-0.2.1a52/src/sycli/core/config.py +4 -0
  7. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycli/core/display.py +18 -18
  8. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycli/core/git_integration.py +32 -32
  9. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycli/core/llm.py +10 -10
  10. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycli/core/state.py +6 -6
  11. sycommon_python_lib-0.2.1a52/src/sycli/memory/__init__.py +1 -0
  12. sycommon_python_lib-0.2.1a52/src/sycli/memory/compressor.py +134 -0
  13. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycli/memory/full.py +14 -14
  14. sycommon_python_lib-0.2.1a52/src/sycli/memory/hot.py +92 -0
  15. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycli/memory/manager.py +48 -48
  16. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycli/memory/warm.py +20 -20
  17. sycommon_python_lib-0.2.1a52/src/sycli/rl/__init__.py +1 -0
  18. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycli/rl/convergence.py +31 -31
  19. sycommon_python_lib-0.2.1a52/src/sycli/rl/diagnosis.py +188 -0
  20. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycli/rl/engine.py +412 -244
  21. sycommon_python_lib-0.2.1a52/src/sycli/rl/environment.py +237 -0
  22. sycommon_python_lib-0.2.1a52/src/sycli/rl/experience.py +203 -0
  23. sycommon_python_lib-0.2.1a52/src/sycli/rl/harness_prompts.py +93 -0
  24. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycli/rl/history.py +20 -20
  25. sycommon_python_lib-0.2.1a52/src/sycli/rl/pre_validation.py +106 -0
  26. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycli/rl/reward.py +34 -34
  27. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycli/rl/strategy_bandit.py +34 -34
  28. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycli/rl/strategy_generator.py +43 -41
  29. sycommon_python_lib-0.2.1a52/src/sycli/rl/strategy_prompts.py +93 -0
  30. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/agent/deep_agent.py +2 -0
  31. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/agent/multi_agent_team.py +3 -0
  32. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon_python_lib.egg-info/PKG-INFO +1 -1
  33. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon_python_lib.egg-info/SOURCES.txt +5 -0
  34. sycommon_python_lib-0.2.1a51/src/sycli/core/config.py +0 -4
  35. sycommon_python_lib-0.2.1a51/src/sycli/memory/__init__.py +0 -1
  36. sycommon_python_lib-0.2.1a51/src/sycli/memory/compressor.py +0 -145
  37. sycommon_python_lib-0.2.1a51/src/sycli/memory/hot.py +0 -92
  38. sycommon_python_lib-0.2.1a51/src/sycli/rl/__init__.py +0 -1
  39. sycommon_python_lib-0.2.1a51/src/sycli/rl/strategy_prompts.py +0 -53
  40. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/README.md +0 -0
  41. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/setup.cfg +0 -0
  42. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/command/__init__.py +0 -0
  43. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/command/cli.py +0 -0
  44. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/command/core/__init__.py +0 -0
  45. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/command/core/console.py +0 -0
  46. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/command/core/models.py +0 -0
  47. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/command/core/project.py +0 -0
  48. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/command/core/utils.py +0 -0
  49. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/command/templates/__init__.py +0 -0
  50. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/command/templates/agent/__init__.py +0 -0
  51. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/command/templates/base/__init__.py +0 -0
  52. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/command/templates/web/__init__.py +0 -0
  53. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycli/__init__.py +0 -0
  54. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycli/__main__.py +0 -0
  55. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycli/agents/__init__.py +0 -0
  56. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycli/agents/prompts.py +0 -0
  57. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycli/cli.py +0 -0
  58. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycli/commands/__init__.py +0 -0
  59. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycli/commands/chat_cmd.py +0 -0
  60. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycli/commands/create_cmd.py +0 -0
  61. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycli/commands/evaluate_cmd.py +0 -0
  62. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycli/commands/init_cmd.py +0 -0
  63. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycli/commands/memory_cmd.py +0 -0
  64. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycli/commands/resume_cmd.py +0 -0
  65. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycli/commands/rollback_cmd.py +0 -0
  66. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycli/commands/run_cmd.py +0 -0
  67. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycli/evaluate/__init__.py +0 -0
  68. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycli/evaluate/api_evaluator.py +0 -0
  69. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycli/mode/__init__.py +0 -0
  70. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycli/mode/create.py +0 -0
  71. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycli/mode/optimize.py +0 -0
  72. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycli/models/__init__.py +0 -0
  73. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycli/models/config_models.py +0 -0
  74. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycli/skills/__init__.py +0 -0
  75. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/__init__.py +0 -0
  76. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/agent/__init__.py +0 -0
  77. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/agent/agent_manager.py +0 -0
  78. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/agent/chat_events.py +0 -0
  79. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/agent/sandbox/__init__.py +0 -0
  80. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/agent/sandbox/file_ops.py +0 -0
  81. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/agent/sandbox/http_sandbox_backend.py +0 -0
  82. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/agent/sandbox/sandbox_pool.py +0 -0
  83. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/agent/sandbox/sandbox_recovery.py +0 -0
  84. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/agent/sandbox/session.py +0 -0
  85. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/auth/__init__.py +0 -0
  86. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/auth/ldap_service.py +0 -0
  87. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/config/Config.py +0 -0
  88. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/config/DatabaseConfig.py +0 -0
  89. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/config/ElasticsearchConfig.py +0 -0
  90. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/config/EmbeddingConfig.py +0 -0
  91. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/config/LLMConfig.py +0 -0
  92. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/config/LangfuseConfig.py +0 -0
  93. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/config/MQConfig.py +0 -0
  94. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/config/RedisConfig.py +0 -0
  95. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/config/RerankerConfig.py +0 -0
  96. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/config/SentryConfig.py +0 -0
  97. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/config/XxlJobConfig.py +0 -0
  98. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/config/__init__.py +0 -0
  99. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/database/async_base_db_service.py +0 -0
  100. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/database/async_database_service.py +0 -0
  101. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/database/base_db_service.py +0 -0
  102. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/database/database_service.py +0 -0
  103. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/database/elasticsearch_service.py +0 -0
  104. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/database/redis_service.py +0 -0
  105. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/database/token_usage_db_service.py +0 -0
  106. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/health/__init__.py +0 -0
  107. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/health/health_check.py +0 -0
  108. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/health/metrics.py +0 -0
  109. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/health/ping.py +0 -0
  110. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/heartbeat_process/__init__.py +0 -0
  111. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/heartbeat_process/heartbeat_config.py +0 -0
  112. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/heartbeat_process/heartbeat_process_manager.py +0 -0
  113. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/heartbeat_process/heartbeat_process_worker.py +0 -0
  114. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/llm/__init__.py +0 -0
  115. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/llm/embedding.py +0 -0
  116. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/llm/get_llm.py +0 -0
  117. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/llm/llm_logger.py +0 -0
  118. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/llm/llm_tokens.py +0 -0
  119. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/llm/llm_with_token_tracking.py +0 -0
  120. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/llm/native_with_fallback_runnable.py +0 -0
  121. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/llm/output_fixing_runnable.py +0 -0
  122. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/llm/struct_token.py +0 -0
  123. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/llm/sy_langfuse.py +0 -0
  124. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/llm/token_usage_es_service.py +0 -0
  125. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/llm/token_usage_mysql_service.py +0 -0
  126. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/llm/usage_token.py +0 -0
  127. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/logging/__init__.py +0 -0
  128. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/logging/async_sql_logger.py +0 -0
  129. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/logging/kafka_log.py +0 -0
  130. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/logging/logger_levels.py +0 -0
  131. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/logging/logger_wrapper.py +0 -0
  132. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/logging/process_logger.py +0 -0
  133. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/logging/sql_logger.py +0 -0
  134. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/middleware/__init__.py +0 -0
  135. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/middleware/background_execution.py +0 -0
  136. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/middleware/context.py +0 -0
  137. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/middleware/cors.py +0 -0
  138. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/middleware/docs.py +0 -0
  139. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/middleware/exception.py +0 -0
  140. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/middleware/middleware.py +0 -0
  141. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/middleware/monitor_memory.py +0 -0
  142. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/middleware/mq.py +0 -0
  143. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/middleware/sandbox.py +0 -0
  144. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/middleware/timeout.py +0 -0
  145. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/middleware/token_tracking.py +0 -0
  146. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/middleware/traceid.py +0 -0
  147. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/models/__init__.py +0 -0
  148. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/models/base_http.py +0 -0
  149. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/models/log.py +0 -0
  150. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/models/mqlistener_config.py +0 -0
  151. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/models/mqmsg_model.py +0 -0
  152. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/models/mqsend_config.py +0 -0
  153. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/models/sandbox.py +0 -0
  154. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/models/sso_user.py +0 -0
  155. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/models/token_usage.py +0 -0
  156. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/models/token_usage_mysql.py +0 -0
  157. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/models/xxljob_handler_config.py +0 -0
  158. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/notice/__init__.py +0 -0
  159. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/notice/uvicorn_monitor.py +0 -0
  160. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/rabbitmq/process_pool_consumer.py +0 -0
  161. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/rabbitmq/rabbitmq_client.py +0 -0
  162. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/rabbitmq/rabbitmq_pool.py +0 -0
  163. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/rabbitmq/rabbitmq_service.py +0 -0
  164. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/rabbitmq/rabbitmq_service_client_manager.py +0 -0
  165. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/rabbitmq/rabbitmq_service_connection_monitor.py +0 -0
  166. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/rabbitmq/rabbitmq_service_consumer_manager.py +0 -0
  167. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/rabbitmq/rabbitmq_service_core.py +0 -0
  168. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/rabbitmq/rabbitmq_service_producer_manager.py +0 -0
  169. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/sentry/__init__.py +0 -0
  170. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/sentry/sy_sentry.py +0 -0
  171. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/services.py +0 -0
  172. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/sse/__init__.py +0 -0
  173. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/sse/event.py +0 -0
  174. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/sse/sse.py +0 -0
  175. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/synacos/__init__.py +0 -0
  176. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/synacos/example.py +0 -0
  177. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/synacos/example2.py +0 -0
  178. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/synacos/feign.py +0 -0
  179. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/synacos/feign_client.py +0 -0
  180. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/synacos/nacos_client_base.py +0 -0
  181. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/synacos/nacos_config_manager.py +0 -0
  182. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/synacos/nacos_heartbeat_manager.py +0 -0
  183. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/synacos/nacos_service.py +0 -0
  184. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/synacos/nacos_service_discovery.py +0 -0
  185. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/synacos/nacos_service_registration.py +0 -0
  186. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/synacos/param.py +0 -0
  187. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/tests/deep_agent_server.py +0 -0
  188. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/tests/test_deep_agent.py +0 -0
  189. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/tests/test_email.py +0 -0
  190. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/tests/test_mq.py +0 -0
  191. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/tools/__init__.py +0 -0
  192. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/tools/async_utils.py +0 -0
  193. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/tools/docs.py +0 -0
  194. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/tools/env.py +0 -0
  195. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/tools/merge_headers.py +0 -0
  196. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/tools/snowflake.py +0 -0
  197. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/tools/syemail.py +0 -0
  198. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/tools/timing.py +0 -0
  199. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/xxljob/__init__.py +0 -0
  200. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon/xxljob/xxljob_service.py +0 -0
  201. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon_python_lib.egg-info/dependency_links.txt +0 -0
  202. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon_python_lib.egg-info/entry_points.txt +0 -0
  203. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon_python_lib.egg-info/requires.txt +0 -0
  204. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/src/sycommon_python_lib.egg-info/top_level.txt +0 -0
  205. {sycommon_python_lib-0.2.1a51 → sycommon_python_lib-0.2.1a52}/tests/test_sycli.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sycommon-python-lib
3
- Version: 0.2.1a51
3
+ Version: 0.2.1a52
4
4
  Summary: Add your description here
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "sycommon-python-lib"
3
- version = "0.2.1a51"
3
+ version = "0.2.1a52"
4
4
  description = "Add your description here"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -1,4 +1,4 @@
1
- """Agent factory - builds all agents for sycli."""
1
+ """Agent 工厂——构建 sycli 的所有 agent。"""
2
2
 
3
3
  from __future__ import annotations
4
4
 
@@ -10,24 +10,12 @@ from deepagents.backends.local_shell import LocalShellBackend
10
10
  from deepagents.middleware.memory import MemoryMiddleware
11
11
  from langchain_core.language_models import BaseChatModel
12
12
 
13
- from sycli.agents.prompts import (
14
- ANALYST_PROMPT,
15
- ARCHITECT_PROMPT,
16
- CODER_PROMPT,
17
- CRITIC_PROMPT,
18
- DATA_ANALYST_PROMPT,
19
- ORCHESTRATOR_PROMPT,
20
- PROMPT_ENGINEER_PROMPT,
21
- RESEARCHER_PROMPT,
22
- RUNTIME_OBSERVER_PROMPT,
23
- SERVICE_MANAGER_PROMPT,
24
- )
25
13
  from sycli.models.config_models import SkillSettings, SycliConfig
26
14
 
27
- # Builtin skills directory (shipped with sycli package)
15
+ # 内置技能目录(随 sycli 包发布)
28
16
  _BUILTIN_SKILLS_DIR = Path(__file__).parent.parent / "skills" / "builtin"
29
17
 
30
- # Mapping: agent name -> list of builtin skill directory names
18
+ # 映射:agent 名称 -> 内置技能目录名称列表
31
19
  _SKILL_AGENT_MAP: dict[str, list[str]] = {
32
20
  "coder": ["test-driven-development", "systematic-debugging"],
33
21
  "analyst": ["systematic-debugging"],
@@ -38,14 +26,14 @@ _SKILL_AGENT_MAP: dict[str, list[str]] = {
38
26
  def _get_skills_for_agent(
39
27
  agent_name: str, config_skills: SkillSettings
40
28
  ) -> list[str] | None:
41
- """Return skill source paths for a given agent, filtered by enabled config.
29
+ """返回指定 agent 的技能源路径,根据启用的配置进行过滤。
42
30
 
43
- Returns None (no skills key) if no skills apply to this agent.
31
+ 如果没有技能适用于此 agent,则返回 None(不设置 skills 键)。
44
32
  """
45
33
  skill_names = _SKILL_AGENT_MAP.get(agent_name, [])
46
34
  if not skill_names:
47
35
  return None
48
- # Filter by config.enabled (empty list = all disabled; only include enabled ones)
36
+ # 根据 config.enabled 过滤(空列表 = 全部禁用;仅包含已启用的)
49
37
  if config_skills.enabled is not None and len(config_skills.enabled) >= 0:
50
38
  if not config_skills.enabled:
51
39
  return None
@@ -57,7 +45,7 @@ def _get_skills_for_agent(
57
45
 
58
46
 
59
47
  def _inject_project_root(prompt: str, project_root: str) -> str:
60
- """Replace __PROJECT_ROOT__ placeholder with actual project root path."""
48
+ """ __PROJECT_ROOT__ 占位符替换为实际的项目根目录路径。"""
61
49
  return prompt.replace("__PROJECT_ROOT__", project_root)
62
50
 
63
51
 
@@ -66,13 +54,13 @@ def _memory_middleware(
66
54
  project_name: str,
67
55
  agent_role: str,
68
56
  ) -> MemoryMiddleware:
69
- """Create MemoryMiddleware with per-agent source paths.
57
+ """创建带有按 agent 源路径的 MemoryMiddleware。
70
58
 
71
- Sources loaded in order (concatenated):
72
- 1. hot/context.md - Layer 0+1: working memory
73
- 2. warm/agents/{role}.md - Layer 2: agent-specific compressed
74
- 3. warm/strategies.md - Layer 2: shared strategies
75
- 4. warm/anti_patterns.md - Layer 2: shared anti-patterns
59
+ 按顺序加载的源(拼接):
60
+ 1. hot/context.md - 0+1 层:工作记忆
61
+ 2. warm/agents/{role}.md - 2 层:agent 特定压缩
62
+ 3. warm/strategies.md - 2 层:共享策略
63
+ 4. warm/anti_patterns.md - 2 层:共享反模式
76
64
  """
77
65
  return MemoryMiddleware(
78
66
  backend=backend,
@@ -85,6 +73,30 @@ def _memory_middleware(
85
73
  )
86
74
 
87
75
 
76
+ def _get_prompt(
77
+ builtin_attr: str,
78
+ harness: Any | None = None,
79
+ agent_name: str = "",
80
+ project_root: str = "",
81
+ ) -> str:
82
+ """从 harness(基于文件)获取提示词,或回退到内置默认值。
83
+
84
+ 对任一来源应用 __PROJECT_ROOT__ 注入。
85
+ """
86
+ prompt = ""
87
+ if harness is not None:
88
+ prompt = harness.get_prompt(agent_name)
89
+ if not prompt:
90
+ prompt = getattr(
91
+ __import__("sycli.agents.prompts", fromlist=[builtin_attr]),
92
+ builtin_attr,
93
+ "",
94
+ )
95
+ if project_root:
96
+ prompt = _inject_project_root(prompt, project_root)
97
+ return prompt
98
+
99
+
88
100
  def build_subagents(
89
101
  config: SycliConfig,
90
102
  llm: BaseChatModel,
@@ -92,24 +104,26 @@ def build_subagents(
92
104
  project_name: str,
93
105
  mode: str = "optimize",
94
106
  project_root: str | None = None,
107
+ harness: Any | None = None,
95
108
  ) -> list[SubAgent]:
96
- """Build SubAgent specs for all agents based on mode.
109
+ """根据模式构建所有 agent SubAgent 规格。
97
110
 
98
111
  Args:
99
- config: sycli configuration.
100
- llm: LLM instance shared by all agents.
101
- backend: LocalShellBackend shared by all agents.
102
- project_name: Project name for memory paths.
103
- mode: "optimize" or "create".
104
- project_root: Absolute project root path to inject into prompts.
112
+ config: sycli 配置。
113
+ llm: 所有 agent 共享的 LLM 实例。
114
+ backend: 所有 agent 共享的 LocalShellBackend。
115
+ project_name: 用于记忆路径的项目名称。
116
+ mode: "optimize" "create"
117
+ project_root: 要注入提示词的绝对项目根目录路径。
118
+ harness: 可选的 HarnessPromptManager,用于基于文件的提示词。
105
119
 
106
120
  Returns:
107
- List of SubAgent specs to pass to the orchestrator.
121
+ 要传递给编排器的 SubAgent 规格列表。
108
122
  """
109
123
  agents: list[SubAgent] = []
110
124
  root = project_root or str(backend.cwd)
111
125
 
112
- # --- Core agents (always available) ---
126
+ # --- 核心 agent(始终可用) ---
113
127
 
114
128
  agents.append({
115
129
  "name": "researcher",
@@ -117,7 +131,7 @@ def build_subagents(
117
131
  "Explores the codebase to understand structure, find relevant files, "
118
132
  "analyze dependencies and patterns. Use FIRST before coding."
119
133
  ),
120
- "system_prompt": _inject_project_root(RESEARCHER_PROMPT, root),
134
+ "system_prompt": _get_prompt("RESEARCHER_PROMPT", harness, "researcher", root),
121
135
  "model": llm,
122
136
  "middleware": [_memory_middleware(backend, project_name, "researcher")],
123
137
  })
@@ -129,7 +143,7 @@ def build_subagents(
129
143
  "The ONLY agent with write/edit capabilities. "
130
144
  "Auto-fixes compilation errors before reporting."
131
145
  ),
132
- "system_prompt": _inject_project_root(CODER_PROMPT, root),
146
+ "system_prompt": _get_prompt("CODER_PROMPT", harness, "coder", root),
133
147
  "model": llm,
134
148
  "middleware": [_memory_middleware(backend, project_name, "coder")],
135
149
  "skills": _get_skills_for_agent("coder", config.skills),
@@ -142,13 +156,13 @@ def build_subagents(
142
156
  "Read + execute access, no write. "
143
157
  "Produces a structured evaluation report."
144
158
  ),
145
- "system_prompt": _inject_project_root(CRITIC_PROMPT, root),
159
+ "system_prompt": _get_prompt("CRITIC_PROMPT", harness, "critic", root),
146
160
  "model": llm,
147
161
  "middleware": [_memory_middleware(backend, project_name, "critic")],
148
162
  "skills": _get_skills_for_agent("critic", config.skills),
149
163
  })
150
164
 
151
- # --- Deep analysis agent (always available) ---
165
+ # --- 深度分析 agent(始终可用) ---
152
166
 
153
167
  agents.append({
154
168
  "name": "analyst",
@@ -157,13 +171,13 @@ def build_subagents(
157
171
  "analyzes data flow and root causes. Read-only. "
158
172
  "Use after researcher to provide deeper context for the coder."
159
173
  ),
160
- "system_prompt": _inject_project_root(ANALYST_PROMPT, root),
174
+ "system_prompt": _get_prompt("ANALYST_PROMPT", harness, "analyst", root),
161
175
  "model": llm,
162
176
  "middleware": [_memory_middleware(backend, project_name, "analyst")],
163
177
  "skills": _get_skills_for_agent("analyst", config.skills),
164
178
  })
165
179
 
166
- # --- Service manager agent (always available) ---
180
+ # --- 服务管理器 agent(始终可用) ---
167
181
 
168
182
  agents.append({
169
183
  "name": "service_manager",
@@ -172,7 +186,7 @@ def build_subagents(
172
186
  "fresh, health-checks. Read + execute, no write. "
173
187
  "Use after coder to restart the service before API evaluation."
174
188
  ),
175
- "system_prompt": _inject_project_root(SERVICE_MANAGER_PROMPT, root),
189
+ "system_prompt": _get_prompt("SERVICE_MANAGER_PROMPT", harness, "service_manager", root),
176
190
  "model": llm,
177
191
  "middleware": [_memory_middleware(backend, project_name, "service_manager")],
178
192
  })
@@ -184,7 +198,7 @@ def build_subagents(
184
198
  "Read + execute access, no write. "
185
199
  "Produces a runtime validation report."
186
200
  ),
187
- "system_prompt": _inject_project_root(RUNTIME_OBSERVER_PROMPT, root),
201
+ "system_prompt": _get_prompt("RUNTIME_OBSERVER_PROMPT", harness, "runtime_observer", root),
188
202
  "model": llm,
189
203
  "middleware": [_memory_middleware(backend, project_name, "runtime_observer")],
190
204
  })
@@ -196,12 +210,12 @@ def build_subagents(
196
210
  "Read-only. Only called when a round scores below threshold. "
197
211
  "Produces actionable optimization suggestions."
198
212
  ),
199
- "system_prompt": PROMPT_ENGINEER_PROMPT,
213
+ "system_prompt": _get_prompt("PROMPT_ENGINEER_PROMPT", harness, "prompt_engineer"),
200
214
  "model": llm,
201
215
  "middleware": [_memory_middleware(backend, project_name, "prompt_engineer")],
202
216
  })
203
217
 
204
- # --- CREATE mode only ---
218
+ # --- CREATE 模式 ---
205
219
 
206
220
  if mode == "create":
207
221
  agents.append({
@@ -211,7 +225,7 @@ def build_subagents(
211
225
  "CREATE mode only. Read-only. "
212
226
  "Produces a complete architecture blueprint."
213
227
  ),
214
- "system_prompt": _inject_project_root(ARCHITECT_PROMPT, root),
228
+ "system_prompt": _get_prompt("ARCHITECT_PROMPT", harness, "architect", root),
215
229
  "model": llm,
216
230
  "middleware": [_memory_middleware(backend, project_name, "architect")],
217
231
  })
@@ -223,7 +237,7 @@ def build_subagents(
223
237
  "CREATE mode only. Read + execute. "
224
238
  "Produces a data analysis report with seed data."
225
239
  ),
226
- "system_prompt": _inject_project_root(DATA_ANALYST_PROMPT, root),
240
+ "system_prompt": _get_prompt("DATA_ANALYST_PROMPT", harness, "data_analyst", root),
227
241
  "model": llm,
228
242
  "middleware": [_memory_middleware(backend, project_name, "data_analyst")],
229
243
  })
@@ -1,4 +1,4 @@
1
- """Core __init__.py - re-exports for backward compatibility."""
1
+ """核心模块 __init__.py - 为向后兼容性重新导出。"""
2
2
 
3
3
  from sycli.core.backend import create_backend
4
4
  from sycli.core.display import Colors, error, header, info, success, warning
@@ -1,4 +1,4 @@
1
- """LocalShellBackend factory for sycli agents."""
1
+ """sycli agent LocalShellBackend 工厂。"""
2
2
 
3
3
  from __future__ import annotations
4
4
 
@@ -14,18 +14,18 @@ def create_backend(
14
14
  max_output_bytes: int = 100_000,
15
15
  inherit_env: bool = True,
16
16
  ) -> LocalShellBackend:
17
- """Create a LocalShellBackend for sycli agents.
17
+ """ sycli agent 创建 LocalShellBackend。
18
18
 
19
- All agents share a single backend instance operating on the project root.
19
+ 所有 agent 共享一个在项目根目录上运行的后端实例。
20
20
 
21
21
  Args:
22
- project_root: The project directory.
23
- timeout: Default shell command timeout in seconds.
24
- max_output_bytes: Max captured output before truncation.
25
- inherit_env: Whether to inherit system environment variables.
22
+ project_root: 项目目录。
23
+ timeout: 默认 shell 命令超时(秒)。
24
+ max_output_bytes: 截断前的最大捕获输出字节数。
25
+ inherit_env: 是否继承系统环境变量。
26
26
 
27
27
  Returns:
28
- A configured LocalShellBackend.
28
+ 已配置的 LocalShellBackend
29
29
  """
30
30
  return LocalShellBackend(
31
31
  root_dir=str(project_root),
@@ -0,0 +1,4 @@
1
+ """sycli.json 配置加载器。"""
2
+
3
+ # 注意:load_config() 已被移除——调用方现在直接使用
4
+ # SycliConfig.load(config_path)(参见 run_cmd.py、create_cmd.py 等)。
@@ -1,4 +1,4 @@
1
- """Terminal display utilities with color support."""
1
+ """带颜色支持的终端显示工具。"""
2
2
 
3
3
  import sys
4
4
  import threading
@@ -38,8 +38,8 @@ def header(msg: str) -> None:
38
38
 
39
39
 
40
40
  def round_header(round_num: int, max_rounds: int, score: float | None = None) -> None:
41
- score_str = f" | score: {score:.3f}" if score is not None else ""
42
- print(f"\n{Colors.BOLD}{'─' * 10} Round {round_num}/{max_rounds}{score_str} {'─' * 10}{Colors.RESET}")
41
+ score_str = f" | 得分: {score:.3f}" if score is not None else ""
42
+ print(f"\n{Colors.BOLD}{'─' * 10} {round_num}/{max_rounds}{score_str} {'─' * 10}{Colors.RESET}")
43
43
 
44
44
 
45
45
  def agent_result(agent_name: str, reward: float, summary: str) -> None:
@@ -57,27 +57,27 @@ def final_report(
57
57
  strategy: str,
58
58
  ) -> None:
59
59
  print(f"\n{Colors.BOLD}{Colors.GREEN}{'═' * 50}{Colors.RESET}")
60
- print(f"{Colors.BOLD}{Colors.GREEN} Optimization Complete{Colors.RESET}")
60
+ print(f"{Colors.BOLD}{Colors.GREEN} 优化完成{Colors.RESET}")
61
61
  print(f"{Colors.BOLD}{Colors.GREEN}{'═' * 50}{Colors.RESET}")
62
- print(f" Total rounds: {total_rounds}")
63
- print(f" Score change: {initial_score:.3f} → {final_score:.3f} ({final_score - initial_score:+.3f})")
64
- print(f" Best round: {best_round} (score: {best_score:.3f})")
65
- print(f" Best strategy: {strategy}")
62
+ print(f" 总轮次: {total_rounds}")
63
+ print(f" 得分变化: {initial_score:.3f} → {final_score:.3f} ({final_score - initial_score:+.3f})")
64
+ print(f" 最佳轮次: {best_round} (得分: {best_score:.3f})")
65
+ print(f" 最佳策略: {strategy}")
66
66
  print(f"{Colors.BOLD}{Colors.GREEN}{'═' * 50}{Colors.RESET}\n")
67
67
 
68
68
 
69
69
  def agent_thinking(agent_name: str) -> None:
70
- """Print a thinking indicator for an agent."""
71
- print(f"{Colors.DIM} ⋯ {agent_name} is thinking...{Colors.RESET}", end="", flush=True)
70
+ """打印 agent 的思考指示器。"""
71
+ print(f"{Colors.DIM} ⋯ {agent_name} 思考中...{Colors.RESET}", end="", flush=True)
72
72
 
73
73
 
74
74
  def agent_done(agent_name: str) -> None:
75
- """Clear the thinking indicator and print done."""
76
- print(f"\r{Colors.GREEN} ✔ {agent_name} done. {Colors.RESET}")
75
+ """清除思考指示器并打印完成。"""
76
+ print(f"\r{Colors.GREEN} ✔ {agent_name} 完成。 {Colors.RESET}")
77
77
 
78
78
 
79
79
  def user_prompt() -> str:
80
- """Display the interactive prompt and get user input."""
80
+ """显示交互式提示并获取用户输入。"""
81
81
  print(f"\n{Colors.MAGENTA}{Colors.BOLD}sycli > {Colors.RESET}", end="", flush=True)
82
82
  try:
83
83
  return input().strip()
@@ -86,11 +86,11 @@ def user_prompt() -> str:
86
86
 
87
87
 
88
88
  def chat_banner() -> None:
89
- """Print the chat mode banner."""
90
- print(f"\n{Colors.BOLD}{Colors.CYAN}── Interactive Mode ──{Colors.RESET}")
91
- print(f" Commands: {Colors.BOLD}continue{Colors.RESET} | {Colors.BOLD}stop{Colors.RESET} | {Colors.BOLD}hint <text>{Colors.RESET} | {Colors.BOLD}skip{Colors.RESET} | {Colors.BOLD}status{Colors.RESET}")
92
- print(f" Press Enter to continue to next round\n")
89
+ """打印聊天模式横幅。"""
90
+ print(f"\n{Colors.BOLD}{Colors.CYAN}── 交互模式 ──{Colors.RESET}")
91
+ print(f" 命令: {Colors.BOLD}continue{Colors.RESET} | {Colors.BOLD}stop{Colors.RESET} | {Colors.BOLD}hint <文本>{Colors.RESET} | {Colors.BOLD}skip{Colors.RESET} | {Colors.BOLD}status{Colors.RESET}")
92
+ print(f" Enter 继续下一轮\n")
93
93
 
94
94
 
95
- # Lock for thread-safe printing
95
+ # 线程安全打印锁
96
96
  _print_lock = threading.Lock()
@@ -1,4 +1,4 @@
1
- """Git integration for sycli checkpoints and rollback."""
1
+ """sycli Git 检查点与回滚集成。"""
2
2
 
3
3
  from __future__ import annotations
4
4
 
@@ -9,17 +9,17 @@ from sycli.core.display import error, info, success, warning
9
9
 
10
10
 
11
11
  def git_checkpoint(project_root: Path, message: str) -> bool:
12
- """Stage all changes and create a git commit as checkpoint.
12
+ """暂存所有更改并创建 git 提交作为检查点。
13
13
 
14
14
  Args:
15
- project_root: Project root directory.
16
- message: Commit message.
15
+ project_root: 项目根目录。
16
+ message: 提交消息。
17
17
 
18
18
  Returns:
19
- True if checkpoint was created, False otherwise.
19
+ 如果成功创建检查点返回 True,否则返回 False
20
20
  """
21
21
  try:
22
- # Check if inside a git repo
22
+ # 检查是否在 git 仓库内
23
23
  result = subprocess.run(
24
24
  ["git", "rev-parse", "--is-inside-work-tree"],
25
25
  cwd=str(project_root),
@@ -30,7 +30,7 @@ def git_checkpoint(project_root: Path, message: str) -> bool:
30
30
  if result.returncode != 0:
31
31
  return False
32
32
 
33
- # Stage all changes (respect .gitignore)
33
+ # 暂存所有更改(遵循 .gitignore
34
34
  subprocess.run(
35
35
  ["git", "add", "-A"],
36
36
  cwd=str(project_root),
@@ -38,7 +38,7 @@ def git_checkpoint(project_root: Path, message: str) -> bool:
38
38
  timeout=10,
39
39
  )
40
40
 
41
- # Check if there are changes to commit
41
+ # 检查是否有可提交的更改
42
42
  result = subprocess.run(
43
43
  ["git", "diff", "--cached", "--quiet"],
44
44
  cwd=str(project_root),
@@ -46,10 +46,10 @@ def git_checkpoint(project_root: Path, message: str) -> bool:
46
46
  timeout=10,
47
47
  )
48
48
  if result.returncode == 0:
49
- # No changes to commit
49
+ # 没有可提交的更改
50
50
  return False
51
51
 
52
- # Commit
52
+ # 提交
53
53
  result = subprocess.run(
54
54
  ["git", "commit", "-m", message],
55
55
  cwd=str(project_root),
@@ -64,20 +64,20 @@ def git_checkpoint(project_root: Path, message: str) -> bool:
64
64
 
65
65
 
66
66
  def git_rollback(project_root: Path, round_num: int) -> bool:
67
- """Rollback to a previous round's checkpoint.
67
+ """回滚到之前轮次的检查点。
68
68
 
69
- Uses `git revert` to undo all commits AFTER the target round,
70
- creating a new commit on top. This preserves history.
69
+ 使用 `git revert` 撤销目标轮次之后的所有提交,
70
+ 在当前基础上创建新的提交。此操作会保留历史记录。
71
71
 
72
72
  Args:
73
- project_root: Project root directory.
74
- round_num: Target round number to rollback to.
73
+ project_root: 项目根目录。
74
+ round_num: 要回滚到的目标轮次编号。
75
75
 
76
76
  Returns:
77
- True if rollback succeeded, False otherwise.
77
+ 如果回滚成功返回 True,否则返回 False
78
78
  """
79
79
  try:
80
- # Find all round commits in order
80
+ # 按顺序查找所有轮次提交
81
81
  result = subprocess.run(
82
82
  ["git", "log", "--oneline", "--all"],
83
83
  cwd=str(project_root),
@@ -87,7 +87,7 @@ def git_rollback(project_root: Path, round_num: int) -> bool:
87
87
  )
88
88
  lines = result.stdout.strip().split("\n")
89
89
 
90
- # Build a mapping of round -> commit hash
90
+ # 建立轮次 -> 提交哈希的映射
91
91
  round_commits: dict[int, str] = {}
92
92
  for line in lines:
93
93
  import re
@@ -97,22 +97,22 @@ def git_rollback(project_root: Path, round_num: int) -> bool:
97
97
 
98
98
  target_commit = round_commits.get(round_num)
99
99
  if not target_commit:
100
- error(f"No git checkpoint found for round {round_num}")
100
+ error(f"未找到第 {round_num} 轮的 git 检查点")
101
101
  return False
102
102
 
103
- info(f"Found checkpoint: {target_commit} for round {round_num}")
103
+ info(f"找到检查点: {target_commit}(第 {round_num} 轮)")
104
104
 
105
- # Find commits to revert: all round commits after the target
105
+ # 查找需要回退的提交:目标轮次之后的所有轮次提交
106
106
  commits_to_revert = []
107
107
  for rn in sorted(round_commits.keys()):
108
108
  if rn > round_num:
109
109
  commits_to_revert.append(round_commits[rn])
110
110
 
111
111
  if not commits_to_revert:
112
- info(f"Round {round_num} is already the latest checkpoint, nothing to revert.")
112
+ info(f" {round_num} 轮已是最新检查点,无需回退。")
113
113
  return True
114
114
 
115
- # Revert commits in reverse order (newest first) to avoid conflicts
115
+ # 按逆序回退提交(最新的先)以避免冲突
116
116
  for commit_hash in reversed(commits_to_revert):
117
117
  result = subprocess.run(
118
118
  ["git", "revert", "--no-commit", commit_hash],
@@ -122,17 +122,17 @@ def git_rollback(project_root: Path, round_num: int) -> bool:
122
122
  timeout=15,
123
123
  )
124
124
  if result.returncode != 0:
125
- # Abort the revert on conflict
125
+ # 冲突时中止回退
126
126
  subprocess.run(
127
127
  ["git", "revert", "--abort"],
128
128
  cwd=str(project_root),
129
129
  capture_output=True,
130
130
  timeout=5,
131
131
  )
132
- error(f"Revert of {commit_hash} failed (conflict): {result.stderr}")
132
+ error(f"回退 {commit_hash} 失败(冲突): {result.stderr}")
133
133
  return False
134
134
 
135
- # Commit the accumulated reverts
135
+ # 提交累积的回退
136
136
  result = subprocess.run(
137
137
  ["git", "commit", "-m", f"sycli: rollback to round {round_num}"],
138
138
  cwd=str(project_root),
@@ -142,19 +142,19 @@ def git_rollback(project_root: Path, round_num: int) -> bool:
142
142
  )
143
143
 
144
144
  if result.returncode == 0:
145
- success(f"Rolled back to round {round_num} (reverted {len(commits_to_revert)} commits)")
145
+ success(f"已回退到第 {round_num} 轮(回退了 {len(commits_to_revert)} 个提交)")
146
146
  return True
147
147
  else:
148
- error(f"Rollback commit failed: {result.stderr}")
148
+ error(f"回退提交失败: {result.stderr}")
149
149
  return False
150
150
 
151
151
  except (subprocess.TimeoutExpired, FileNotFoundError) as e:
152
- error(f"Git rollback failed: {e}")
152
+ error(f"Git 回退失败: {e}")
153
153
  return False
154
154
 
155
155
 
156
156
  def git_is_repo(project_root: Path) -> bool:
157
- """Check if the directory is inside a git repository."""
157
+ """检查目录是否在 git 仓库内。"""
158
158
  try:
159
159
  result = subprocess.run(
160
160
  ["git", "rev-parse", "--is-inside-work-tree"],
@@ -169,7 +169,7 @@ def git_is_repo(project_root: Path) -> bool:
169
169
 
170
170
 
171
171
  def git_current_branch(project_root: Path) -> str | None:
172
- """Get the current git branch name."""
172
+ """获取当前 git 分支名称。"""
173
173
  try:
174
174
  result = subprocess.run(
175
175
  ["git", "rev-parse", "--abbrev-ref", "HEAD"],
@@ -184,7 +184,7 @@ def git_current_branch(project_root: Path) -> str | None:
184
184
 
185
185
 
186
186
  def git_has_changes(project_root: Path) -> bool:
187
- """Check if there are uncommitted changes."""
187
+ """检查是否有未提交的更改。"""
188
188
  try:
189
189
  result = subprocess.run(
190
190
  ["git", "status", "--porcelain"],
@@ -1,6 +1,6 @@
1
- """Independent LLM initialization for sycli.
1
+ """sycli 的独立 LLM 初始化。
2
2
 
3
- Uses langchain's init_chat_model directly, bypassing sycommon.config.Config.
3
+ 直接使用 langchain init_chat_model,绕过 sycommon.config.Config
4
4
  """
5
5
 
6
6
  from __future__ import annotations
@@ -18,24 +18,24 @@ def create_llm(
18
18
  temperature: float | None = None,
19
19
  thinking: bool | None = None,
20
20
  ) -> BaseChatModel:
21
- """Create LLM instance from sycli.json settings.
21
+ """ sycli.json 配置创建 LLM 实例。
22
22
 
23
23
  Args:
24
- settings: LLM configuration from sycli.json.
25
- streaming: Whether to enable streaming.
26
- temperature: Override temperature if provided.
27
- thinking: Enable thinking/reasoning mode.
24
+ settings: 来自 sycli.json 的 LLM 配置。
25
+ streaming: 是否启用流式输出。
26
+ temperature: 如果提供,覆盖默认温度。
27
+ thinking: 启用思考/推理模式。
28
28
 
29
29
  Returns:
30
- A BaseChatModel instance.
30
+ BaseChatModel 实例。
31
31
  """
32
32
  base_url = settings.resolved_base_url()
33
33
  api_key = settings.resolved_api_key()
34
34
 
35
35
  if not base_url:
36
36
  raise ValueError(
37
- f"LLM base_url is empty. Set {settings.base_url_env} env var "
38
- f"or set base_url in sycli.json"
37
+ f"LLM base_url 为空。请设置 {settings.base_url_env} 环境变量 "
38
+ f"或在 sycli.json 中设置 base_url"
39
39
  )
40
40
 
41
41
  effective_temp = temperature if temperature is not None else settings.temperature
@@ -1,6 +1,6 @@
1
- """Shared RL state persistence — single source of truth for save/load.
1
+ """共享 RL 状态持久化——保存/加载的单一数据源。
2
2
 
3
- Used by both engine.py (OPTIMIZE) and create.py (CREATE).
3
+ engine.pyOPTIMIZE)和 create.pyCREATE)共同使用。
4
4
  """
5
5
 
6
6
  from __future__ import annotations
@@ -11,17 +11,17 @@ from pathlib import Path
11
11
 
12
12
 
13
13
  def save_state(sycli_dir: Path, state: dict) -> None:
14
- """Save RL state to disk atomically."""
14
+ """原子性地将 RL 状态保存到磁盘。"""
15
15
  state_file = sycli_dir / "rl_state.json"
16
16
  state_file.parent.mkdir(parents=True, exist_ok=True)
17
- # Write to temp file first, then rename for atomicity
17
+ # 先写入临时文件,然后重命名以确保原子性
18
18
  fd, tmp_path = tempfile.mkstemp(
19
19
  dir=str(state_file.parent), suffix=".tmp", prefix="rl_state_"
20
20
  )
21
21
  try:
22
22
  with open(fd, "w") as f:
23
23
  json.dump(state, f, indent=2, ensure_ascii=False)
24
- # Atomic rename (POSIX)
24
+ # 原子重命名(POSIX
25
25
  Path(tmp_path).replace(state_file)
26
26
  except Exception:
27
27
  Path(tmp_path).unlink(missing_ok=True)
@@ -29,7 +29,7 @@ def save_state(sycli_dir: Path, state: dict) -> None:
29
29
 
30
30
 
31
31
  def load_state(sycli_dir: Path) -> dict:
32
- """Load RL state from disk."""
32
+ """从磁盘加载 RL 状态。"""
33
33
  state_file = sycli_dir / "rl_state.json"
34
34
  if state_file.exists():
35
35
  try:
@@ -0,0 +1 @@
1
+ """sycli 内存管理包。"""