echotools 2.3.104__tar.gz → 2.4.0__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 (268) hide show
  1. {echotools-2.3.104 → echotools-2.4.0}/PKG-INFO +195 -144
  2. echotools-2.4.0/README.md +139 -0
  3. {echotools-2.3.104 → echotools-2.4.0}/pyproject.toml +153 -154
  4. {echotools-2.3.104 → echotools-2.4.0}/setup.cfg +8 -8
  5. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/__init__.py +212 -215
  6. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/base/cache/__init__.py +8 -8
  7. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/base/cache/list_cache.py +155 -155
  8. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/base/cache/memory_cache.py +74 -74
  9. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/base/config/__init__.py +23 -23
  10. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/base/config/base.py +155 -155
  11. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/base/config/center.py +285 -285
  12. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/base/config/center_notify.py +39 -39
  13. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/base/config/center_template.py +142 -142
  14. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/base/config/loader.py +138 -138
  15. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/base/errors/__init__.py +49 -49
  16. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/base/errors/base.py +32 -32
  17. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/base/errors/classify.py +79 -79
  18. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/base/errors/common.py +74 -74
  19. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/base/errors/http.py +126 -126
  20. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/base/ids/__init__.py +7 -7
  21. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/base/ids/generator.py +62 -62
  22. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/base/io/__init__.py +37 -37
  23. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/base/io/io_utils.py +81 -81
  24. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/base/logger/__init__.py +12 -12
  25. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/base/logger/manager.py +187 -187
  26. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/base/retry/__init__.py +12 -12
  27. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/base/retry/retry.py +171 -171
  28. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/dispatch/__init__.py +21 -21
  29. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/dispatch/candidate.py +51 -51
  30. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/dispatch/dispatcher.py +233 -233
  31. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/dispatch/proxy_selector.py +154 -154
  32. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/dispatch/race.py +119 -119
  33. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/dispatch/selector.py +400 -400
  34. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/fncall/__init__.py +38 -44
  35. echotools-2.4.0/src/echotools/exec/fncall/parsers/__init__.py +5 -0
  36. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/fncall/parsers/stream.py +203 -203
  37. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/fncall/parsers/stream_delta.py +269 -269
  38. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/fncall/parsers/stream_feed.py +165 -165
  39. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/fncall/parsers/stream_final.py +231 -235
  40. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/fncall/prompt/__init__.py +5 -5
  41. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/fncall/prompt/behavior_blocks.py +69 -69
  42. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/fncall/prompt/history.py +322 -322
  43. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/fncall/prompt/history_format.py +145 -145
  44. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/fncall/prompt/inject.py +212 -212
  45. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/fncall/prompt/prompt_helpers.py +277 -277
  46. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/fncall/prompt/templates.py +168 -168
  47. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/fncall/protocols/__init__.py +14 -14
  48. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/fncall/protocols/entml.py +234 -241
  49. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/fncall/protocols/entml_patterns/__init__.py +92 -93
  50. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/fncall/protocols/entml_patterns/invoke.py +197 -197
  51. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/fncall/protocols/entml_patterns/params.py +219 -219
  52. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/fncall/protocols/entml_patterns/regex.py +99 -107
  53. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/fncall/protocols/entml_patterns/strip.py +31 -42
  54. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/fncall/protocols/entml_schema/__init__.py +26 -26
  55. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/fncall/protocols/entml_schema/mangled.py +201 -201
  56. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/fncall/protocols/entml_stream/__init__.py +22 -22
  57. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/fncall/protocols/entml_stream/body.py +293 -293
  58. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/fncall/protocols/entml_stream/snap.py +173 -173
  59. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/fncall/protocols/entml_think/__init__.py +37 -37
  60. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/fncall/protocols/entml_think/core.py +206 -206
  61. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/fncall/protocols/entml_think/filter.py +294 -294
  62. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/fncall/protocols/entml_think/hist.py +168 -168
  63. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/fncall/protocols/entml_think/hold.py +315 -315
  64. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/fncall/protocols/entml_think/parse.py +288 -288
  65. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/fncall/protocols/entml_tool/__init__.py +52 -56
  66. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/fncall/protocols/entml_tool/comment.py +70 -70
  67. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/fncall/protocols/entml_tool/fakemarkup.py +224 -224
  68. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/fncall/protocols/entml_tool/invoke.py +201 -214
  69. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/fncall/protocols/entml_tool/tools.py +156 -156
  70. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/fncall/protocols/entml_tool/values.py +134 -134
  71. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/fncall/registry.py +73 -111
  72. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/fncall/shared/__init__.py +29 -29
  73. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/fncall/shared/coercion.py +289 -289
  74. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/fncall/shared/entml_format.py +169 -169
  75. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/fncall/shared/history_markup.py +333 -333
  76. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/fncall/shared/loop_detect.py +136 -136
  77. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/fncall/shared/normalization.py +181 -181
  78. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/fncall/shared/schema_render.py +126 -126
  79. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/lifecycle/__init__.py +8 -8
  80. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/lifecycle/manager.py +72 -72
  81. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/lifecycle/updater.py +197 -197
  82. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/lifecycle/updater_pull.py +33 -33
  83. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/process/__init__.py +10 -10
  84. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/process/port.py +193 -193
  85. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/protocol/__init__.py +19 -19
  86. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/protocol/base.py +139 -139
  87. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/terminal/conpty.py +246 -246
  88. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/terminal/local/__init__.py +6 -6
  89. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/terminal/local/core.py +318 -318
  90. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/terminal/local/proc.py +331 -331
  91. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/terminal/local/unix.py +195 -195
  92. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/terminal/local/win.py +199 -199
  93. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/terminal/session/__init__.py +20 -20
  94. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/terminal/session/base.py +353 -353
  95. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/terminal/session/client.py +155 -155
  96. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/terminal/tmux.py +105 -105
  97. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/console/__init__.py +89 -89
  98. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/console/charmap.py +148 -148
  99. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/console/spinner.py +342 -342
  100. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/console/ui.py +1 -1
  101. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/console/uicore/mixins/__init__.py +15 -15
  102. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/console/uicore/mixins/uibase.py +195 -195
  103. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/console/uicore/mixins/uicmds.py +224 -224
  104. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/console/uicore/mixins/uiinteract.py +199 -199
  105. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/console/uicore/mixins/uioutput.py +304 -304
  106. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/console/uicore/mixins/uistream.py +144 -144
  107. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/console/uicore/ui_console.py +20 -20
  108. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/console/uicore/ui_io.py +27 -27
  109. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/console/uicore/ui_log.py +67 -67
  110. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/console/uicore/ui_platform.py +389 -389
  111. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/console/uicore/ui_text.py +395 -395
  112. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/console/uicore/ui_types.py +246 -246
  113. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/console/uilayout/ui_bridge.py +205 -205
  114. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/console/uilayout/ui_countdown.py +62 -62
  115. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/console/uilayout/ui_layout.py +50 -50
  116. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/console/uilayout/ui_misc.py +336 -336
  117. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/console/uilayout/ui_panel.py +137 -137
  118. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/console/uilayout/ui_table.py +205 -205
  119. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/console/uilayout/ui_tree.py +146 -146
  120. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/console/uiwidgets/ui_box.py +197 -197
  121. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/console/uiwidgets/ui_editor.py +360 -360
  122. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/console/uiwidgets/ui_progress.py +296 -296
  123. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/console/uiwidgets/ui_richcli.py +110 -110
  124. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/console/uiwidgets/ui_select.py +199 -199
  125. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/console/uiwidgets/ui_stream.py +85 -85
  126. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/console/uiwidgets/ui_themes.py +240 -243
  127. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/events/__init__.py +8 -8
  128. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/events/bus.py +104 -104
  129. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/events/event.py +31 -31
  130. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/spinner/__init__.py +24 -24
  131. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/spinner/spinner.py +324 -324
  132. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/spinner/spinner_color.py +98 -98
  133. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/tracing/__init__.py +28 -28
  134. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/tracing/context.py +63 -63
  135. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/tracing/span.py +135 -135
  136. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/tracing/tracer.py +97 -97
  137. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/watcher/__init__.py +7 -7
  138. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/watcher/file_watcher.py +110 -110
  139. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/web/__init__.py +37 -37
  140. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/web/application.py +120 -120
  141. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/web/input_box/components/sendbutton.js +64 -64
  142. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/web/input_box/components/sortablelist.js +104 -104
  143. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/web/input_box/components/textinput.js +185 -185
  144. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/web/input_box/inputbox.js +277 -277
  145. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/web/input_box/style.css +170 -170
  146. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/web/input_box/voicegif.js +1 -1
  147. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/web/middleware.py +129 -129
  148. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/web/utils.py +187 -187
  149. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/plat/files/__init__.py +7 -7
  150. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/plat/files/file_util.py +155 -155
  151. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/plat/network/__init__.py +11 -11
  152. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/plat/network/http_utils.py +68 -68
  153. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/plat/plugin/__init__.py +9 -9
  154. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/plat/plugin/base.py +41 -41
  155. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/plat/plugin/discovery.py +179 -179
  156. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/plat/plugin/registry.py +245 -245
  157. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/plat/plugin/registry_ops.py +99 -99
  158. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/plat/proxy/__init__.py +7 -7
  159. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/plat/proxy/manager.py +268 -268
  160. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/plat/runtime/__init__.py +7 -7
  161. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/plat/runtime/collector.py +60 -60
  162. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/plat/scheduler/__init__.py +7 -7
  163. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/plat/scheduler/scheduler.py +69 -69
  164. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/plat/sdk/__init__.py +7 -7
  165. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/plat/sdk/facade.py +251 -251
  166. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/version.py +15 -15
  167. {echotools-2.3.104 → echotools-2.4.0}/src/echotools.egg-info/PKG-INFO +195 -144
  168. {echotools-2.3.104 → echotools-2.4.0}/src/echotools.egg-info/SOURCES.txt +0 -5
  169. {echotools-2.3.104 → echotools-2.4.0}/src/tests/_check_parity.py +75 -75
  170. {echotools-2.3.104 → echotools-2.4.0}/src/tests/bench_import.py +14 -14
  171. {echotools-2.3.104 → echotools-2.4.0}/src/tests/conftest.py +19 -19
  172. {echotools-2.3.104 → echotools-2.4.0}/src/tests/fixtures/entml_golden.py +104 -104
  173. {echotools-2.3.104 → echotools-2.4.0}/src/tests/fixtures/entml_golden_update.py +24 -24
  174. {echotools-2.3.104 → echotools-2.4.0}/src/tests/fixtures/simulated_fake_history_markup_responses.py +481 -481
  175. {echotools-2.3.104 → echotools-2.4.0}/src/tests/fixtures/simulated_fault_thinking_responses.py +220 -220
  176. {echotools-2.3.104 → echotools-2.4.0}/src/tests/fixtures/simulated_llm_tool_responses.py +805 -805
  177. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_adversarial_stream_splits.py +147 -147
  178. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_cache_retry.py +128 -128
  179. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_completion.py +48 -48
  180. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_config.py +85 -85
  181. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_config_extended.py +45 -45
  182. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_console.py +19 -26
  183. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_coverage_core.py +515 -515
  184. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_dispatch.py +35 -35
  185. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_dispatch_extended.py +44 -44
  186. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_dispatch_race.py +55 -55
  187. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_entml_agent_output_formats.py +143 -143
  188. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_entml_bare_invoke_format.py +395 -395
  189. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_entml_batch_stream_comprehensive.py +514 -514
  190. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_entml_fake_structure_markup.py +315 -315
  191. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_entml_golden.py +44 -44
  192. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_entml_invoke_known_tool_gate.py +219 -219
  193. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_entml_parser_comprehensive.py +655 -654
  194. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_entml_protocol.py +1743 -1758
  195. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_entml_stream_json.py +77 -77
  196. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_entml_stream_json_exhaustive.py +268 -268
  197. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_entml_thinking_history.py +71 -71
  198. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_entml_tool_parse_leak.py +256 -256
  199. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_entml_tool_pipeline.py +883 -882
  200. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_entml_tools.py +204 -204
  201. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_errors.py +45 -45
  202. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_errors_common.py +24 -24
  203. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_events.py +56 -56
  204. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_events_event.py +18 -18
  205. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_facade.py +33 -33
  206. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_fake_history_markup_batch.py +70 -70
  207. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_fake_history_markup_invoke_preserve.py +130 -130
  208. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_fake_history_markup_reply_protect.py +168 -168
  209. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_fake_history_markup_stream.py +151 -151
  210. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_fault_thinking_close_batch.py +86 -86
  211. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_fault_thinking_close_stream.py +149 -149
  212. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_fncall.py +94 -99
  213. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_fncall_stream_thinking.py +436 -436
  214. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_history_markup_filter.py +321 -321
  215. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_ids.py +25 -25
  216. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_imports.py +39 -51
  217. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_io.py +20 -20
  218. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_keys.py +27 -27
  219. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_lifecycle.py +34 -34
  220. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_logger.py +37 -37
  221. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_merge.py +26 -26
  222. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_model_branch_matrix.py +204 -204
  223. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_plugin.py +31 -31
  224. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_printstream.py +337 -337
  225. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_protocols.py +25 -25
  226. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_proxy.py +56 -56
  227. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_proxy_selector.py +27 -27
  228. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_runtime.py +25 -25
  229. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_scheduler.py +27 -27
  230. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_simulated_llm_tool_parse.py +175 -175
  231. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_stream_partial_json_parity.py +450 -450
  232. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_stream_realtime_parse.py +137 -137
  233. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_tracing.py +30 -30
  234. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_ui_bridge.py +60 -62
  235. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_usage.py +37 -37
  236. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_web.py +48 -48
  237. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_web_broker.py +50 -50
  238. echotools-2.3.104/README.md +0 -88
  239. echotools-2.3.104/src/echotools/compat.py +0 -88
  240. echotools-2.3.104/src/echotools/exec/fncall/parsers/__init__.py +0 -6
  241. echotools-2.3.104/src/echotools/exec/fncall/parsers/xml_params.py +0 -40
  242. echotools-2.3.104/src/echotools/exec/fncall/parsers/xml_parser.py +0 -285
  243. echotools-2.3.104/src/echotools/exec/fncall/protocols/entml_think/blocks.py +0 -362
  244. echotools-2.3.104/src/echotools/exec/fncall/protocols/entml_tool/blocks.py +0 -363
  245. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/base/config/merge.py +0 -0
  246. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/base/io/printstream.py +0 -0
  247. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/dispatch/usage.py +0 -0
  248. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/keys.py +0 -0
  249. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/terminal/__init__.py +0 -0
  250. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/terminal/sanitize.py +0 -0
  251. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/exec/terminal/ssh.py +0 -0
  252. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/translate.py +0 -0
  253. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/web/broker.py +0 -0
  254. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/web/input_box/app.js +0 -0
  255. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/web/input_box/components/filezone.js +0 -0
  256. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/web/input_box/components/motionkit.js +0 -0
  257. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/web/input_box/components/sortablelist.css +0 -0
  258. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/web/input_box/components/voiceinput.js +0 -0
  259. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/web/input_box/fonts/inter-500.woff2 +0 -0
  260. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/web/input_box/fonts/inter-600.woff2 +0 -0
  261. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/web/input_box/fonts/inter400.woff2 +0 -0
  262. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/web/input_box/inputbox.css +0 -0
  263. {echotools-2.3.104 → echotools-2.4.0}/src/echotools/media/web/stats.py +0 -0
  264. {echotools-2.3.104 → echotools-2.4.0}/src/echotools.egg-info/dependency_links.txt +0 -0
  265. {echotools-2.3.104 → echotools-2.4.0}/src/echotools.egg-info/requires.txt +0 -0
  266. {echotools-2.3.104 → echotools-2.4.0}/src/echotools.egg-info/top_level.txt +0 -0
  267. {echotools-2.3.104 → echotools-2.4.0}/src/tests/fixtures/__init__.py +0 -0
  268. {echotools-2.3.104 → echotools-2.4.0}/src/tests/test_entml_thinking_parse.py +0 -0
@@ -1,144 +1,195 @@
1
- Metadata-Version: 2.4
2
- Name: echotools
3
- Version: 2.3.104
4
- Summary: 通用基础设施 SDK:配置、日志、事件、调度、插件、协议、调用链
5
- Home-page: https://github.com/nichengfuben/echotools
6
- Author: nichengfuben
7
- License: MIT
8
- Project-URL: Homepage, https://github.com/nichengfuben/echotools
9
- Project-URL: Repository, https://github.com/nichengfuben/echotools
10
- Project-URL: Issues, https://github.com/nichengfuben/echotools/issues
11
- Classifier: Development Status :: 4 - Beta
12
- Classifier: Intended Audience :: Developers
13
- Classifier: Programming Language :: Python :: 3
14
- Classifier: Programming Language :: Python :: 3.8
15
- Classifier: Programming Language :: Python :: 3.9
16
- Classifier: Programming Language :: Python :: 3.10
17
- Classifier: Programming Language :: Python :: 3.11
18
- Classifier: Programming Language :: Python :: 3.12
19
- Classifier: Programming Language :: Python :: 3.13
20
- Classifier: Topic :: Software Development :: Libraries
21
- Requires-Python: >=3.8
22
- Description-Content-Type: text/markdown
23
- Requires-Dist: typing-extensions>=4.7.0
24
- Provides-Extra: toml
25
- Requires-Dist: tomlkit>=0.11.0; extra == "toml"
26
- Requires-Dist: tomli>=2.0.0; python_version < "3.11" and extra == "toml"
27
- Provides-Extra: watch
28
- Requires-Dist: watchdog>=3.0.0; extra == "watch"
29
- Provides-Extra: http
30
- Requires-Dist: aiohttp>=3.8.0; extra == "http"
31
- Provides-Extra: socks
32
- Requires-Dist: aiohttp-socks>=0.8.0; extra == "socks"
33
- Provides-Extra: ssh
34
- Requires-Dist: paramiko>=3.0.0; extra == "ssh"
35
- Provides-Extra: terminal
36
- Requires-Dist: pywinpty>=2.0.0; sys_platform == "win32" and extra == "terminal"
37
- Provides-Extra: console
38
- Requires-Dist: rich>=13.0; extra == "console"
39
- Requires-Dist: wcwidth>=0.2; extra == "console"
40
- Provides-Extra: all
41
- Requires-Dist: tomlkit>=0.11.0; extra == "all"
42
- Requires-Dist: tomli>=2.0.0; python_version < "3.11" and extra == "all"
43
- Requires-Dist: watchdog>=3.0.0; extra == "all"
44
- Requires-Dist: aiohttp>=3.8.0; extra == "all"
45
- Requires-Dist: aiohttp-socks>=0.8.0; extra == "all"
46
- Requires-Dist: paramiko>=3.0.0; extra == "all"
47
- Requires-Dist: pywinpty>=2.0.0; sys_platform == "win32" and extra == "all"
48
- Requires-Dist: rich>=13.0; extra == "all"
49
- Requires-Dist: wcwidth>=0.2; extra == "all"
50
- Provides-Extra: dev
51
- Requires-Dist: pytest>=7.4.0; extra == "dev"
52
- Requires-Dist: pytest-asyncio>=0.23.0; extra == "dev"
53
- Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
54
- Requires-Dist: mypy>=1.5.0; extra == "dev"
55
- Requires-Dist: ruff>=0.4.0; extra == "dev"
56
-
57
- # echotools
58
-
59
- 通用基础设施 SDK:配置中心、日志、事件总线、调用链、任务调度、
60
- 插件框架、协议系统、自适应选择器,完全项目无关,兼容 Python 3.8–3.14。
61
-
62
- ## 安装
63
-
64
- ```bash
65
- # 核心(仅 typing-extensions)
66
- pip install echotools
67
-
68
- # 完整功能
69
- pip install echotools[all]
70
- ```
71
-
72
- ### 可选依赖
73
-
74
- | Extra | 用途 |
75
- |-------|------|
76
- | `toml` | TOML 配置读写 |
77
- | `watch` | watchdog 文件监视 |
78
- | `http` | aiohttp Web 层 |
79
- | `socks` | SOCKS 代理 |
80
- | `ssh` | SSH 终端 |
81
- | `terminal` | Windows ConPTY |
82
- | `all` | 全部可选依赖 |
83
- | `dev` | pytest, ruff, mypy |
84
-
85
- ### PyPI 重装(`uninstall-no-record-file`)
86
-
87
- 本地 `pip install -e .` 或中断的 wheel 安装可能留下无 `RECORD` 的元数据,导致
88
- `pip install --upgrade echotools` 报 `Cannot uninstall echotools None`。
89
-
90
- ```powershell
91
- # 在仓库根目录
92
- powershell -File scripts/reinstall_from_pypi.ps1 -Version 2.3.81
93
- ```
94
-
95
- 或手动:删除 `src/echotools.egg-info` 与 site-packages 里仅有 `direct_url.json` 的
96
- `echotools-*.dist-info`,再执行
97
- `pip install --force-reinstall --no-cache-dir echotools==2.3.81`。
98
-
99
- ## 快速开始
100
-
101
- ```python
102
- from echotools import EchoTools
103
-
104
- et = EchoTools(service_name="myapp")
105
- et.logger.configure(level="INFO", color=True)
106
- cfg = et.config
107
- cfg.load("config.toml")
108
-
109
- with et.tracer.trace("request") as trace:
110
- with et.tracer.span(trace, "db") as span:
111
- span.set_tag("query", "select 1")
112
-
113
- await et.shutdown()
114
- ```
115
-
116
- ## 能力总览
117
-
118
- | 模块 | 说明 |
119
- |------|------|
120
- | `ConfigCenter` | 点路径配置 + 热重载 + 类型绑定 |
121
- | `LoggerManager` | 调用链注入 + 颜色 + 轮转 |
122
- | `EventBus` | 同步/异步事件 |
123
- | `Tracer` | 轻量调用链 |
124
- | `TaskDispatcher` | 单发/竞速 + 贝叶斯自适应选择 |
125
- | `PluginRegistry` | 自动发现 + 热重载 |
126
- | `get_protocol` | XML/antml/original/bracket/nous 等 LLM 工具协议 |
127
- | `ProxyManager` | HTTP/HTTPS/SOCKS |
128
- | `AutoUpdater` | git 自动更新 |
129
- | `FileWatcher` | 轮询文件监视 |
130
-
131
- ## 开发
132
-
133
- ```bash
134
- pip install -e ".[dev,all]"
135
- make lint
136
- make test
137
- make cov
138
- ```
139
-
140
- 模块指南见 [docs/modules.md](docs/modules.md),API 参考见 [docs/api.md](docs/api.md)。
141
-
142
- ## 许可证
143
-
144
- MIT
1
+ Metadata-Version: 2.4
2
+ Name: echotools
3
+ Version: 2.4.0
4
+ Summary: 通用基础设施 SDK:配置、日志、事件、调度、插件、协议、调用链
5
+ Home-page: https://github.com/nichengfuben/echotools
6
+ Author: nichengfuben
7
+ License: MIT
8
+ Project-URL: Homepage, https://github.com/nichengfuben/echotools
9
+ Project-URL: Repository, https://github.com/nichengfuben/echotools
10
+ Project-URL: Issues, https://github.com/nichengfuben/echotools/issues
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.8
15
+ Classifier: Programming Language :: Python :: 3.9
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: Software Development :: Libraries
21
+ Requires-Python: >=3.8
22
+ Description-Content-Type: text/markdown
23
+ Requires-Dist: typing-extensions>=4.7.0
24
+ Provides-Extra: toml
25
+ Requires-Dist: tomlkit>=0.11.0; extra == "toml"
26
+ Requires-Dist: tomli>=2.0.0; python_version < "3.11" and extra == "toml"
27
+ Provides-Extra: watch
28
+ Requires-Dist: watchdog>=3.0.0; extra == "watch"
29
+ Provides-Extra: http
30
+ Requires-Dist: aiohttp>=3.8.0; extra == "http"
31
+ Provides-Extra: socks
32
+ Requires-Dist: aiohttp-socks>=0.8.0; extra == "socks"
33
+ Provides-Extra: ssh
34
+ Requires-Dist: paramiko>=3.0.0; extra == "ssh"
35
+ Provides-Extra: terminal
36
+ Requires-Dist: pywinpty>=2.0.0; sys_platform == "win32" and extra == "terminal"
37
+ Provides-Extra: console
38
+ Requires-Dist: rich>=13.0; extra == "console"
39
+ Requires-Dist: wcwidth>=0.2; extra == "console"
40
+ Provides-Extra: all
41
+ Requires-Dist: tomlkit>=0.11.0; extra == "all"
42
+ Requires-Dist: tomli>=2.0.0; python_version < "3.11" and extra == "all"
43
+ Requires-Dist: watchdog>=3.0.0; extra == "all"
44
+ Requires-Dist: aiohttp>=3.8.0; extra == "all"
45
+ Requires-Dist: aiohttp-socks>=0.8.0; extra == "all"
46
+ Requires-Dist: paramiko>=3.0.0; extra == "all"
47
+ Requires-Dist: pywinpty>=2.0.0; sys_platform == "win32" and extra == "all"
48
+ Requires-Dist: rich>=13.0; extra == "all"
49
+ Requires-Dist: wcwidth>=0.2; extra == "all"
50
+ Provides-Extra: dev
51
+ Requires-Dist: pytest>=7.4.0; extra == "dev"
52
+ Requires-Dist: pytest-asyncio>=0.23.0; extra == "dev"
53
+ Requires-Dist: pytest-cov>=4.1.0; extra == "dev"
54
+ Requires-Dist: mypy>=1.5.0; extra == "dev"
55
+ Requires-Dist: ruff>=0.4.0; extra == "dev"
56
+
57
+ # echotools
58
+
59
+ 通用基础设施 SDK:配置、日志、事件、调度、插件、调用链,以及 **entml** LLM 工具调用协议与终端 Console UI。
60
+
61
+ 完全项目无关,兼容 Python 3.8–3.14。当前版本:**2.4.0**(详见 [CHANGELOG](docs/CHANGELOG.md))。
62
+
63
+ ## 安装
64
+
65
+ ```bash
66
+ # 核心(仅 typing-extensions)
67
+ pip install echotools
68
+
69
+ # 完整功能(含 TOML、Web、终端、Console UI 等)
70
+ pip install echotools[all]
71
+ ```
72
+
73
+ ### 可选依赖
74
+
75
+ | Extra | 用途 |
76
+ |-------|------|
77
+ | `toml` | TOML 配置读写 |
78
+ | `watch` | watchdog 文件监视 |
79
+ | `http` | aiohttp Web 层 |
80
+ | `socks` | SOCKS 代理 |
81
+ | `ssh` | SSH 终端 |
82
+ | `terminal` | Windows ConPTY |
83
+ | `console` | Rich 终端 UI(渐变、表格、交互选择) |
84
+ | `all` | 全部可选依赖 |
85
+ | `dev` | pytest、ruff、mypy |
86
+
87
+ ## 快速开始
88
+
89
+ ### 基础设施
90
+
91
+ ```python
92
+ from echotools import EchoTools
93
+
94
+ et = EchoTools(service_name="myapp")
95
+ et.logger.configure(level="INFO", color=True)
96
+ cfg = et.config
97
+ cfg.load("config.toml")
98
+
99
+ with et.tracer.trace("request") as trace:
100
+ with et.tracer.span(trace, "db") as span:
101
+ span.set_tag("query", "select 1")
102
+
103
+ await et.shutdown()
104
+ ```
105
+
106
+ ### entml 工具调用
107
+
108
+ 内置 **entml**(`<entml:*>` 熵标记语言)协议,负责 prompt 注入与模型输出解析。
109
+
110
+ ```python
111
+ from echotools import FncallStreamParser, get_protocol, inject_fncall
112
+
113
+ tools = [
114
+ {
115
+ "name": "Bash",
116
+ "description": "Run a shell command",
117
+ "input_schema": {
118
+ "type": "object",
119
+ "properties": {"command": {"type": "string"}},
120
+ "required": ["command"],
121
+ },
122
+ }
123
+ ]
124
+ messages = [{"role": "user", "content": "列出当前目录"}]
125
+
126
+ proto = get_protocol()
127
+ out_messages = inject_fncall(messages, tools, proto, lang="zh")
128
+
129
+ parser = FncallStreamParser(proto, tools=tools)
130
+ for chunk in model_stream:
131
+ parser.feed(chunk)
132
+ if parser.get_ready_tool_calls():
133
+ ...
134
+ result = parser.finalize()
135
+ ```
136
+
137
+ 能力包括:prompt 注入(history / 工具结果 / thinking 模式)、batch `parse()`、流式
138
+ `partial_text` / `input_json_delta`、伪 history 剥离、工具循环检测。
139
+
140
+ ### 终端 Console UI
141
+
142
+ 需要 `pip install echotools[console]`(或 `[all]`):
143
+
144
+ ```python
145
+ from echotools.media.console import (
146
+ create_themed_ui,
147
+ render_gradient_banner,
148
+ render_text_lines,
149
+ run_select,
150
+ )
151
+
152
+ ui = create_themed_ui(theme_name="ocean") # ocean / forest / sunset / violet / rose / slate / cyan
153
+ print(render_gradient_banner(render_text_lines("echotools"), theme_name="ocean"))
154
+ choice = run_select(ui, "选择主题", ["ocean", "forest", "sunset"])
155
+ ```
156
+
157
+ ## 能力总览
158
+
159
+ | 模块 | 说明 |
160
+ |------|------|
161
+ | `EchoTools` | 门面:配置、日志、事件、调度、插件等统一入口 |
162
+ | `ConfigCenter` | 点路径配置 + 热重载 + 类型绑定 |
163
+ | `LoggerManager` | 调用链注入 + 颜色 + 轮转 |
164
+ | `EventBus` | 同步/异步事件 |
165
+ | `Tracer` | 轻量调用链 |
166
+ | `TaskDispatcher` | 单发/竞速 + 贝叶斯自适应选择 |
167
+ | `PluginRegistry` | 自动发现 + 热重载 |
168
+ | `get_protocol` / `inject_fncall` | entml 工具协议与 prompt 注入 |
169
+ | `FncallStreamParser` | 流式工具调用解析 |
170
+ | `media.console` | Rich 终端 UI、多主题、交互选择与 ANSI 渐变 |
171
+ | `PrintStream` | 动态速度打印流 |
172
+ | `ProxyManager` | HTTP/HTTPS/SOCKS |
173
+ | `WebApplication` | aiohttp Web(需 `[http]`) |
174
+ | `LocalTerminal` / `SSHTerminal` | 终端会话(需 `[terminal]` / `[ssh]`) |
175
+ | `AutoUpdater` | git 自动更新 |
176
+ | `FileWatcher` | 轮询文件监视 |
177
+
178
+ ## 开发
179
+
180
+ ```bash
181
+ pip install -e ".[dev,all]"
182
+ make -C docs lint
183
+ make -C docs test
184
+ make -C docs cov
185
+ ```
186
+
187
+ 模块指南见 [docs/modules.md](docs/modules.md),API 参考见 [docs/api.md](docs/api.md)。
188
+
189
+ ## 变更记录
190
+
191
+ 见 [docs/CHANGELOG.md](docs/CHANGELOG.md)。
192
+
193
+ ## 许可证
194
+
195
+ MIT
@@ -0,0 +1,139 @@
1
+ # echotools
2
+
3
+ 通用基础设施 SDK:配置、日志、事件、调度、插件、调用链,以及 **entml** LLM 工具调用协议与终端 Console UI。
4
+
5
+ 完全项目无关,兼容 Python 3.8–3.14。当前版本:**2.4.0**(详见 [CHANGELOG](docs/CHANGELOG.md))。
6
+
7
+ ## 安装
8
+
9
+ ```bash
10
+ # 核心(仅 typing-extensions)
11
+ pip install echotools
12
+
13
+ # 完整功能(含 TOML、Web、终端、Console UI 等)
14
+ pip install echotools[all]
15
+ ```
16
+
17
+ ### 可选依赖
18
+
19
+ | Extra | 用途 |
20
+ |-------|------|
21
+ | `toml` | TOML 配置读写 |
22
+ | `watch` | watchdog 文件监视 |
23
+ | `http` | aiohttp Web 层 |
24
+ | `socks` | SOCKS 代理 |
25
+ | `ssh` | SSH 终端 |
26
+ | `terminal` | Windows ConPTY |
27
+ | `console` | Rich 终端 UI(渐变、表格、交互选择) |
28
+ | `all` | 全部可选依赖 |
29
+ | `dev` | pytest、ruff、mypy |
30
+
31
+ ## 快速开始
32
+
33
+ ### 基础设施
34
+
35
+ ```python
36
+ from echotools import EchoTools
37
+
38
+ et = EchoTools(service_name="myapp")
39
+ et.logger.configure(level="INFO", color=True)
40
+ cfg = et.config
41
+ cfg.load("config.toml")
42
+
43
+ with et.tracer.trace("request") as trace:
44
+ with et.tracer.span(trace, "db") as span:
45
+ span.set_tag("query", "select 1")
46
+
47
+ await et.shutdown()
48
+ ```
49
+
50
+ ### entml 工具调用
51
+
52
+ 内置 **entml**(`<entml:*>` 熵标记语言)协议,负责 prompt 注入与模型输出解析。
53
+
54
+ ```python
55
+ from echotools import FncallStreamParser, get_protocol, inject_fncall
56
+
57
+ tools = [
58
+ {
59
+ "name": "Bash",
60
+ "description": "Run a shell command",
61
+ "input_schema": {
62
+ "type": "object",
63
+ "properties": {"command": {"type": "string"}},
64
+ "required": ["command"],
65
+ },
66
+ }
67
+ ]
68
+ messages = [{"role": "user", "content": "列出当前目录"}]
69
+
70
+ proto = get_protocol()
71
+ out_messages = inject_fncall(messages, tools, proto, lang="zh")
72
+
73
+ parser = FncallStreamParser(proto, tools=tools)
74
+ for chunk in model_stream:
75
+ parser.feed(chunk)
76
+ if parser.get_ready_tool_calls():
77
+ ...
78
+ result = parser.finalize()
79
+ ```
80
+
81
+ 能力包括:prompt 注入(history / 工具结果 / thinking 模式)、batch `parse()`、流式
82
+ `partial_text` / `input_json_delta`、伪 history 剥离、工具循环检测。
83
+
84
+ ### 终端 Console UI
85
+
86
+ 需要 `pip install echotools[console]`(或 `[all]`):
87
+
88
+ ```python
89
+ from echotools.media.console import (
90
+ create_themed_ui,
91
+ render_gradient_banner,
92
+ render_text_lines,
93
+ run_select,
94
+ )
95
+
96
+ ui = create_themed_ui(theme_name="ocean") # ocean / forest / sunset / violet / rose / slate / cyan
97
+ print(render_gradient_banner(render_text_lines("echotools"), theme_name="ocean"))
98
+ choice = run_select(ui, "选择主题", ["ocean", "forest", "sunset"])
99
+ ```
100
+
101
+ ## 能力总览
102
+
103
+ | 模块 | 说明 |
104
+ |------|------|
105
+ | `EchoTools` | 门面:配置、日志、事件、调度、插件等统一入口 |
106
+ | `ConfigCenter` | 点路径配置 + 热重载 + 类型绑定 |
107
+ | `LoggerManager` | 调用链注入 + 颜色 + 轮转 |
108
+ | `EventBus` | 同步/异步事件 |
109
+ | `Tracer` | 轻量调用链 |
110
+ | `TaskDispatcher` | 单发/竞速 + 贝叶斯自适应选择 |
111
+ | `PluginRegistry` | 自动发现 + 热重载 |
112
+ | `get_protocol` / `inject_fncall` | entml 工具协议与 prompt 注入 |
113
+ | `FncallStreamParser` | 流式工具调用解析 |
114
+ | `media.console` | Rich 终端 UI、多主题、交互选择与 ANSI 渐变 |
115
+ | `PrintStream` | 动态速度打印流 |
116
+ | `ProxyManager` | HTTP/HTTPS/SOCKS |
117
+ | `WebApplication` | aiohttp Web(需 `[http]`) |
118
+ | `LocalTerminal` / `SSHTerminal` | 终端会话(需 `[terminal]` / `[ssh]`) |
119
+ | `AutoUpdater` | git 自动更新 |
120
+ | `FileWatcher` | 轮询文件监视 |
121
+
122
+ ## 开发
123
+
124
+ ```bash
125
+ pip install -e ".[dev,all]"
126
+ make -C docs lint
127
+ make -C docs test
128
+ make -C docs cov
129
+ ```
130
+
131
+ 模块指南见 [docs/modules.md](docs/modules.md),API 参考见 [docs/api.md](docs/api.md)。
132
+
133
+ ## 变更记录
134
+
135
+ 见 [docs/CHANGELOG.md](docs/CHANGELOG.md)。
136
+
137
+ ## 许可证
138
+
139
+ MIT