echotools 2.0.0__tar.gz → 2.1.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 (147) hide show
  1. {echotools-2.0.0 → echotools-2.1.0}/PKG-INFO +1 -1
  2. {echotools-2.0.0 → echotools-2.1.0}/pyproject.toml +1 -1
  3. {echotools-2.0.0 → echotools-2.1.0}/src/echotools.egg-info/PKG-INFO +1 -1
  4. {echotools-2.0.0 → echotools-2.1.0}/tests/test_fncall.py +13 -20
  5. {echotools-2.0.0 → echotools-2.1.0}/tests/test_protocols.py +6 -6
  6. {echotools-2.0.0 → echotools-2.1.0}/tests/test_web.py +3 -3
  7. {echotools-2.0.0 → echotools-2.1.0}/README.md +0 -0
  8. {echotools-2.0.0 → echotools-2.1.0}/setup.cfg +0 -0
  9. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/__init__.py +0 -0
  10. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/_version.py +0 -0
  11. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/cache/__init__.py +0 -0
  12. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/cache/list_cache.py +0 -0
  13. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/cache/memory_cache.py +0 -0
  14. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/config/__init__.py +0 -0
  15. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/config/base.py +0 -0
  16. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/config/center.py +0 -0
  17. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/config/loader.py +0 -0
  18. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/config/merge.py +0 -0
  19. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/dispatch/__init__.py +0 -0
  20. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/dispatch/candidate.py +0 -0
  21. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/dispatch/dispatcher.py +0 -0
  22. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/dispatch/proxy_selector.py +0 -0
  23. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/dispatch/selector.py +0 -0
  24. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/dispatch/usage.py +0 -0
  25. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/errors/__init__.py +0 -0
  26. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/errors/base.py +0 -0
  27. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/errors/classify.py +0 -0
  28. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/errors/common.py +0 -0
  29. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/errors/http.py +0 -0
  30. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/events/__init__.py +0 -0
  31. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/events/bus.py +0 -0
  32. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/events/event.py +0 -0
  33. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/files/__init__.py +0 -0
  34. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/files/file_util.py +0 -0
  35. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/fncall/__init__.py +0 -0
  36. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/fncall/parsers/__init__.py +0 -0
  37. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/fncall/parsers/stream.py +0 -0
  38. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/fncall/parsers/xml_parser.py +0 -0
  39. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/fncall/prompt/__init__.py +0 -0
  40. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/fncall/prompt/history.py +0 -0
  41. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/fncall/prompt/inject.py +0 -0
  42. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/fncall/prompt/templates.py +0 -0
  43. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/fncall/protocols/__init__.py +0 -0
  44. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/fncall/protocols/entml.py +0 -0
  45. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/fncall/registry.py +0 -0
  46. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/fncall/shared/__init__.py +0 -0
  47. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/fncall/shared/coercion.py +0 -0
  48. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/fncall/shared/loop_detect.py +0 -0
  49. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/fncall/shared/normalization.py +0 -0
  50. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/fncall/shared/xml_helpers.py +0 -0
  51. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/ids/__init__.py +0 -0
  52. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/ids/generator.py +0 -0
  53. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/io/__init__.py +0 -0
  54. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/io/io_utils.py +0 -0
  55. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/keys.py +0 -0
  56. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/lifecycle/__init__.py +0 -0
  57. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/lifecycle/manager.py +0 -0
  58. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/lifecycle/updater.py +0 -0
  59. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/logger/__init__.py +0 -0
  60. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/logger/manager.py +0 -0
  61. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/network/__init__.py +0 -0
  62. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/network/http_utils.py +0 -0
  63. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/plugin/__init__.py +0 -0
  64. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/plugin/base.py +0 -0
  65. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/plugin/discovery.py +0 -0
  66. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/plugin/registry.py +0 -0
  67. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/process/__init__.py +0 -0
  68. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/process/port.py +0 -0
  69. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/protocol/__init__.py +0 -0
  70. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/protocol/base.py +0 -0
  71. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/proxy/__init__.py +0 -0
  72. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/proxy/manager.py +0 -0
  73. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/py.typed +0 -0
  74. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/retry/__init__.py +0 -0
  75. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/retry/retry.py +0 -0
  76. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/runtime/__init__.py +0 -0
  77. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/runtime/collector.py +0 -0
  78. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/scheduler/__init__.py +0 -0
  79. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/scheduler/scheduler.py +0 -0
  80. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/sdk/__init__.py +0 -0
  81. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/sdk/facade.py +0 -0
  82. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/terminal/__init__.py +0 -0
  83. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/terminal/conpty.py +0 -0
  84. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/terminal/local.py +0 -0
  85. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/terminal/sanitize.py +0 -0
  86. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/terminal/session.py +0 -0
  87. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/terminal/ssh.py +0 -0
  88. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/tracing/__init__.py +0 -0
  89. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/tracing/context.py +0 -0
  90. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/tracing/span.py +0 -0
  91. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/tracing/tracer.py +0 -0
  92. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/translate.py +0 -0
  93. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/watcher/__init__.py +0 -0
  94. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/watcher/file_watcher.py +0 -0
  95. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/web/__init__.py +0 -0
  96. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/web/application.py +0 -0
  97. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/web/broker.py +0 -0
  98. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/web/input_box/app.js +0 -0
  99. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/web/input_box/file-zone/file-zone.js +0 -0
  100. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/web/input_box/fonts/inter-400.woff2 +0 -0
  101. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/web/input_box/fonts/inter-500.woff2 +0 -0
  102. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/web/input_box/fonts/inter-600.woff2 +0 -0
  103. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/web/input_box/fonts/tailwind.min.css +0 -0
  104. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/web/input_box/input-box.css +0 -0
  105. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/web/input_box/input-box.js +0 -0
  106. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/web/input_box/motion-kit/motion-kit.js +0 -0
  107. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/web/input_box/send-button/send-button.js +0 -0
  108. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/web/input_box/sortable-list/sortable-list.css +0 -0
  109. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/web/input_box/sortable-list/sortable-list.js +0 -0
  110. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/web/input_box/style.css +0 -0
  111. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/web/input_box/text-input/text-input.js +0 -0
  112. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/web/input_box/voice-input/voice-input.js +0 -0
  113. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/web/middleware.py +0 -0
  114. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/web/stats.py +0 -0
  115. {echotools-2.0.0 → echotools-2.1.0}/src/echotools/web/utils.py +0 -0
  116. {echotools-2.0.0 → echotools-2.1.0}/src/echotools.egg-info/SOURCES.txt +0 -0
  117. {echotools-2.0.0 → echotools-2.1.0}/src/echotools.egg-info/dependency_links.txt +0 -0
  118. {echotools-2.0.0 → echotools-2.1.0}/src/echotools.egg-info/requires.txt +0 -0
  119. {echotools-2.0.0 → echotools-2.1.0}/src/echotools.egg-info/top_level.txt +0 -0
  120. {echotools-2.0.0 → echotools-2.1.0}/tests/test_cache_retry.py +0 -0
  121. {echotools-2.0.0 → echotools-2.1.0}/tests/test_completion.py +0 -0
  122. {echotools-2.0.0 → echotools-2.1.0}/tests/test_config.py +0 -0
  123. {echotools-2.0.0 → echotools-2.1.0}/tests/test_config_extended.py +0 -0
  124. {echotools-2.0.0 → echotools-2.1.0}/tests/test_coverage_core.py +0 -0
  125. {echotools-2.0.0 → echotools-2.1.0}/tests/test_dispatch.py +0 -0
  126. {echotools-2.0.0 → echotools-2.1.0}/tests/test_dispatch_extended.py +0 -0
  127. {echotools-2.0.0 → echotools-2.1.0}/tests/test_dispatch_race.py +0 -0
  128. {echotools-2.0.0 → echotools-2.1.0}/tests/test_errors.py +0 -0
  129. {echotools-2.0.0 → echotools-2.1.0}/tests/test_errors_common.py +0 -0
  130. {echotools-2.0.0 → echotools-2.1.0}/tests/test_events.py +0 -0
  131. {echotools-2.0.0 → echotools-2.1.0}/tests/test_events_event.py +0 -0
  132. {echotools-2.0.0 → echotools-2.1.0}/tests/test_facade.py +0 -0
  133. {echotools-2.0.0 → echotools-2.1.0}/tests/test_ids.py +0 -0
  134. {echotools-2.0.0 → echotools-2.1.0}/tests/test_imports.py +0 -0
  135. {echotools-2.0.0 → echotools-2.1.0}/tests/test_io.py +0 -0
  136. {echotools-2.0.0 → echotools-2.1.0}/tests/test_keys.py +0 -0
  137. {echotools-2.0.0 → echotools-2.1.0}/tests/test_lifecycle.py +0 -0
  138. {echotools-2.0.0 → echotools-2.1.0}/tests/test_logger.py +0 -0
  139. {echotools-2.0.0 → echotools-2.1.0}/tests/test_merge.py +0 -0
  140. {echotools-2.0.0 → echotools-2.1.0}/tests/test_plugin.py +0 -0
  141. {echotools-2.0.0 → echotools-2.1.0}/tests/test_proxy.py +0 -0
  142. {echotools-2.0.0 → echotools-2.1.0}/tests/test_proxy_selector.py +0 -0
  143. {echotools-2.0.0 → echotools-2.1.0}/tests/test_runtime.py +0 -0
  144. {echotools-2.0.0 → echotools-2.1.0}/tests/test_scheduler.py +0 -0
  145. {echotools-2.0.0 → echotools-2.1.0}/tests/test_tracing.py +0 -0
  146. {echotools-2.0.0 → echotools-2.1.0}/tests/test_usage.py +0 -0
  147. {echotools-2.0.0 → echotools-2.1.0}/tests/test_web_broker.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: echotools
3
- Version: 2.0.0
3
+ Version: 2.1.0
4
4
  Summary: 通用基础设施 SDK:配置、日志、事件、调度、插件、协议、调用链
5
5
  Author: nichengfuben
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "echotools"
7
- version = "2.0.0"
7
+ version = "2.1.0"
8
8
  description = "通用基础设施 SDK:配置、日志、事件、调度、插件、协议、调用链"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: echotools
3
- Version: 2.0.0
3
+ Version: 2.1.0
4
4
  Summary: 通用基础设施 SDK:配置、日志、事件、调度、插件、协议、调用链
5
5
  Author: nichengfuben
6
6
  License: MIT
@@ -9,22 +9,17 @@ from echotools.fncall import get_protocol, inject_fncall, list_protocols
9
9
  "protocol_id,sample,expected_name",
10
10
  [
11
11
  (
12
- "antml",
13
- '<antml:function_calls><antml:invoke name="tool_a">'
14
- '<antml:parameters>{"x":1}</antml:parameters></antml:invoke></antml:function_calls>',
12
+ "entml",
13
+ '<entml:function_calls><entml:invoke name="tool_a">'
14
+ '<entml:parameters>{"x":1}</entml:parameters></entml:invoke></entml:function_calls>',
15
15
  "tool_a",
16
16
  ),
17
17
  (
18
- "xml",
19
- '<function_calls><invoke name="tool_x">'
20
- '<parameter name="x">1</parameter></invoke></function_calls>',
18
+ "entml",
19
+ '<entml:function_calls><entml:invoke name="tool_x">'
20
+ '<entml:parameter name="x">1</entml:parameter></entml:invoke></entml:function_calls>',
21
21
  "tool_x",
22
22
  ),
23
- (
24
- "bracket",
25
- "[function_calls][call:tool_b]{\"y\":2}[/call][/function_calls]",
26
- "tool_b",
27
- ),
28
23
  ],
29
24
  )
30
25
  def test_protocol_parse(protocol_id: str, sample: str, expected_name: str) -> None:
@@ -35,23 +30,21 @@ def test_protocol_parse(protocol_id: str, sample: str, expected_name: str) -> No
35
30
 
36
31
 
37
32
  def test_list_protocols_includes_builtins() -> None:
38
- ids = list_protocols()
39
- for expected in ("xml", "antml", "original", "bracket", "nous", "dsml"):
40
- assert expected in ids
33
+ assert list_protocols() == ["entml"]
41
34
 
42
35
 
43
- def test_custom_protocol_lazy_create() -> None:
44
- proto = get_protocol("custom", custom_prompt_en="Use tools")
45
- assert proto.id == "custom"
36
+ def test_custom_protocol_requires_plugin() -> None:
37
+ with pytest.raises(ValueError, match="Provider-Fncall-Util"):
38
+ get_protocol("custom", custom_prompt_en="Use tools")
46
39
 
47
40
 
48
41
  def test_get_protocol_platform_mapping() -> None:
49
- proto = get_protocol(platform_id="p1", mapping={"p1": "xml"})
50
- assert proto.id == "xml"
42
+ proto = get_protocol(platform_id="p1", mapping={"p1": "entml"})
43
+ assert proto.id == "entml"
51
44
 
52
45
 
53
46
  def test_inject_with_tools_and_dump(tmp_path) -> None:
54
- proto = get_protocol("xml")
47
+ proto = get_protocol("entml")
55
48
  tools = [
56
49
  {
57
50
  "type": "function",
@@ -3,12 +3,12 @@ from __future__ import annotations
3
3
  from echotools.fncall import get_protocol, inject_fncall
4
4
 
5
5
 
6
- def test_xml_protocol_parse() -> None:
7
- """antml 协议解析工具调用。"""
8
- proto = get_protocol("antml")
6
+ def test_entml_protocol_parse() -> None:
7
+ """entml 协议解析工具调用。"""
8
+ proto = get_protocol("entml")
9
9
  text = (
10
- '<antml:function_calls><antml:invoke name="f">'
11
- '<antml:parameters>{"x":1}</antml:parameters></antml:invoke></antml:function_calls>'
10
+ '<entml:function_calls><entml:invoke name="f">'
11
+ '<entml:parameters>{"x":1}</entml:parameters></entml:invoke></entml:function_calls>'
12
12
  )
13
13
  clean, calls = proto.parse(text)
14
14
  assert calls
@@ -17,6 +17,6 @@ def test_xml_protocol_parse() -> None:
17
17
 
18
18
  def test_inject_no_tools() -> None:
19
19
  """无工具时原样返回。"""
20
- proto = get_protocol("xml")
20
+ proto = get_protocol("entml")
21
21
  msgs = [{"role": "user", "content": "hi"}]
22
22
  assert inject_fncall(msgs, [], proto) == msgs
@@ -12,7 +12,7 @@ def test_json_body_roundtrip() -> None:
12
12
  def test_safe_flush_splits_buffer() -> None:
13
13
  from echotools.fncall import get_protocol
14
14
 
15
- proto = get_protocol("xml")
15
+ proto = get_protocol("entml")
16
16
  flushed_safe, flushed_remain = safe_flush("hello", proto)
17
17
  assert flushed_safe == "hello"
18
18
  assert flushed_remain == ""
@@ -42,7 +42,7 @@ def test_clean_fncall() -> None:
42
42
  from echotools.fncall import get_protocol
43
43
  from echotools.web.utils import clean_fncall
44
44
 
45
- proto = get_protocol("antml")
46
- text = '<antml:function_calls></antml:function_calls>hello'
45
+ proto = get_protocol("entml")
46
+ text = '<entml:function_calls></entml:function_calls>hello'
47
47
  cleaned = clean_fncall(text, proto)
48
48
  assert "hello" in cleaned
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes