meshagent-tools 0.25.1__tar.gz → 0.25.2__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 (33) hide show
  1. {meshagent_tools-0.25.1 → meshagent_tools-0.25.2}/CHANGELOG.md +7 -0
  2. {meshagent_tools-0.25.1/meshagent_tools.egg-info → meshagent_tools-0.25.2}/PKG-INFO +2 -2
  3. {meshagent_tools-0.25.1 → meshagent_tools-0.25.2}/meshagent/tools/tests/tool_decorator_test.py +25 -0
  4. {meshagent_tools-0.25.1 → meshagent_tools-0.25.2}/meshagent/tools/tool.py +35 -4
  5. meshagent_tools-0.25.2/meshagent/tools/version.py +1 -0
  6. {meshagent_tools-0.25.1 → meshagent_tools-0.25.2/meshagent_tools.egg-info}/PKG-INFO +2 -2
  7. {meshagent_tools-0.25.1 → meshagent_tools-0.25.2}/meshagent_tools.egg-info/requires.txt +1 -1
  8. {meshagent_tools-0.25.1 → meshagent_tools-0.25.2}/pyproject.toml +1 -1
  9. meshagent_tools-0.25.1/meshagent/tools/version.py +0 -1
  10. {meshagent_tools-0.25.1 → meshagent_tools-0.25.2}/LICENSE +0 -0
  11. {meshagent_tools-0.25.1 → meshagent_tools-0.25.2}/MANIFEST.in +0 -0
  12. {meshagent_tools-0.25.1 → meshagent_tools-0.25.2}/README.md +0 -0
  13. {meshagent_tools-0.25.1 → meshagent_tools-0.25.2}/meshagent/tools/__init__.py +0 -0
  14. {meshagent_tools-0.25.1 → meshagent_tools-0.25.2}/meshagent/tools/blob.py +0 -0
  15. {meshagent_tools-0.25.1 → meshagent_tools-0.25.2}/meshagent/tools/config.py +0 -0
  16. {meshagent_tools-0.25.1 → meshagent_tools-0.25.2}/meshagent/tools/container_shell.py +0 -0
  17. {meshagent_tools-0.25.1 → meshagent_tools-0.25.2}/meshagent/tools/database.py +0 -0
  18. {meshagent_tools-0.25.1 → meshagent_tools-0.25.2}/meshagent/tools/datetime.py +0 -0
  19. {meshagent_tools-0.25.1 → meshagent_tools-0.25.2}/meshagent/tools/discovery.py +0 -0
  20. {meshagent_tools-0.25.1 → meshagent_tools-0.25.2}/meshagent/tools/document_tools.py +0 -0
  21. {meshagent_tools-0.25.1 → meshagent_tools-0.25.2}/meshagent/tools/hosting.py +0 -0
  22. {meshagent_tools-0.25.1 → meshagent_tools-0.25.2}/meshagent/tools/multi_tool.py +0 -0
  23. {meshagent_tools-0.25.1 → meshagent_tools-0.25.2}/meshagent/tools/pydantic.py +0 -0
  24. {meshagent_tools-0.25.1 → meshagent_tools-0.25.2}/meshagent/tools/script.py +0 -0
  25. {meshagent_tools-0.25.1 → meshagent_tools-0.25.2}/meshagent/tools/storage.py +0 -0
  26. {meshagent_tools-0.25.1 → meshagent_tools-0.25.2}/meshagent/tools/strict_schema.py +0 -0
  27. {meshagent_tools-0.25.1 → meshagent_tools-0.25.2}/meshagent/tools/toolkit.py +0 -0
  28. {meshagent_tools-0.25.1 → meshagent_tools-0.25.2}/meshagent/tools/uuid.py +0 -0
  29. {meshagent_tools-0.25.1 → meshagent_tools-0.25.2}/meshagent/tools/web_toolkit.py +0 -0
  30. {meshagent_tools-0.25.1 → meshagent_tools-0.25.2}/meshagent_tools.egg-info/SOURCES.txt +0 -0
  31. {meshagent_tools-0.25.1 → meshagent_tools-0.25.2}/meshagent_tools.egg-info/dependency_links.txt +0 -0
  32. {meshagent_tools-0.25.1 → meshagent_tools-0.25.2}/meshagent_tools.egg-info/top_level.txt +0 -0
  33. {meshagent_tools-0.25.1 → meshagent_tools-0.25.2}/setup.cfg +0 -0
@@ -1,3 +1,10 @@
1
+ ## [0.25.2]
2
+ - BREAKING: Agent metadata field renamed from labels to annotations across Python agents and examples.
3
+ - Thread history now limits appended messages to a context window and exposes search/count/range tools for conversation history outside that window.
4
+ - Tool decorator now supports bound instance/class methods as tools.
5
+ - Anthropic adapters omit null/unset fields in serialized payloads and log tool call errors for easier diagnostics.
6
+ - Schema document grep now requires keyword arguments for options like ignore_case.
7
+
1
8
  ## [0.25.1]
2
9
  - Added Anthropic web search and web fetch toolkits, including beta header injection and request middleware support.
3
10
  - Added a container-based shell tool to run commands in persistent containers with configurable image, mounts, and environment.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meshagent-tools
3
- Version: 0.25.1
3
+ Version: 0.25.2
4
4
  Summary: Tools for Meshagent
5
5
  License-Expression: Apache-2.0
6
6
  Project-URL: Documentation, https://docs.meshagent.com
@@ -12,7 +12,7 @@ License-File: LICENSE
12
12
  Requires-Dist: pyjwt~=2.10
13
13
  Requires-Dist: pytest~=8.4
14
14
  Requires-Dist: pytest-asyncio~=0.26
15
- Requires-Dist: meshagent-api~=0.25.1
15
+ Requires-Dist: meshagent-api~=0.25.2
16
16
  Requires-Dist: html-to-markdown~=2.24.3
17
17
  Requires-Dist: aiohttp[speedups]~=3.13.0
18
18
  Requires-Dist: opentelemetry-distro~=0.54b1
@@ -36,6 +36,31 @@ async def test_decorated_tool_executes_with_toolkit():
36
36
  assert result.json == {"name": "alpha", "count": 2, "flag": True}
37
37
 
38
38
 
39
+ class Greeter:
40
+ def __init__(self, prefix: str) -> None:
41
+ self._prefix = prefix
42
+
43
+ @tool(name="greet")
44
+ def greet(self, *, name: str) -> str:
45
+ return f"{self._prefix}{name}"
46
+
47
+
48
+ @pytest.mark.asyncio
49
+ async def test_decorated_method_executes_with_toolkit():
50
+ greeter = Greeter("hello ")
51
+ toolkit = Toolkit(name="test", tools=[greeter.greet])
52
+ context = ToolContext(room=object(), caller=object())
53
+
54
+ result = await toolkit.execute(
55
+ context=context,
56
+ name="greet",
57
+ arguments={"name": "mesh"},
58
+ )
59
+
60
+ assert isinstance(result, JsonResponse)
61
+ assert result.json == "hello mesh"
62
+
63
+
39
64
  def test_decorator_schema_is_strict():
40
65
  schema = make_payload.input_schema
41
66
 
@@ -147,7 +147,16 @@ def tool(
147
147
  supports_context = False
148
148
  fields: dict[str, tuple[Any, Any]] = {}
149
149
 
150
- for param_name, param in signature.parameters.items():
150
+ parameters = list(signature.parameters.items())
151
+ bound_param_name = None
152
+ if parameters:
153
+ first_param_name, _first_param = parameters[0]
154
+ if first_param_name in ("self", "cls"):
155
+ bound_param_name = first_param_name
156
+
157
+ for param_name, param in parameters:
158
+ if bound_param_name == param_name:
159
+ continue
151
160
  annotation = hints.get(param_name, Any)
152
161
  if annotation is ToolContext:
153
162
  supports_context = True
@@ -167,7 +176,7 @@ def tool(
167
176
  )
168
177
 
169
178
  class FunctionTool(Tool):
170
- def __init__(self):
179
+ def __init__(self, bound_instance: Optional[object] = None):
171
180
  super().__init__(
172
181
  name=tool_name,
173
182
  title=tool_title,
@@ -178,6 +187,20 @@ def tool(
178
187
  supports_context=supports_context,
179
188
  )
180
189
  self.strict = True
190
+ self._bound_instance = bound_instance
191
+
192
+ def __get__(self, instance, owner):
193
+ if instance is None:
194
+ if bound_param_name == "cls" and owner is not None:
195
+ if self._bound_instance is owner:
196
+ return self
197
+ return FunctionTool(bound_instance=owner)
198
+ return self
199
+
200
+ if self._bound_instance is instance:
201
+ return self
202
+
203
+ return FunctionTool(bound_instance=instance)
181
204
 
182
205
  async def invoke(
183
206
  self,
@@ -188,10 +211,18 @@ def tool(
188
211
  data = InputModel.model_validate(arguments)
189
212
  parsed_args = {field: getattr(data, field) for field in fields}
190
213
 
214
+ bound_instance = self._bound_instance
215
+
191
216
  if supports_context:
192
- result = fn(context, **parsed_args)
217
+ if bound_instance is not None:
218
+ result = fn(bound_instance, context, **parsed_args)
219
+ else:
220
+ result = fn(context, **parsed_args)
193
221
  else:
194
- result = fn(**parsed_args)
222
+ if bound_instance is not None:
223
+ result = fn(bound_instance, **parsed_args)
224
+ else:
225
+ result = fn(**parsed_args)
195
226
 
196
227
  if inspect.isawaitable(result):
197
228
  result = await result
@@ -0,0 +1 @@
1
+ __version__ = "0.25.2"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meshagent-tools
3
- Version: 0.25.1
3
+ Version: 0.25.2
4
4
  Summary: Tools for Meshagent
5
5
  License-Expression: Apache-2.0
6
6
  Project-URL: Documentation, https://docs.meshagent.com
@@ -12,7 +12,7 @@ License-File: LICENSE
12
12
  Requires-Dist: pyjwt~=2.10
13
13
  Requires-Dist: pytest~=8.4
14
14
  Requires-Dist: pytest-asyncio~=0.26
15
- Requires-Dist: meshagent-api~=0.25.1
15
+ Requires-Dist: meshagent-api~=0.25.2
16
16
  Requires-Dist: html-to-markdown~=2.24.3
17
17
  Requires-Dist: aiohttp[speedups]~=3.13.0
18
18
  Requires-Dist: opentelemetry-distro~=0.54b1
@@ -1,7 +1,7 @@
1
1
  pyjwt~=2.10
2
2
  pytest~=8.4
3
3
  pytest-asyncio~=0.26
4
- meshagent-api~=0.25.1
4
+ meshagent-api~=0.25.2
5
5
  html-to-markdown~=2.24.3
6
6
  aiohttp[speedups]~=3.13.0
7
7
  opentelemetry-distro~=0.54b1
@@ -12,7 +12,7 @@ dependencies = [
12
12
  "pyjwt~=2.10",
13
13
  "pytest~=8.4",
14
14
  "pytest-asyncio~=0.26",
15
- "meshagent-api~=0.25.1",
15
+ "meshagent-api~=0.25.2",
16
16
  "html-to-markdown~=2.24.3",
17
17
  "aiohttp[speedups]~=3.13.0",
18
18
  "opentelemetry-distro~=0.54b1"
@@ -1 +0,0 @@
1
- __version__ = "0.25.1"