onetool-mcp 1.0.0b1__py3-none-any.whl

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 (132) hide show
  1. bench/__init__.py +5 -0
  2. bench/cli.py +69 -0
  3. bench/harness/__init__.py +66 -0
  4. bench/harness/client.py +692 -0
  5. bench/harness/config.py +397 -0
  6. bench/harness/csv_writer.py +109 -0
  7. bench/harness/evaluate.py +512 -0
  8. bench/harness/metrics.py +283 -0
  9. bench/harness/runner.py +899 -0
  10. bench/py.typed +0 -0
  11. bench/reporter.py +629 -0
  12. bench/run.py +487 -0
  13. bench/secrets.py +101 -0
  14. bench/utils.py +16 -0
  15. onetool/__init__.py +4 -0
  16. onetool/cli.py +391 -0
  17. onetool/py.typed +0 -0
  18. onetool_mcp-1.0.0b1.dist-info/METADATA +163 -0
  19. onetool_mcp-1.0.0b1.dist-info/RECORD +132 -0
  20. onetool_mcp-1.0.0b1.dist-info/WHEEL +4 -0
  21. onetool_mcp-1.0.0b1.dist-info/entry_points.txt +3 -0
  22. onetool_mcp-1.0.0b1.dist-info/licenses/LICENSE.txt +687 -0
  23. onetool_mcp-1.0.0b1.dist-info/licenses/NOTICE.txt +64 -0
  24. ot/__init__.py +37 -0
  25. ot/__main__.py +6 -0
  26. ot/_cli.py +107 -0
  27. ot/_tui.py +53 -0
  28. ot/config/__init__.py +46 -0
  29. ot/config/defaults/bench.yaml +4 -0
  30. ot/config/defaults/diagram-templates/api-flow.mmd +33 -0
  31. ot/config/defaults/diagram-templates/c4-context.puml +30 -0
  32. ot/config/defaults/diagram-templates/class-diagram.mmd +87 -0
  33. ot/config/defaults/diagram-templates/feature-mindmap.mmd +70 -0
  34. ot/config/defaults/diagram-templates/microservices.d2 +81 -0
  35. ot/config/defaults/diagram-templates/project-gantt.mmd +37 -0
  36. ot/config/defaults/diagram-templates/state-machine.mmd +42 -0
  37. ot/config/defaults/onetool.yaml +25 -0
  38. ot/config/defaults/prompts.yaml +97 -0
  39. ot/config/defaults/servers.yaml +7 -0
  40. ot/config/defaults/snippets.yaml +4 -0
  41. ot/config/defaults/tool_templates/__init__.py +7 -0
  42. ot/config/defaults/tool_templates/extension.py +52 -0
  43. ot/config/defaults/tool_templates/isolated.py +61 -0
  44. ot/config/dynamic.py +121 -0
  45. ot/config/global_templates/__init__.py +2 -0
  46. ot/config/global_templates/bench-secrets-template.yaml +6 -0
  47. ot/config/global_templates/bench.yaml +9 -0
  48. ot/config/global_templates/onetool.yaml +27 -0
  49. ot/config/global_templates/secrets-template.yaml +44 -0
  50. ot/config/global_templates/servers.yaml +18 -0
  51. ot/config/global_templates/snippets.yaml +235 -0
  52. ot/config/loader.py +1087 -0
  53. ot/config/mcp.py +145 -0
  54. ot/config/secrets.py +190 -0
  55. ot/config/tool_config.py +125 -0
  56. ot/decorators.py +116 -0
  57. ot/executor/__init__.py +35 -0
  58. ot/executor/base.py +16 -0
  59. ot/executor/fence_processor.py +83 -0
  60. ot/executor/linter.py +142 -0
  61. ot/executor/pack_proxy.py +260 -0
  62. ot/executor/param_resolver.py +140 -0
  63. ot/executor/pep723.py +288 -0
  64. ot/executor/result_store.py +369 -0
  65. ot/executor/runner.py +496 -0
  66. ot/executor/simple.py +163 -0
  67. ot/executor/tool_loader.py +396 -0
  68. ot/executor/validator.py +398 -0
  69. ot/executor/worker_pool.py +388 -0
  70. ot/executor/worker_proxy.py +189 -0
  71. ot/http_client.py +145 -0
  72. ot/logging/__init__.py +37 -0
  73. ot/logging/config.py +315 -0
  74. ot/logging/entry.py +213 -0
  75. ot/logging/format.py +188 -0
  76. ot/logging/span.py +349 -0
  77. ot/meta.py +1555 -0
  78. ot/paths.py +453 -0
  79. ot/prompts.py +218 -0
  80. ot/proxy/__init__.py +21 -0
  81. ot/proxy/manager.py +396 -0
  82. ot/py.typed +0 -0
  83. ot/registry/__init__.py +189 -0
  84. ot/registry/models.py +57 -0
  85. ot/registry/parser.py +269 -0
  86. ot/registry/registry.py +413 -0
  87. ot/server.py +315 -0
  88. ot/shortcuts/__init__.py +15 -0
  89. ot/shortcuts/aliases.py +87 -0
  90. ot/shortcuts/snippets.py +258 -0
  91. ot/stats/__init__.py +35 -0
  92. ot/stats/html.py +250 -0
  93. ot/stats/jsonl_writer.py +283 -0
  94. ot/stats/reader.py +354 -0
  95. ot/stats/timing.py +57 -0
  96. ot/support.py +63 -0
  97. ot/tools.py +114 -0
  98. ot/utils/__init__.py +81 -0
  99. ot/utils/batch.py +161 -0
  100. ot/utils/cache.py +120 -0
  101. ot/utils/deps.py +403 -0
  102. ot/utils/exceptions.py +23 -0
  103. ot/utils/factory.py +179 -0
  104. ot/utils/format.py +65 -0
  105. ot/utils/http.py +202 -0
  106. ot/utils/platform.py +45 -0
  107. ot/utils/sanitize.py +130 -0
  108. ot/utils/truncate.py +69 -0
  109. ot_tools/__init__.py +4 -0
  110. ot_tools/_convert/__init__.py +12 -0
  111. ot_tools/_convert/excel.py +279 -0
  112. ot_tools/_convert/pdf.py +254 -0
  113. ot_tools/_convert/powerpoint.py +268 -0
  114. ot_tools/_convert/utils.py +358 -0
  115. ot_tools/_convert/word.py +283 -0
  116. ot_tools/brave_search.py +604 -0
  117. ot_tools/code_search.py +736 -0
  118. ot_tools/context7.py +495 -0
  119. ot_tools/convert.py +614 -0
  120. ot_tools/db.py +415 -0
  121. ot_tools/diagram.py +1604 -0
  122. ot_tools/diagram.yaml +167 -0
  123. ot_tools/excel.py +1372 -0
  124. ot_tools/file.py +1348 -0
  125. ot_tools/firecrawl.py +732 -0
  126. ot_tools/grounding_search.py +646 -0
  127. ot_tools/package.py +604 -0
  128. ot_tools/py.typed +0 -0
  129. ot_tools/ripgrep.py +544 -0
  130. ot_tools/scaffold.py +471 -0
  131. ot_tools/transform.py +213 -0
  132. ot_tools/web_fetch.py +384 -0
bench/__init__.py ADDED
@@ -0,0 +1,5 @@
1
+ """OneTool benchmark harness CLI package.
2
+
3
+ Entry point for the `bench` command used for benchmarking
4
+ agent + MCP configurations.
5
+ """
bench/cli.py ADDED
@@ -0,0 +1,69 @@
1
+ """Bench CLI entry point for OneTool benchmark harness."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import typer
6
+
7
+ import ot
8
+ from ot._cli import create_cli, version_callback
9
+
10
+ app = create_cli(
11
+ "bench",
12
+ "OneTool benchmark harness for benchmarking agent + MCP configurations.",
13
+ no_args_is_help=True,
14
+ )
15
+
16
+
17
+ @app.callback()
18
+ def main(
19
+ _version: bool | None = typer.Option(
20
+ None,
21
+ "--version",
22
+ "-v",
23
+ callback=version_callback("bench", ot.__version__),
24
+ is_eager=True,
25
+ help="Show version and exit.",
26
+ ),
27
+ ) -> None:
28
+ """OneTool benchmark harness for benchmarking agent + MCP configurations.
29
+
30
+ Commands:
31
+ run - Run tasks (direct MCP calls or agent benchmarks)
32
+
33
+ Task types:
34
+ type: direct - Direct MCP tool invocation (no LLM)
35
+ type: harness - LLM benchmark with MCP servers (default)
36
+
37
+ External client testing:
38
+ Use `just client` to test with OpenCode or Claude Code.
39
+ """
40
+ import sys
41
+
42
+ # Allow --help without requiring global config
43
+ if any(arg in sys.argv for arg in ("--help", "-h")):
44
+ return
45
+
46
+ # Require global config directory (created by onetool)
47
+ from ot.paths import get_global_dir
48
+
49
+ global_dir = get_global_dir()
50
+ if not global_dir.exists():
51
+ print(
52
+ f"Error: {global_dir} not found.\n"
53
+ "Run 'onetool init' to initialize OneTool configuration.",
54
+ file=sys.stderr,
55
+ )
56
+ raise typer.Exit(1)
57
+
58
+
59
+ # Import subcommands to register them
60
+ from bench import run # noqa: E402, F401
61
+
62
+
63
+ def cli() -> None:
64
+ """Run the CLI application."""
65
+ app()
66
+
67
+
68
+ if __name__ == "__main__":
69
+ cli()
@@ -0,0 +1,66 @@
1
+ """Development harness for benchmarking OneTool.
2
+
3
+ This module provides utilities for running LLM prompts with MCP servers,
4
+ collecting metrics, and comparing results across different configurations.
5
+ """
6
+
7
+ from bench.harness.client import (
8
+ DEFAULT_TIMEOUT,
9
+ MCPConnection,
10
+ call_tool,
11
+ mcp_tools_to_openai,
12
+ multi_server_tools_to_openai,
13
+ )
14
+ from bench.harness.config import (
15
+ DefaultsConfig,
16
+ EvaluateConfig,
17
+ HarnessConfig,
18
+ ScenarioConfig,
19
+ ServerConfig,
20
+ TaskConfig,
21
+ load_config,
22
+ load_harness_config,
23
+ )
24
+ from bench.harness.csv_writer import write_results_csv
25
+ from bench.harness.evaluate import (
26
+ evaluate_deterministic,
27
+ evaluate_regex,
28
+ evaluate_task,
29
+ resolve_evaluator,
30
+ )
31
+ from bench.harness.metrics import (
32
+ EvaluationResult,
33
+ LLMCallMetrics,
34
+ ScenarioResult,
35
+ TaskResult,
36
+ calculate_cost,
37
+ )
38
+ from bench.harness.runner import AgenticRunner, split_prompts
39
+
40
+ __all__ = [
41
+ "DEFAULT_TIMEOUT",
42
+ "AgenticRunner",
43
+ "DefaultsConfig",
44
+ "EvaluateConfig",
45
+ "EvaluationResult",
46
+ "HarnessConfig",
47
+ "LLMCallMetrics",
48
+ "MCPConnection",
49
+ "ScenarioConfig",
50
+ "ScenarioResult",
51
+ "ServerConfig",
52
+ "TaskConfig",
53
+ "TaskResult",
54
+ "calculate_cost",
55
+ "call_tool",
56
+ "evaluate_deterministic",
57
+ "evaluate_regex",
58
+ "evaluate_task",
59
+ "load_config",
60
+ "load_harness_config",
61
+ "mcp_tools_to_openai",
62
+ "multi_server_tools_to_openai",
63
+ "resolve_evaluator",
64
+ "split_prompts",
65
+ "write_results_csv",
66
+ ]