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
@@ -0,0 +1,235 @@
1
+ # OneTool Default Snippets Library
2
+ # Load via: include: [snippets.yaml] (falls back to bundled)
3
+
4
+ snippets:
5
+
6
+ # ============================================================================
7
+ # BRAVE SEARCH (brv_)
8
+ # ============================================================================
9
+
10
+ brv:
11
+ description: Batch search using Brave (pipe-separated queries)
12
+ params:
13
+ q: { description: "Pipe-separated search queries" }
14
+ count: { default: 10, description: "Results per query" }
15
+ body: |
16
+ brave.search_batch(queries=[{% for item in q.split('|') %}"{{ item.strip() }}"{% if not loop.last %}, {% endif %}{% endfor %}], count={{ count }})
17
+
18
+
19
+ brv_research:
20
+ description: Search web and extract structured findings
21
+ params:
22
+ q: { description: "Topic to research" }
23
+ count: { default: 10, description: "Number of sources" }
24
+ body: |
25
+ results = brave.search(query="{{ q }}", count={{ count }})
26
+ llm.transform(input=results, prompt="Extract key findings as bullet points with sources")
27
+
28
+
29
+
30
+ # ============================================================================
31
+ # CONTEXT7 DOCS (c7_)
32
+ # ============================================================================
33
+
34
+ c7:
35
+ description: Fetch library documentation for a topic
36
+ params:
37
+ q: { default: "", description: "Topic to search for (e.g., 'hooks', 'routing')" }
38
+ lib: { description: "Library name or key (e.g., 'react', 'next.js', 'vercel/next.js')" }
39
+ body: |
40
+ context7.doc(library_key="{{ lib }}", topic="{{ q }}", mode="info")
41
+
42
+ c7_lib:
43
+ description: Search for a library to get its key
44
+ params:
45
+ q: { description: "Library name to search for (e.g., 'react', 'fastapi')" }
46
+ body: |
47
+ context7.search(query="{{ q }}")
48
+
49
+ c7_eg:
50
+ description: Fetch code examples from library docs
51
+ params:
52
+ lib: { description: "Library key in org/repo format (e.g., 'facebook/react')" }
53
+ q: { description: "Feature/API to get examples for" }
54
+ body: |
55
+ context7.doc(library_key="{{ lib }}", topic="{{ q }}", mode="code")
56
+
57
+ # ============================================================================
58
+ # GROUND SEARCH (g_)
59
+ # ============================================================================
60
+ g:
61
+ description: Batch search using Gemini grounding (pipe-separated queries)
62
+ params:
63
+ q: { description: "Pipe-separated search queries" }
64
+ tech: { default: "", description: "Technology stack context" }
65
+ focus: { default: "general", description: "Focus mode: general, code, documentation, troubleshooting" }
66
+ body: |
67
+ ground.search_batch(queries=[{% for item in q.split('|') %}"{{ item.strip() }}"{% if not loop.last %}, {% endif %}{% endfor %}], context="{{ tech }}", focus="{{ focus }}")
68
+
69
+ g_reddit:
70
+ description: Find community discussions on a topic
71
+ params:
72
+ q: { description: "Topic to discuss" }
73
+ subreddit: { default: "", description: "Specific subreddit" }
74
+ body: |
75
+ ground.reddit(query="{{ q }}"{% if subreddit %}, subreddit="{{ subreddit }}"{% endif %})
76
+
77
+ # ============================================================================
78
+ # RIPGREP (rg_)
79
+ # ============================================================================
80
+
81
+ rg:
82
+ description: Search files with ripgrep
83
+ params:
84
+ p: { description: "Regex pattern to search for" }
85
+ path: { default: ".", description: "Search path" }
86
+ glob: { default: "", description: "File glob filter (e.g., '*.py', '*.{ts,tsx}')" }
87
+ ft: { default: "", description: "File type filter (py, ts, js, etc.)" }
88
+ ctx: { default: 0, description: "Lines of context before/after match" }
89
+ count: { default: "", description: "Max matching lines to return" }
90
+ body: |
91
+ ripgrep.search(pattern="{{ p }}", path="{{ path }}"{% if glob %}, glob="{{ glob }}"{% endif %}{% if ft %}, file_type="{{ ft }}"{% endif %}{% if ctx %}, context={{ ctx }}{% endif %}{% if count %}, max_results={{ count }}{% endif %})
92
+
93
+ rg_count:
94
+ description: Count pattern occurrences by file
95
+ params:
96
+ p: { description: "Pattern to count" }
97
+ ft: { default: "", description: "File type filter (py, ts, etc.)" }
98
+ body: |
99
+ {% if ft %}ripgrep.count(pattern="{{ p }}", file_type="{{ ft }}"){% else %}ripgrep.count(pattern="{{ p }}"){% endif %}
100
+
101
+ # ============================================================================
102
+ # PACKAGE (pkg_)
103
+ # ============================================================================
104
+
105
+ pkg:
106
+ description: Audit project dependencies against latest registry versions
107
+ params:
108
+ path: { default: ".", description: "Project directory path" }
109
+ body: |
110
+ package.audit(path="{{ path }}")
111
+
112
+ pkg_npm:
113
+ description: Check latest npm package versions
114
+ params:
115
+ packages: { description: "Comma-separated package names" }
116
+ body: |
117
+ package.npm(packages=[{% for pkg in packages.split(',') %}"{{ pkg.strip() }}"{% if not loop.last %}, {% endif %}{% endfor %}])
118
+
119
+ pkg_pypi:
120
+ description: Check latest PyPI package versions
121
+ params:
122
+ packages: { description: "Comma-separated package names" }
123
+ body: |
124
+ package.pypi(packages=[{% for pkg in packages.split(',') %}"{{ pkg.strip() }}"{% if not loop.last %}, {% endif %}{% endfor %}])
125
+
126
+ pkg_model:
127
+ description: Search OpenRouter for AI models
128
+ params:
129
+ q: { default: "", description: "Search term (claude, gpt-4)" }
130
+ provider: { default: "", description: "Filter by provider" }
131
+ body: |
132
+ package.models(query="{{ q }}", provider="{{ provider }}", limit=10)
133
+
134
+ # ============================================================================
135
+ # WEB FETCH (web_)
136
+ # ============================================================================
137
+ web:
138
+ description: Fetch multiple URLs concurrently
139
+ params:
140
+ u: { description: "Pipe-separated URLs to fetch" }
141
+ f: { default: "markdown", description: "Output format: text, markdown, json" }
142
+ links: { default: false, description: "Include hyperlinks" }
143
+ max: { default: "", description: "Max length per URL" }
144
+ body: |
145
+ web.fetch_batch(urls=[{% for url in u.split('|') %}"{{ url.strip() }}"{% if not loop.last %}, {% endif %}{% endfor %}], output_format="{{ f }}", include_links={{ links }}{% if max %}, max_length={{ max }}{% endif %})
146
+
147
+ web_data:
148
+ description: Extract structured data from a web page
149
+ params:
150
+ u: { description: "URL to fetch" }
151
+ schema: { description: "What to extract (e.g., 'prices as {item, price}')" }
152
+ body: |
153
+ content = web.fetch(url="{{ u }}", include_tables=True)
154
+ llm.transform(input=content, prompt="Extract {{ schema }} as YAML")
155
+
156
+ web_summary:
157
+ description: Fetch and summarize a web page
158
+ params:
159
+ u: { description: "URL to fetch" }
160
+ focus: { default: "", description: "What to focus on" }
161
+ body: |
162
+ content = web.fetch(url="{{ u }}", output_format="markdown", fast=True)
163
+ llm.transform(input=content, prompt="Summarize this page concisely{% if focus %}, focusing on {{ focus }}{% endif %}")
164
+ # ============================================================================
165
+ # FIRECRAWL (f_)
166
+ # ============================================================================
167
+
168
+ f:
169
+ description: Batch search using Firecrawl (pipe-separated queries)
170
+ params:
171
+ q: { description: "Pipe-separated search queries" }
172
+ count: { default: 10, description: "Results per query" }
173
+ body: |
174
+ results = {}
175
+ for query in [{% for item in q.split('|') %}"{{ item.strip() }}"{% if not loop.last %}, {% endif %}{% endfor %}]:
176
+ results[query] = firecrawl.search(query=query, limit={{ count }})
177
+ results
178
+
179
+ f_fetch:
180
+ description: Fetch a page using Firecrawl scrape
181
+ params:
182
+ u: { required: true, description: "URL to fetch" }
183
+ body: |
184
+ firecrawl.scrape(url="{{ u }}")
185
+
186
+ # ============================================================================
187
+ # GITHUB (gh_)
188
+ # ============================================================================
189
+
190
+ gh:
191
+ description: Search GitHub repositories and return URLs/info for multiple pages
192
+ params:
193
+ q: { description: "GitHub search query" }
194
+ count: { default: 1, description: "Number of pages to fetch (30 results per page)" }
195
+ body: |
196
+ import json
197
+ results = []
198
+ for page in range(1, {{ count }} + 1):
199
+ r = github.search_repositories(query="{{ q }}", page=page, perPage=30)
200
+ data = json.loads(r) if isinstance(r, str) else r
201
+ for repo in data.get("items", []):
202
+ results.append({
203
+ "name": repo["full_name"],
204
+ "url": repo["html_url"],
205
+ "description": repo.get("description") or "",
206
+ "stars": repo.get("stargazers_count", 0),
207
+ "updated": repo.get("updated_at", "")[:10]
208
+ })
209
+ {"total": len(results), "repos": results}
210
+
211
+
212
+ # ============================================================================
213
+ # INTERNAL TOOLS (ot_)
214
+ # ============================================================================
215
+ ot_reload:
216
+ description: Reload OneTool configuration and tools
217
+ body: |
218
+ ot.reload()
219
+
220
+
221
+ ot_status:
222
+ description: Show system health and configuration
223
+ params: {}
224
+ body: |
225
+ {"health": ot.health(), "config": ot.config()}
226
+
227
+ ot_notify:
228
+ description: Notify external processes of LLM progress
229
+ params:
230
+ topic: { default: "status", description: "Status updates" }
231
+ msg:
232
+ required: true
233
+ description: "Status message"
234
+ body: |
235
+ ot.notify(topic="status:{{ topic }}", message="{{ msg }}")