echotools 2.3.4__tar.gz → 2.3.6__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 (152) hide show
  1. {echotools-2.3.4 → echotools-2.3.6}/PKG-INFO +124 -124
  2. {echotools-2.3.4 → echotools-2.3.6}/README.md +74 -74
  3. {echotools-2.3.4 → echotools-2.3.6}/pyproject.toml +138 -137
  4. {echotools-2.3.4 → echotools-2.3.6}/setup.cfg +4 -4
  5. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/__init__.py +212 -210
  6. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/_version.py +15 -15
  7. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/cache/__init__.py +8 -8
  8. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/cache/memory_cache.py +74 -74
  9. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/config/__init__.py +23 -23
  10. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/config/base.py +144 -144
  11. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/config/center.py +443 -443
  12. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/config/loader.py +138 -138
  13. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/dispatch/__init__.py +21 -21
  14. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/dispatch/candidate.py +51 -51
  15. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/dispatch/dispatcher.py +303 -303
  16. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/errors/__init__.py +49 -49
  17. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/errors/base.py +32 -32
  18. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/errors/classify.py +79 -79
  19. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/errors/common.py +74 -74
  20. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/events/__init__.py +8 -8
  21. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/events/bus.py +104 -104
  22. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/events/event.py +31 -31
  23. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/files/__init__.py +7 -7
  24. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/files/file_util.py +155 -155
  25. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/fncall/__init__.py +40 -40
  26. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/fncall/parsers/__init__.py +6 -6
  27. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/fncall/parsers/stream.py +156 -156
  28. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/fncall/parsers/xml_parser.py +322 -322
  29. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/fncall/prompt/__init__.py +5 -5
  30. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/fncall/prompt/history.py +458 -458
  31. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/fncall/prompt/inject.py +128 -128
  32. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/fncall/prompt/templates.py +159 -159
  33. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/fncall/protocols/__init__.py +14 -14
  34. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/fncall/protocols/entml.py +285 -285
  35. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/fncall/registry.py +111 -111
  36. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/fncall/shared/__init__.py +25 -25
  37. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/fncall/shared/coercion.py +295 -295
  38. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/fncall/shared/loop_detect.py +97 -97
  39. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/fncall/shared/normalization.py +170 -170
  40. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/fncall/shared/xml_helpers.py +56 -56
  41. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/ids/__init__.py +7 -7
  42. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/ids/generator.py +62 -62
  43. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/io/__init__.py +37 -37
  44. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/io/io_utils.py +81 -81
  45. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/lifecycle/__init__.py +8 -8
  46. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/logger/__init__.py +12 -12
  47. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/logger/manager.py +187 -187
  48. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/network/http_utils.py +68 -68
  49. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/plugin/__init__.py +9 -9
  50. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/plugin/base.py +41 -41
  51. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/plugin/discovery.py +179 -179
  52. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/process/__init__.py +10 -10
  53. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/process/port.py +193 -193
  54. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/protocol/base.py +129 -129
  55. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/proxy/__init__.py +7 -7
  56. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/retry/__init__.py +12 -12
  57. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/retry/retry.py +185 -185
  58. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/runtime/__init__.py +7 -7
  59. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/runtime/collector.py +60 -60
  60. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/scheduler/__init__.py +7 -7
  61. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/sdk/__init__.py +7 -7
  62. echotools-2.3.6/src/echotools/spinner/__init__.py +24 -0
  63. echotools-2.3.6/src/echotools/spinner/spinner.py +422 -0
  64. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/terminal/conpty.py +246 -246
  65. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/terminal/local.py +964 -964
  66. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/terminal/session.py +493 -493
  67. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/terminal/tmux.py +105 -105
  68. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/tracing/__init__.py +28 -28
  69. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/tracing/context.py +63 -63
  70. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/tracing/span.py +135 -135
  71. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/tracing/tracer.py +97 -97
  72. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/watcher/__init__.py +7 -7
  73. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/watcher/file_watcher.py +110 -110
  74. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/web/__init__.py +37 -37
  75. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/web/application.py +120 -120
  76. {echotools-2.3.4/src/echotools/web/input_box/send-button → echotools-2.3.6/src/echotools/web/input_box/send_button}/send-button.js +64 -64
  77. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/web/utils.py +187 -187
  78. {echotools-2.3.4 → echotools-2.3.6}/src/echotools.egg-info/PKG-INFO +124 -124
  79. {echotools-2.3.4 → echotools-2.3.6}/src/echotools.egg-info/SOURCES.txt +9 -7
  80. {echotools-2.3.4 → echotools-2.3.6}/tests/test_cache_retry.py +128 -128
  81. {echotools-2.3.4 → echotools-2.3.6}/tests/test_completion.py +48 -48
  82. {echotools-2.3.4 → echotools-2.3.6}/tests/test_config.py +85 -85
  83. {echotools-2.3.4 → echotools-2.3.6}/tests/test_config_extended.py +45 -45
  84. {echotools-2.3.4 → echotools-2.3.6}/tests/test_coverage_core.py +515 -515
  85. {echotools-2.3.4 → echotools-2.3.6}/tests/test_dispatch.py +35 -35
  86. {echotools-2.3.4 → echotools-2.3.6}/tests/test_dispatch_extended.py +44 -44
  87. {echotools-2.3.4 → echotools-2.3.6}/tests/test_dispatch_race.py +55 -55
  88. {echotools-2.3.4 → echotools-2.3.6}/tests/test_errors.py +45 -45
  89. {echotools-2.3.4 → echotools-2.3.6}/tests/test_errors_common.py +24 -24
  90. {echotools-2.3.4 → echotools-2.3.6}/tests/test_events.py +56 -56
  91. {echotools-2.3.4 → echotools-2.3.6}/tests/test_events_event.py +18 -18
  92. {echotools-2.3.4 → echotools-2.3.6}/tests/test_facade.py +33 -33
  93. {echotools-2.3.4 → echotools-2.3.6}/tests/test_fncall.py +68 -68
  94. {echotools-2.3.4 → echotools-2.3.6}/tests/test_ids.py +25 -25
  95. {echotools-2.3.4 → echotools-2.3.6}/tests/test_imports.py +33 -33
  96. {echotools-2.3.4 → echotools-2.3.6}/tests/test_io.py +20 -20
  97. {echotools-2.3.4 → echotools-2.3.6}/tests/test_keys.py +27 -27
  98. {echotools-2.3.4 → echotools-2.3.6}/tests/test_lifecycle.py +34 -34
  99. {echotools-2.3.4 → echotools-2.3.6}/tests/test_logger.py +37 -37
  100. {echotools-2.3.4 → echotools-2.3.6}/tests/test_merge.py +26 -26
  101. {echotools-2.3.4 → echotools-2.3.6}/tests/test_plugin.py +31 -31
  102. {echotools-2.3.4 → echotools-2.3.6}/tests/test_printstream.py +15 -16
  103. {echotools-2.3.4 → echotools-2.3.6}/tests/test_protocols.py +25 -22
  104. {echotools-2.3.4 → echotools-2.3.6}/tests/test_proxy.py +56 -56
  105. {echotools-2.3.4 → echotools-2.3.6}/tests/test_proxy_selector.py +27 -27
  106. {echotools-2.3.4 → echotools-2.3.6}/tests/test_runtime.py +25 -25
  107. {echotools-2.3.4 → echotools-2.3.6}/tests/test_scheduler.py +27 -27
  108. {echotools-2.3.4 → echotools-2.3.6}/tests/test_tracing.py +30 -30
  109. {echotools-2.3.4 → echotools-2.3.6}/tests/test_usage.py +37 -37
  110. {echotools-2.3.4 → echotools-2.3.6}/tests/test_web.py +48 -48
  111. {echotools-2.3.4 → echotools-2.3.6}/tests/test_web_broker.py +50 -50
  112. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/cache/list_cache.py +0 -0
  113. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/config/merge.py +0 -0
  114. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/dispatch/proxy_selector.py +0 -0
  115. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/dispatch/selector.py +0 -0
  116. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/dispatch/usage.py +0 -0
  117. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/errors/http.py +0 -0
  118. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/io/printstream.py +0 -0
  119. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/keys.py +0 -0
  120. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/lifecycle/manager.py +0 -0
  121. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/lifecycle/updater.py +0 -0
  122. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/network/__init__.py +0 -0
  123. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/plugin/registry.py +0 -0
  124. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/protocol/__init__.py +0 -0
  125. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/proxy/manager.py +0 -0
  126. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/py.typed +0 -0
  127. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/scheduler/scheduler.py +0 -0
  128. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/sdk/facade.py +0 -0
  129. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/terminal/__init__.py +0 -0
  130. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/terminal/sanitize.py +0 -0
  131. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/terminal/ssh.py +0 -0
  132. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/translate.py +0 -0
  133. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/web/broker.py +0 -0
  134. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/web/input_box/app.js +0 -0
  135. {echotools-2.3.4/src/echotools/web/input_box/file-zone → echotools-2.3.6/src/echotools/web/input_box/file_zone}/file-zone.js +0 -0
  136. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/web/input_box/fonts/inter-400.woff2 +0 -0
  137. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/web/input_box/fonts/inter-500.woff2 +0 -0
  138. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/web/input_box/fonts/inter-600.woff2 +0 -0
  139. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/web/input_box/fonts/tailwind.min.css +0 -0
  140. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/web/input_box/input-box.css +0 -0
  141. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/web/input_box/input-box.js +0 -0
  142. {echotools-2.3.4/src/echotools/web/input_box/motion-kit → echotools-2.3.6/src/echotools/web/input_box/motion_kit}/motion-kit.js +0 -0
  143. {echotools-2.3.4/src/echotools/web/input_box/sortable-list → echotools-2.3.6/src/echotools/web/input_box/sortable_list}/sortable-list.css +0 -0
  144. {echotools-2.3.4/src/echotools/web/input_box/sortable-list → echotools-2.3.6/src/echotools/web/input_box/sortable_list}/sortable-list.js +0 -0
  145. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/web/input_box/style.css +0 -0
  146. {echotools-2.3.4/src/echotools/web/input_box/text-input → echotools-2.3.6/src/echotools/web/input_box/text_input}/text-input.js +0 -0
  147. {echotools-2.3.4/src/echotools/web/input_box/voice-input → echotools-2.3.6/src/echotools/web/input_box/voice_input}/voice-input.js +0 -0
  148. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/web/middleware.py +0 -0
  149. {echotools-2.3.4 → echotools-2.3.6}/src/echotools/web/stats.py +0 -0
  150. {echotools-2.3.4 → echotools-2.3.6}/src/echotools.egg-info/dependency_links.txt +0 -0
  151. {echotools-2.3.4 → echotools-2.3.6}/src/echotools.egg-info/requires.txt +0 -0
  152. {echotools-2.3.4 → echotools-2.3.6}/src/echotools.egg-info/top_level.txt +0 -0
@@ -1,124 +1,124 @@
1
- Metadata-Version: 2.4
2
- Name: echotools
3
- Version: 2.3.4
4
- Summary: 通用基础设施 SDK:配置、日志、事件、调度、插件、协议、调用链
5
- Author: nichengfuben
6
- License-Expression: MIT
7
- Project-URL: Homepage, https://github.com/nichengfuben/echotools
8
- Project-URL: Repository, https://github.com/nichengfuben/echotools
9
- Project-URL: Issues, https://github.com/nichengfuben/echotools/issues
10
- Classifier: Development Status :: 4 - Beta
11
- Classifier: Intended Audience :: Developers
12
- Classifier: Programming Language :: Python :: 3
13
- Classifier: Programming Language :: Python :: 3.8
14
- Classifier: Programming Language :: Python :: 3.9
15
- Classifier: Programming Language :: Python :: 3.10
16
- Classifier: Programming Language :: Python :: 3.11
17
- Classifier: Programming Language :: Python :: 3.12
18
- Classifier: Programming Language :: Python :: 3.13
19
- Classifier: Topic :: Software Development :: Libraries
20
- Requires-Python: >=3.8
21
- Description-Content-Type: text/markdown
22
- Requires-Dist: typing-extensions>=4.7.0
23
- Provides-Extra: toml
24
- Requires-Dist: tomlkit>=0.11.0; extra == "toml"
25
- Requires-Dist: tomli>=2.0.0; python_version < "3.11" and extra == "toml"
26
- Provides-Extra: watch
27
- Requires-Dist: watchdog>=3.0.0; extra == "watch"
28
- Provides-Extra: http
29
- Requires-Dist: aiohttp>=3.8.0; extra == "http"
30
- Provides-Extra: socks
31
- Requires-Dist: aiohttp-socks>=0.8.0; extra == "socks"
32
- Provides-Extra: ssh
33
- Requires-Dist: paramiko>=3.0.0; extra == "ssh"
34
- Provides-Extra: terminal
35
- Requires-Dist: pywinpty>=2.0.0; sys_platform == "win32" and extra == "terminal"
36
- Provides-Extra: all
37
- Requires-Dist: tomlkit>=0.11.0; extra == "all"
38
- Requires-Dist: tomli>=2.0.0; python_version < "3.11" and extra == "all"
39
- Requires-Dist: watchdog>=3.0.0; extra == "all"
40
- Requires-Dist: aiohttp>=3.8.0; extra == "all"
41
- Requires-Dist: aiohttp-socks>=0.8.0; extra == "all"
42
- Requires-Dist: paramiko>=3.0.0; extra == "all"
43
- Requires-Dist: pywinpty>=2.0.0; sys_platform == "win32" and extra == "all"
44
- Provides-Extra: dev
45
- Requires-Dist: pytest>=7.4.0; extra == "dev"
46
- Requires-Dist: pytest-asyncio>=0.23.0; extra == "dev"
47
- Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
48
- Requires-Dist: mypy>=1.5.0; extra == "dev"
49
- Requires-Dist: ruff>=0.4.0; extra == "dev"
50
-
51
- # echotools
52
-
53
- 通用基础设施 SDK:配置中心、日志、事件总线、调用链、任务调度、
54
- 插件框架、协议系统、自适应选择器,完全项目无关,兼容 Python 3.8–3.14。
55
-
56
- ## 安装
57
-
58
- ```bash
59
- # 核心(仅 typing-extensions)
60
- pip install echotools
61
-
62
- # 完整功能
63
- pip install echotools[all]
64
- ```
65
-
66
- ### 可选依赖
67
-
68
- | Extra | 用途 |
69
- |-------|------|
70
- | `toml` | TOML 配置读写 |
71
- | `watch` | watchdog 文件监视 |
72
- | `http` | aiohttp Web 层 |
73
- | `socks` | SOCKS 代理 |
74
- | `ssh` | SSH 终端 |
75
- | `terminal` | Windows ConPTY |
76
- | `all` | 全部可选依赖 |
77
- | `dev` | pytest, ruff, mypy |
78
-
79
- ## 快速开始
80
-
81
- ```python
82
- from echotools import EchoTools
83
-
84
- et = EchoTools(service_name="myapp")
85
- et.logger.configure(level="INFO", color=True)
86
- cfg = et.config
87
- cfg.load("config.toml")
88
-
89
- with et.tracer.trace("request") as trace:
90
- with et.tracer.span(trace, "db") as span:
91
- span.set_tag("query", "select 1")
92
-
93
- await et.shutdown()
94
- ```
95
-
96
- ## 能力总览
97
-
98
- | 模块 | 说明 |
99
- |------|------|
100
- | `ConfigCenter` | 点路径配置 + 热重载 + 类型绑定 |
101
- | `LoggerManager` | 调用链注入 + 颜色 + 轮转 |
102
- | `EventBus` | 同步/异步事件 |
103
- | `Tracer` | 轻量调用链 |
104
- | `TaskDispatcher` | 单发/竞速 + 贝叶斯自适应选择 |
105
- | `PluginRegistry` | 自动发现 + 热重载 |
106
- | `get_protocol` | XML/antml/original/bracket/nous 等 LLM 工具协议 |
107
- | `ProxyManager` | HTTP/HTTPS/SOCKS |
108
- | `AutoUpdater` | git 自动更新 |
109
- | `FileWatcher` | 轮询文件监视 |
110
-
111
- ## 开发
112
-
113
- ```bash
114
- pip install -e ".[dev,all]"
115
- make lint
116
- make test
117
- make cov
118
- ```
119
-
120
- 模块指南见 [docs/modules.md](docs/modules.md),API 参考见 [docs/api.md](docs/api.md)。
121
-
122
- ## 许可证
123
-
124
- MIT
1
+ Metadata-Version: 2.4
2
+ Name: echotools
3
+ Version: 2.3.6
4
+ Summary: 通用基础设施 SDK:配置、日志、事件、调度、插件、协议、调用链
5
+ Author: nichengfuben
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/nichengfuben/echotools
8
+ Project-URL: Repository, https://github.com/nichengfuben/echotools
9
+ Project-URL: Issues, https://github.com/nichengfuben/echotools/issues
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.8
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Topic :: Software Development :: Libraries
20
+ Requires-Python: >=3.8
21
+ Description-Content-Type: text/markdown
22
+ Requires-Dist: typing-extensions>=4.7.0
23
+ Provides-Extra: toml
24
+ Requires-Dist: tomlkit>=0.11.0; extra == "toml"
25
+ Requires-Dist: tomli>=2.0.0; python_version < "3.11" and extra == "toml"
26
+ Provides-Extra: watch
27
+ Requires-Dist: watchdog>=3.0.0; extra == "watch"
28
+ Provides-Extra: http
29
+ Requires-Dist: aiohttp>=3.8.0; extra == "http"
30
+ Provides-Extra: socks
31
+ Requires-Dist: aiohttp-socks>=0.8.0; extra == "socks"
32
+ Provides-Extra: ssh
33
+ Requires-Dist: paramiko>=3.0.0; extra == "ssh"
34
+ Provides-Extra: terminal
35
+ Requires-Dist: pywinpty>=2.0.0; sys_platform == "win32" and extra == "terminal"
36
+ Provides-Extra: all
37
+ Requires-Dist: tomlkit>=0.11.0; extra == "all"
38
+ Requires-Dist: tomli>=2.0.0; python_version < "3.11" and extra == "all"
39
+ Requires-Dist: watchdog>=3.0.0; extra == "all"
40
+ Requires-Dist: aiohttp>=3.8.0; extra == "all"
41
+ Requires-Dist: aiohttp-socks>=0.8.0; extra == "all"
42
+ Requires-Dist: paramiko>=3.0.0; extra == "all"
43
+ Requires-Dist: pywinpty>=2.0.0; sys_platform == "win32" and extra == "all"
44
+ Provides-Extra: dev
45
+ Requires-Dist: pytest>=7.4.0; extra == "dev"
46
+ Requires-Dist: pytest-asyncio>=0.23.0; extra == "dev"
47
+ Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
48
+ Requires-Dist: mypy>=1.5.0; extra == "dev"
49
+ Requires-Dist: ruff>=0.4.0; extra == "dev"
50
+
51
+ # echotools
52
+
53
+ 通用基础设施 SDK:配置中心、日志、事件总线、调用链、任务调度、
54
+ 插件框架、协议系统、自适应选择器,完全项目无关,兼容 Python 3.8–3.14。
55
+
56
+ ## 安装
57
+
58
+ ```bash
59
+ # 核心(仅 typing-extensions)
60
+ pip install echotools
61
+
62
+ # 完整功能
63
+ pip install echotools[all]
64
+ ```
65
+
66
+ ### 可选依赖
67
+
68
+ | Extra | 用途 |
69
+ |-------|------|
70
+ | `toml` | TOML 配置读写 |
71
+ | `watch` | watchdog 文件监视 |
72
+ | `http` | aiohttp Web 层 |
73
+ | `socks` | SOCKS 代理 |
74
+ | `ssh` | SSH 终端 |
75
+ | `terminal` | Windows ConPTY |
76
+ | `all` | 全部可选依赖 |
77
+ | `dev` | pytest, ruff, mypy |
78
+
79
+ ## 快速开始
80
+
81
+ ```python
82
+ from echotools import EchoTools
83
+
84
+ et = EchoTools(service_name="myapp")
85
+ et.logger.configure(level="INFO", color=True)
86
+ cfg = et.config
87
+ cfg.load("config.toml")
88
+
89
+ with et.tracer.trace("request") as trace:
90
+ with et.tracer.span(trace, "db") as span:
91
+ span.set_tag("query", "select 1")
92
+
93
+ await et.shutdown()
94
+ ```
95
+
96
+ ## 能力总览
97
+
98
+ | 模块 | 说明 |
99
+ |------|------|
100
+ | `ConfigCenter` | 点路径配置 + 热重载 + 类型绑定 |
101
+ | `LoggerManager` | 调用链注入 + 颜色 + 轮转 |
102
+ | `EventBus` | 同步/异步事件 |
103
+ | `Tracer` | 轻量调用链 |
104
+ | `TaskDispatcher` | 单发/竞速 + 贝叶斯自适应选择 |
105
+ | `PluginRegistry` | 自动发现 + 热重载 |
106
+ | `get_protocol` | XML/antml/original/bracket/nous 等 LLM 工具协议 |
107
+ | `ProxyManager` | HTTP/HTTPS/SOCKS |
108
+ | `AutoUpdater` | git 自动更新 |
109
+ | `FileWatcher` | 轮询文件监视 |
110
+
111
+ ## 开发
112
+
113
+ ```bash
114
+ pip install -e ".[dev,all]"
115
+ make lint
116
+ make test
117
+ make cov
118
+ ```
119
+
120
+ 模块指南见 [docs/modules.md](docs/modules.md),API 参考见 [docs/api.md](docs/api.md)。
121
+
122
+ ## 许可证
123
+
124
+ MIT
@@ -1,74 +1,74 @@
1
- # echotools
2
-
3
- 通用基础设施 SDK:配置中心、日志、事件总线、调用链、任务调度、
4
- 插件框架、协议系统、自适应选择器,完全项目无关,兼容 Python 3.8–3.14。
5
-
6
- ## 安装
7
-
8
- ```bash
9
- # 核心(仅 typing-extensions)
10
- pip install echotools
11
-
12
- # 完整功能
13
- pip install echotools[all]
14
- ```
15
-
16
- ### 可选依赖
17
-
18
- | Extra | 用途 |
19
- |-------|------|
20
- | `toml` | TOML 配置读写 |
21
- | `watch` | watchdog 文件监视 |
22
- | `http` | aiohttp Web 层 |
23
- | `socks` | SOCKS 代理 |
24
- | `ssh` | SSH 终端 |
25
- | `terminal` | Windows ConPTY |
26
- | `all` | 全部可选依赖 |
27
- | `dev` | pytest, ruff, mypy |
28
-
29
- ## 快速开始
30
-
31
- ```python
32
- from echotools import EchoTools
33
-
34
- et = EchoTools(service_name="myapp")
35
- et.logger.configure(level="INFO", color=True)
36
- cfg = et.config
37
- cfg.load("config.toml")
38
-
39
- with et.tracer.trace("request") as trace:
40
- with et.tracer.span(trace, "db") as span:
41
- span.set_tag("query", "select 1")
42
-
43
- await et.shutdown()
44
- ```
45
-
46
- ## 能力总览
47
-
48
- | 模块 | 说明 |
49
- |------|------|
50
- | `ConfigCenter` | 点路径配置 + 热重载 + 类型绑定 |
51
- | `LoggerManager` | 调用链注入 + 颜色 + 轮转 |
52
- | `EventBus` | 同步/异步事件 |
53
- | `Tracer` | 轻量调用链 |
54
- | `TaskDispatcher` | 单发/竞速 + 贝叶斯自适应选择 |
55
- | `PluginRegistry` | 自动发现 + 热重载 |
56
- | `get_protocol` | XML/antml/original/bracket/nous 等 LLM 工具协议 |
57
- | `ProxyManager` | HTTP/HTTPS/SOCKS |
58
- | `AutoUpdater` | git 自动更新 |
59
- | `FileWatcher` | 轮询文件监视 |
60
-
61
- ## 开发
62
-
63
- ```bash
64
- pip install -e ".[dev,all]"
65
- make lint
66
- make test
67
- make cov
68
- ```
69
-
70
- 模块指南见 [docs/modules.md](docs/modules.md),API 参考见 [docs/api.md](docs/api.md)。
71
-
72
- ## 许可证
73
-
74
- MIT
1
+ # echotools
2
+
3
+ 通用基础设施 SDK:配置中心、日志、事件总线、调用链、任务调度、
4
+ 插件框架、协议系统、自适应选择器,完全项目无关,兼容 Python 3.8–3.14。
5
+
6
+ ## 安装
7
+
8
+ ```bash
9
+ # 核心(仅 typing-extensions)
10
+ pip install echotools
11
+
12
+ # 完整功能
13
+ pip install echotools[all]
14
+ ```
15
+
16
+ ### 可选依赖
17
+
18
+ | Extra | 用途 |
19
+ |-------|------|
20
+ | `toml` | TOML 配置读写 |
21
+ | `watch` | watchdog 文件监视 |
22
+ | `http` | aiohttp Web 层 |
23
+ | `socks` | SOCKS 代理 |
24
+ | `ssh` | SSH 终端 |
25
+ | `terminal` | Windows ConPTY |
26
+ | `all` | 全部可选依赖 |
27
+ | `dev` | pytest, ruff, mypy |
28
+
29
+ ## 快速开始
30
+
31
+ ```python
32
+ from echotools import EchoTools
33
+
34
+ et = EchoTools(service_name="myapp")
35
+ et.logger.configure(level="INFO", color=True)
36
+ cfg = et.config
37
+ cfg.load("config.toml")
38
+
39
+ with et.tracer.trace("request") as trace:
40
+ with et.tracer.span(trace, "db") as span:
41
+ span.set_tag("query", "select 1")
42
+
43
+ await et.shutdown()
44
+ ```
45
+
46
+ ## 能力总览
47
+
48
+ | 模块 | 说明 |
49
+ |------|------|
50
+ | `ConfigCenter` | 点路径配置 + 热重载 + 类型绑定 |
51
+ | `LoggerManager` | 调用链注入 + 颜色 + 轮转 |
52
+ | `EventBus` | 同步/异步事件 |
53
+ | `Tracer` | 轻量调用链 |
54
+ | `TaskDispatcher` | 单发/竞速 + 贝叶斯自适应选择 |
55
+ | `PluginRegistry` | 自动发现 + 热重载 |
56
+ | `get_protocol` | XML/antml/original/bracket/nous 等 LLM 工具协议 |
57
+ | `ProxyManager` | HTTP/HTTPS/SOCKS |
58
+ | `AutoUpdater` | git 自动更新 |
59
+ | `FileWatcher` | 轮询文件监视 |
60
+
61
+ ## 开发
62
+
63
+ ```bash
64
+ pip install -e ".[dev,all]"
65
+ make lint
66
+ make test
67
+ make cov
68
+ ```
69
+
70
+ 模块指南见 [docs/modules.md](docs/modules.md),API 参考见 [docs/api.md](docs/api.md)。
71
+
72
+ ## 许可证
73
+
74
+ MIT
@@ -1,138 +1,139 @@
1
- [build-system]
2
- requires = ["setuptools>=68.0", "wheel"]
3
- build-backend = "setuptools.build_meta"
4
-
5
- [project]
6
- name = "echotools"
7
- version = "2.3.4"
8
- description = "通用基础设施 SDK:配置、日志、事件、调度、插件、协议、调用链"
9
- readme = "README.md"
10
- requires-python = ">=3.8"
11
- license = "MIT"
12
- authors = [{ name = "nichengfuben" }]
13
- classifiers = [
14
- "Development Status :: 4 - Beta",
15
- "Intended Audience :: Developers",
16
- "Programming Language :: Python :: 3",
17
- "Programming Language :: Python :: 3.8",
18
- "Programming Language :: Python :: 3.9",
19
- "Programming Language :: Python :: 3.10",
20
- "Programming Language :: Python :: 3.11",
21
- "Programming Language :: Python :: 3.12",
22
- "Programming Language :: Python :: 3.13",
23
- "Topic :: Software Development :: Libraries",
24
- ]
25
- dependencies = [
26
- "typing-extensions>=4.7.0",
27
- ]
28
-
29
- [project.optional-dependencies]
30
- toml = ["tomlkit>=0.11.0", "tomli>=2.0.0; python_version < '3.11'"]
31
- watch = ["watchdog>=3.0.0"]
32
- http = ["aiohttp>=3.8.0"]
33
- socks = ["aiohttp-socks>=0.8.0"]
34
- ssh = ["paramiko>=3.0.0"]
35
- terminal = ["pywinpty>=2.0.0; sys_platform == 'win32'"]
36
- all = [
37
- "tomlkit>=0.11.0",
38
- "tomli>=2.0.0; python_version < '3.11'",
39
- "watchdog>=3.0.0",
40
- "aiohttp>=3.8.0",
41
- "aiohttp-socks>=0.8.0",
42
- "paramiko>=3.0.0",
43
- "pywinpty>=2.0.0; sys_platform == 'win32'",
44
- ]
45
- dev = [
46
- "pytest>=7.4.0",
47
- "pytest-asyncio>=0.23.0",
48
- "pytest-cov>=4.1.0",
49
- "mypy>=1.5.0",
50
- "ruff>=0.4.0",
51
- ]
52
-
53
- [project.urls]
54
- Homepage = "https://github.com/nichengfuben/echotools"
55
- Repository = "https://github.com/nichengfuben/echotools"
56
- Issues = "https://github.com/nichengfuben/echotools/issues"
57
-
58
- [tool.setuptools.packages.find]
59
- where = ["src"]
60
-
61
- [tool.setuptools.package-data]
62
- echotools = ["py.typed", "web/input_box/**/*"]
63
-
64
- [tool.ruff]
65
- line-length = 88
66
- target-version = "py38"
67
-
68
- [tool.ruff.lint]
69
- select = ["E", "F", "I"]
70
- ignore = ["E501", "E402"]
71
-
72
- [tool.ruff.lint.isort]
73
- known-first-party = ["echotools"]
74
-
75
- [tool.mypy]
76
- python_version = "3.8"
77
- warn_return_any = true
78
- warn_unused_ignores = true
79
- disallow_untyped_defs = false
80
- check_untyped_defs = true
81
- ignore_missing_imports = true
82
- disable_error_code = [
83
- "no-any-return",
84
- "unused-ignore",
85
- "method-assign",
86
- "assignment",
87
- "index",
88
- "arg-type",
89
- "attr-defined",
90
- "var-annotated",
91
- ]
92
-
93
- [[tool.mypy.overrides]]
94
- module = "echotools.terminal.*"
95
- ignore_errors = true
96
-
97
- [tool.pytest.ini_options]
98
- testpaths = ["tests"]
99
- asyncio_mode = "auto"
100
- addopts = ["--strict-markers", "--tb=short"]
101
- markers = [
102
- "http: tests requiring aiohttp",
103
- "ssh: tests requiring paramiko",
104
- "terminal: tests requiring terminal extras",
105
- ]
106
-
107
- [tool.coverage.run]
108
- source = ["src/echotools"]
109
- branch = true
110
- omit = [
111
- "*/tests/*",
112
- "*/__init__.py",
113
- "*/terminal/*",
114
- "*/web/input_box/*",
115
- "*/lifecycle/updater.py",
116
- "*/watcher/*",
117
- "*/process/*",
118
- "*/network/*",
119
- "*/translate.py",
120
- "*/files/*",
121
- "*/fncall/*",
122
- "*/config/*",
123
- "*/proxy/*",
124
- "*/plugin/*",
125
- "*/protocol/*",
126
- "*/web/application.py",
127
- "*/web/middleware.py",
128
- "*/web/utils.py",
129
- ]
130
-
131
- [tool.coverage.report]
132
- fail_under = 90
133
- exclude_lines = [
134
- "pragma: no cover",
135
- "def __repr__",
136
- "if TYPE_CHECKING:",
137
- "raise NotImplementedError",
1
+ [build-system]
2
+ requires = ["setuptools>=68.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "echotools"
7
+ version = "2.3.6"
8
+ description = "通用基础设施 SDK:配置、日志、事件、调度、插件、协议、调用链"
9
+ readme = "README.md"
10
+ requires-python = ">=3.8"
11
+ license = { text = "MIT" }
12
+ authors = [{ name = "nichengfuben" }]
13
+ classifiers = [
14
+ "Development Status :: 4 - Beta",
15
+ "Intended Audience :: Developers",
16
+ "Programming Language :: Python :: 3",
17
+ "Programming Language :: Python :: 3.8",
18
+ "Programming Language :: Python :: 3.9",
19
+ "Programming Language :: Python :: 3.10",
20
+ "Programming Language :: Python :: 3.11",
21
+ "Programming Language :: Python :: 3.12",
22
+ "Programming Language :: Python :: 3.13",
23
+ "Topic :: Software Development :: Libraries",
24
+ ]
25
+ dependencies = [
26
+ "typing-extensions>=4.7.0",
27
+ ]
28
+
29
+ [project.optional-dependencies]
30
+ toml = ["tomlkit>=0.11.0", "tomli>=2.0.0; python_version < '3.11'"]
31
+ watch = ["watchdog>=3.0.0"]
32
+ http = ["aiohttp>=3.8.0"]
33
+ socks = ["aiohttp-socks>=0.8.0"]
34
+ ssh = ["paramiko>=3.0.0"]
35
+ terminal = ["pywinpty>=2.0.0; sys_platform == 'win32'"]
36
+ all = [
37
+ "tomlkit>=0.11.0",
38
+ "tomli>=2.0.0; python_version < '3.11'",
39
+ "watchdog>=3.0.0",
40
+ "aiohttp>=3.8.0",
41
+ "aiohttp-socks>=0.8.0",
42
+ "paramiko>=3.0.0",
43
+ "pywinpty>=2.0.0; sys_platform == 'win32'",
44
+ ]
45
+ dev = [
46
+ "pytest>=7.4.0",
47
+ "pytest-asyncio>=0.23.0",
48
+ "pytest-cov>=4.1.0",
49
+ "mypy>=1.5.0",
50
+ "ruff>=0.4.0",
51
+ ]
52
+
53
+ [project.urls]
54
+ Homepage = "https://github.com/nichengfuben/echotools"
55
+ Repository = "https://github.com/nichengfuben/echotools"
56
+ Issues = "https://github.com/nichengfuben/echotools/issues"
57
+
58
+ [tool.setuptools.packages.find]
59
+ where = ["src"]
60
+
61
+ [tool.setuptools.package-data]
62
+ echotools = ["py.typed", "web/input_box/**/*"]
63
+
64
+ [tool.ruff]
65
+ line-length = 88
66
+ target-version = "py38"
67
+
68
+ [tool.ruff.lint]
69
+ select = ["E", "F", "I"]
70
+ ignore = ["E501", "E402"]
71
+
72
+ [tool.ruff.lint.isort]
73
+ known-first-party = ["echotools"]
74
+
75
+ [tool.mypy]
76
+ python_version = "3.8"
77
+ warn_return_any = true
78
+ warn_unused_ignores = true
79
+ disallow_untyped_defs = false
80
+ check_untyped_defs = true
81
+ ignore_missing_imports = true
82
+ disable_error_code = [
83
+ "no-any-return",
84
+ "unused-ignore",
85
+ "method-assign",
86
+ "assignment",
87
+ "index",
88
+ "arg-type",
89
+ "attr-defined",
90
+ "var-annotated",
91
+ ]
92
+
93
+ [[tool.mypy.overrides]]
94
+ module = "echotools.terminal.*"
95
+ ignore_errors = true
96
+
97
+ [tool.pytest.ini_options]
98
+ testpaths = ["tests"]
99
+ asyncio_mode = "auto"
100
+ addopts = ["--strict-markers", "--tb=short"]
101
+ markers = [
102
+ "http: tests requiring aiohttp",
103
+ "ssh: tests requiring paramiko",
104
+ "terminal: tests requiring terminal extras",
105
+ ]
106
+
107
+ [tool.coverage.run]
108
+ source = ["src/echotools"]
109
+ branch = true
110
+ omit = [
111
+ "*/tests/*",
112
+ "*/__init__.py",
113
+ "*/terminal/*",
114
+ "*/spinner/*",
115
+ "*/web/input_box/*",
116
+ "*/lifecycle/updater.py",
117
+ "*/watcher/*",
118
+ "*/process/*",
119
+ "*/network/*",
120
+ "*/translate.py",
121
+ "*/files/*",
122
+ "*/fncall/*",
123
+ "*/config/*",
124
+ "*/proxy/*",
125
+ "*/plugin/*",
126
+ "*/protocol/*",
127
+ "*/web/application.py",
128
+ "*/web/middleware.py",
129
+ "*/web/utils.py",
130
+ ]
131
+
132
+ [tool.coverage.report]
133
+ fail_under = 90
134
+ exclude_lines = [
135
+ "pragma: no cover",
136
+ "def __repr__",
137
+ "if TYPE_CHECKING:",
138
+ "raise NotImplementedError",
138
139
  ]