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.
- bench/__init__.py +5 -0
- bench/cli.py +69 -0
- bench/harness/__init__.py +66 -0
- bench/harness/client.py +692 -0
- bench/harness/config.py +397 -0
- bench/harness/csv_writer.py +109 -0
- bench/harness/evaluate.py +512 -0
- bench/harness/metrics.py +283 -0
- bench/harness/runner.py +899 -0
- bench/py.typed +0 -0
- bench/reporter.py +629 -0
- bench/run.py +487 -0
- bench/secrets.py +101 -0
- bench/utils.py +16 -0
- onetool/__init__.py +4 -0
- onetool/cli.py +391 -0
- onetool/py.typed +0 -0
- onetool_mcp-1.0.0b1.dist-info/METADATA +163 -0
- onetool_mcp-1.0.0b1.dist-info/RECORD +132 -0
- onetool_mcp-1.0.0b1.dist-info/WHEEL +4 -0
- onetool_mcp-1.0.0b1.dist-info/entry_points.txt +3 -0
- onetool_mcp-1.0.0b1.dist-info/licenses/LICENSE.txt +687 -0
- onetool_mcp-1.0.0b1.dist-info/licenses/NOTICE.txt +64 -0
- ot/__init__.py +37 -0
- ot/__main__.py +6 -0
- ot/_cli.py +107 -0
- ot/_tui.py +53 -0
- ot/config/__init__.py +46 -0
- ot/config/defaults/bench.yaml +4 -0
- ot/config/defaults/diagram-templates/api-flow.mmd +33 -0
- ot/config/defaults/diagram-templates/c4-context.puml +30 -0
- ot/config/defaults/diagram-templates/class-diagram.mmd +87 -0
- ot/config/defaults/diagram-templates/feature-mindmap.mmd +70 -0
- ot/config/defaults/diagram-templates/microservices.d2 +81 -0
- ot/config/defaults/diagram-templates/project-gantt.mmd +37 -0
- ot/config/defaults/diagram-templates/state-machine.mmd +42 -0
- ot/config/defaults/onetool.yaml +25 -0
- ot/config/defaults/prompts.yaml +97 -0
- ot/config/defaults/servers.yaml +7 -0
- ot/config/defaults/snippets.yaml +4 -0
- ot/config/defaults/tool_templates/__init__.py +7 -0
- ot/config/defaults/tool_templates/extension.py +52 -0
- ot/config/defaults/tool_templates/isolated.py +61 -0
- ot/config/dynamic.py +121 -0
- ot/config/global_templates/__init__.py +2 -0
- ot/config/global_templates/bench-secrets-template.yaml +6 -0
- ot/config/global_templates/bench.yaml +9 -0
- ot/config/global_templates/onetool.yaml +27 -0
- ot/config/global_templates/secrets-template.yaml +44 -0
- ot/config/global_templates/servers.yaml +18 -0
- ot/config/global_templates/snippets.yaml +235 -0
- ot/config/loader.py +1087 -0
- ot/config/mcp.py +145 -0
- ot/config/secrets.py +190 -0
- ot/config/tool_config.py +125 -0
- ot/decorators.py +116 -0
- ot/executor/__init__.py +35 -0
- ot/executor/base.py +16 -0
- ot/executor/fence_processor.py +83 -0
- ot/executor/linter.py +142 -0
- ot/executor/pack_proxy.py +260 -0
- ot/executor/param_resolver.py +140 -0
- ot/executor/pep723.py +288 -0
- ot/executor/result_store.py +369 -0
- ot/executor/runner.py +496 -0
- ot/executor/simple.py +163 -0
- ot/executor/tool_loader.py +396 -0
- ot/executor/validator.py +398 -0
- ot/executor/worker_pool.py +388 -0
- ot/executor/worker_proxy.py +189 -0
- ot/http_client.py +145 -0
- ot/logging/__init__.py +37 -0
- ot/logging/config.py +315 -0
- ot/logging/entry.py +213 -0
- ot/logging/format.py +188 -0
- ot/logging/span.py +349 -0
- ot/meta.py +1555 -0
- ot/paths.py +453 -0
- ot/prompts.py +218 -0
- ot/proxy/__init__.py +21 -0
- ot/proxy/manager.py +396 -0
- ot/py.typed +0 -0
- ot/registry/__init__.py +189 -0
- ot/registry/models.py +57 -0
- ot/registry/parser.py +269 -0
- ot/registry/registry.py +413 -0
- ot/server.py +315 -0
- ot/shortcuts/__init__.py +15 -0
- ot/shortcuts/aliases.py +87 -0
- ot/shortcuts/snippets.py +258 -0
- ot/stats/__init__.py +35 -0
- ot/stats/html.py +250 -0
- ot/stats/jsonl_writer.py +283 -0
- ot/stats/reader.py +354 -0
- ot/stats/timing.py +57 -0
- ot/support.py +63 -0
- ot/tools.py +114 -0
- ot/utils/__init__.py +81 -0
- ot/utils/batch.py +161 -0
- ot/utils/cache.py +120 -0
- ot/utils/deps.py +403 -0
- ot/utils/exceptions.py +23 -0
- ot/utils/factory.py +179 -0
- ot/utils/format.py +65 -0
- ot/utils/http.py +202 -0
- ot/utils/platform.py +45 -0
- ot/utils/sanitize.py +130 -0
- ot/utils/truncate.py +69 -0
- ot_tools/__init__.py +4 -0
- ot_tools/_convert/__init__.py +12 -0
- ot_tools/_convert/excel.py +279 -0
- ot_tools/_convert/pdf.py +254 -0
- ot_tools/_convert/powerpoint.py +268 -0
- ot_tools/_convert/utils.py +358 -0
- ot_tools/_convert/word.py +283 -0
- ot_tools/brave_search.py +604 -0
- ot_tools/code_search.py +736 -0
- ot_tools/context7.py +495 -0
- ot_tools/convert.py +614 -0
- ot_tools/db.py +415 -0
- ot_tools/diagram.py +1604 -0
- ot_tools/diagram.yaml +167 -0
- ot_tools/excel.py +1372 -0
- ot_tools/file.py +1348 -0
- ot_tools/firecrawl.py +732 -0
- ot_tools/grounding_search.py +646 -0
- ot_tools/package.py +604 -0
- ot_tools/py.typed +0 -0
- ot_tools/ripgrep.py +544 -0
- ot_tools/scaffold.py +471 -0
- ot_tools/transform.py +213 -0
- ot_tools/web_fetch.py +384 -0
bench/__init__.py
ADDED
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
|
+
]
|