onetool-mcp 1.0.0b1__py3-none-any.whl → 1.0.0rc2__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 (81) hide show
  1. onetool/cli.py +63 -4
  2. onetool_mcp-1.0.0rc2.dist-info/METADATA +266 -0
  3. onetool_mcp-1.0.0rc2.dist-info/RECORD +129 -0
  4. {onetool_mcp-1.0.0b1.dist-info → onetool_mcp-1.0.0rc2.dist-info}/licenses/LICENSE.txt +1 -1
  5. {onetool_mcp-1.0.0b1.dist-info → onetool_mcp-1.0.0rc2.dist-info}/licenses/NOTICE.txt +54 -64
  6. ot/__main__.py +6 -6
  7. ot/config/__init__.py +48 -46
  8. ot/config/global_templates/__init__.py +2 -2
  9. ot/config/{defaults → global_templates}/diagram-templates/api-flow.mmd +33 -33
  10. ot/config/{defaults → global_templates}/diagram-templates/c4-context.puml +30 -30
  11. ot/config/{defaults → global_templates}/diagram-templates/class-diagram.mmd +87 -87
  12. ot/config/{defaults → global_templates}/diagram-templates/feature-mindmap.mmd +70 -70
  13. ot/config/{defaults → global_templates}/diagram-templates/microservices.d2 +81 -81
  14. ot/config/{defaults → global_templates}/diagram-templates/project-gantt.mmd +37 -37
  15. ot/config/{defaults → global_templates}/diagram-templates/state-machine.mmd +42 -42
  16. ot/config/global_templates/diagram.yaml +167 -0
  17. ot/config/global_templates/onetool.yaml +3 -1
  18. ot/config/{defaults → global_templates}/prompts.yaml +102 -97
  19. ot/config/global_templates/security.yaml +31 -0
  20. ot/config/global_templates/servers.yaml +93 -12
  21. ot/config/global_templates/snippets.yaml +5 -26
  22. ot/config/{defaults → global_templates}/tool_templates/__init__.py +7 -7
  23. ot/config/loader.py +221 -105
  24. ot/config/mcp.py +5 -1
  25. ot/config/secrets.py +192 -190
  26. ot/decorators.py +116 -116
  27. ot/executor/__init__.py +35 -35
  28. ot/executor/base.py +16 -16
  29. ot/executor/fence_processor.py +83 -83
  30. ot/executor/linter.py +142 -142
  31. ot/executor/pep723.py +288 -288
  32. ot/executor/runner.py +20 -6
  33. ot/executor/simple.py +163 -163
  34. ot/executor/validator.py +603 -164
  35. ot/http_client.py +145 -145
  36. ot/logging/__init__.py +37 -37
  37. ot/logging/entry.py +213 -213
  38. ot/logging/format.py +191 -188
  39. ot/logging/span.py +349 -349
  40. ot/meta.py +236 -14
  41. ot/paths.py +32 -49
  42. ot/prompts.py +218 -218
  43. ot/proxy/manager.py +14 -2
  44. ot/registry/__init__.py +189 -189
  45. ot/registry/parser.py +269 -269
  46. ot/server.py +330 -315
  47. ot/shortcuts/__init__.py +15 -15
  48. ot/shortcuts/aliases.py +87 -87
  49. ot/shortcuts/snippets.py +258 -258
  50. ot/stats/__init__.py +35 -35
  51. ot/stats/html.py +2 -2
  52. ot/stats/reader.py +354 -354
  53. ot/stats/timing.py +57 -57
  54. ot/support.py +63 -63
  55. ot/tools.py +1 -1
  56. ot/utils/batch.py +161 -161
  57. ot/utils/cache.py +120 -120
  58. ot/utils/exceptions.py +23 -23
  59. ot/utils/factory.py +178 -179
  60. ot/utils/format.py +65 -65
  61. ot/utils/http.py +202 -202
  62. ot/utils/platform.py +45 -45
  63. ot/utils/truncate.py +69 -69
  64. ot_tools/__init__.py +4 -4
  65. ot_tools/_convert/__init__.py +12 -12
  66. ot_tools/_convert/pdf.py +254 -254
  67. ot_tools/diagram.yaml +167 -167
  68. ot_tools/scaffold.py +2 -2
  69. ot_tools/transform.py +124 -19
  70. ot_tools/web_fetch.py +94 -43
  71. onetool_mcp-1.0.0b1.dist-info/METADATA +0 -163
  72. onetool_mcp-1.0.0b1.dist-info/RECORD +0 -132
  73. ot/config/defaults/bench.yaml +0 -4
  74. ot/config/defaults/onetool.yaml +0 -25
  75. ot/config/defaults/servers.yaml +0 -7
  76. ot/config/defaults/snippets.yaml +0 -4
  77. ot_tools/firecrawl.py +0 -732
  78. {onetool_mcp-1.0.0b1.dist-info → onetool_mcp-1.0.0rc2.dist-info}/WHEEL +0 -0
  79. {onetool_mcp-1.0.0b1.dist-info → onetool_mcp-1.0.0rc2.dist-info}/entry_points.txt +0 -0
  80. /ot/config/{defaults → global_templates}/tool_templates/extension.py +0 -0
  81. /ot/config/{defaults → global_templates}/tool_templates/isolated.py +0 -0
ot/utils/truncate.py CHANGED
@@ -1,69 +1,69 @@
1
- """Text truncation and error formatting utilities."""
2
-
3
- from __future__ import annotations
4
-
5
- import subprocess
6
- from typing import Any
7
-
8
- __all__ = ["format_error", "run_command", "truncate"]
9
-
10
-
11
- def truncate(text: str, max_length: int = 4000, indicator: str = "...") -> str:
12
- """Truncate text to a maximum length with an indicator.
13
-
14
- Args:
15
- text: Text to truncate
16
- max_length: Maximum length including indicator
17
- indicator: String to append when truncated (default: "...")
18
-
19
- Returns:
20
- Truncated text with indicator, or original if within limit
21
- """
22
- if len(text) <= max_length:
23
- return text
24
- return text[: max_length - len(indicator)] + indicator
25
-
26
-
27
- def format_error(message: str, details: dict[str, Any] | None = None) -> str:
28
- """Format an error message consistently.
29
-
30
- Args:
31
- message: Main error message
32
- details: Optional additional details
33
-
34
- Returns:
35
- Formatted error string
36
- """
37
- if details:
38
- detail_str = ", ".join(f"{k}={v}" for k, v in details.items())
39
- return f"Error: {message} ({detail_str})"
40
- return f"Error: {message}"
41
-
42
-
43
- def run_command(
44
- args: list[str],
45
- *,
46
- timeout: float = 30.0,
47
- cwd: str | None = None,
48
- ) -> tuple[int, str, str]:
49
- """Run a subprocess command with timeout.
50
-
51
- Args:
52
- args: Command and arguments
53
- timeout: Timeout in seconds (default: 30)
54
- cwd: Working directory
55
-
56
- Returns:
57
- Tuple of (return_code, stdout, stderr)
58
-
59
- Raises:
60
- subprocess.TimeoutExpired: If command times out
61
- """
62
- result = subprocess.run(
63
- args,
64
- timeout=timeout,
65
- cwd=cwd,
66
- capture_output=True,
67
- text=True,
68
- )
69
- return result.returncode, result.stdout, result.stderr
1
+ """Text truncation and error formatting utilities."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import subprocess
6
+ from typing import Any
7
+
8
+ __all__ = ["format_error", "run_command", "truncate"]
9
+
10
+
11
+ def truncate(text: str, max_length: int = 4000, indicator: str = "...") -> str:
12
+ """Truncate text to a maximum length with an indicator.
13
+
14
+ Args:
15
+ text: Text to truncate
16
+ max_length: Maximum length including indicator
17
+ indicator: String to append when truncated (default: "...")
18
+
19
+ Returns:
20
+ Truncated text with indicator, or original if within limit
21
+ """
22
+ if len(text) <= max_length:
23
+ return text
24
+ return text[: max_length - len(indicator)] + indicator
25
+
26
+
27
+ def format_error(message: str, details: dict[str, Any] | None = None) -> str:
28
+ """Format an error message consistently.
29
+
30
+ Args:
31
+ message: Main error message
32
+ details: Optional additional details
33
+
34
+ Returns:
35
+ Formatted error string
36
+ """
37
+ if details:
38
+ detail_str = ", ".join(f"{k}={v}" for k, v in details.items())
39
+ return f"Error: {message} ({detail_str})"
40
+ return f"Error: {message}"
41
+
42
+
43
+ def run_command(
44
+ args: list[str],
45
+ *,
46
+ timeout: float = 30.0,
47
+ cwd: str | None = None,
48
+ ) -> tuple[int, str, str]:
49
+ """Run a subprocess command with timeout.
50
+
51
+ Args:
52
+ args: Command and arguments
53
+ timeout: Timeout in seconds (default: 30)
54
+ cwd: Working directory
55
+
56
+ Returns:
57
+ Tuple of (return_code, stdout, stderr)
58
+
59
+ Raises:
60
+ subprocess.TimeoutExpired: If command times out
61
+ """
62
+ result = subprocess.run(
63
+ args,
64
+ timeout=timeout,
65
+ cwd=cwd,
66
+ capture_output=True,
67
+ text=True,
68
+ )
69
+ return result.returncode, result.stdout, result.stderr
ot_tools/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
- """OneTool built-in tools.
2
-
3
- Tools are auto-discovered from Python files in this directory.
4
- """
1
+ """OneTool built-in tools.
2
+
3
+ Tools are auto-discovered from Python files in this directory.
4
+ """
@@ -1,12 +1,12 @@
1
- """Document conversion utilities for OneTool.
2
-
3
- Provides PDF, Word, PowerPoint, and Excel to Markdown conversion
4
- with LLM-optimised output including YAML frontmatter and TOC.
5
- """
6
-
7
- from ot_tools._convert.excel import convert_excel
8
- from ot_tools._convert.pdf import convert_pdf
9
- from ot_tools._convert.powerpoint import convert_powerpoint
10
- from ot_tools._convert.word import convert_word
11
-
12
- __all__ = ["convert_excel", "convert_pdf", "convert_powerpoint", "convert_word"]
1
+ """Document conversion utilities for OneTool.
2
+
3
+ Provides PDF, Word, PowerPoint, and Excel to Markdown conversion
4
+ with LLM-optimised output including YAML frontmatter and TOC.
5
+ """
6
+
7
+ from ot_tools._convert.excel import convert_excel
8
+ from ot_tools._convert.pdf import convert_pdf
9
+ from ot_tools._convert.powerpoint import convert_powerpoint
10
+ from ot_tools._convert.word import convert_word
11
+
12
+ __all__ = ["convert_excel", "convert_pdf", "convert_powerpoint", "convert_word"]