matimo-core 0.1.2__tar.gz → 0.2.0__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 (112) hide show
  1. {matimo_core-0.1.2 → matimo_core-0.2.0}/.gitignore +3 -1
  2. matimo_core-0.2.0/LICENSE +21 -0
  3. {matimo_core-0.1.2 → matimo_core-0.2.0}/PKG-INFO +47 -28
  4. {matimo_core-0.1.2 → matimo_core-0.2.0}/README.md +34 -20
  5. {matimo_core-0.1.2 → matimo_core-0.2.0}/pyproject.toml +11 -8
  6. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/__init__.py +56 -6
  7. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/approval/handler.py +74 -17
  8. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/auth/injection.py +34 -27
  9. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/auth/oauth2_handler.py +3 -3
  10. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/core/loader.py +3 -2
  11. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/core/models.py +6 -0
  12. matimo_core-0.2.0/src/matimo/core/response_size_guardrail.py +150 -0
  13. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/core/skill_content_parser.py +28 -9
  14. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/core/skill_loader.py +1 -1
  15. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/core/skill_registry.py +6 -5
  16. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/decorators/__init__.py +3 -1
  17. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/errors.py +22 -3
  18. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/executors/function_executor.py +50 -7
  19. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/executors/http_executor.py +65 -15
  20. matimo_core-0.2.0/src/matimo/instance.py +1172 -0
  21. matimo_core-0.2.0/src/matimo/integrations/_async_bridge.py +65 -0
  22. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/integrations/_pydantic_utils.py +50 -20
  23. matimo_core-0.2.0/src/matimo/integrations/agno.py +407 -0
  24. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/integrations/crewai.py +106 -6
  25. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/integrations/langchain.py +17 -4
  26. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/logging/__init__.py +8 -7
  27. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/mcp/README.md +61 -66
  28. matimo_core-0.2.0/src/matimo/mcp/approval_elicitation.py +90 -0
  29. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/mcp/secrets/__init__.py +4 -4
  30. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/mcp/server.py +227 -63
  31. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/mcp/tool_converter.py +96 -8
  32. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/policy/approval_manifest.py +13 -0
  33. matimo_core-0.2.0/src/matimo/policy/audit_sink.py +179 -0
  34. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/policy/content_validator.py +41 -22
  35. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/policy/default_policy.py +92 -16
  36. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/policy/policy_loader.py +7 -2
  37. matimo_core-0.2.0/src/matimo/policy/risk_classifier.py +101 -0
  38. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/policy/types.py +48 -1
  39. matimo_core-0.2.0/src/matimo/skills/meta-tools-lifecycle/SKILL.md +306 -0
  40. matimo_core-0.2.0/src/matimo/skills/policy-validation/SKILL.md +233 -0
  41. matimo_core-0.2.0/src/matimo/skills/skill-creator/SKILL.md +439 -0
  42. matimo_core-0.2.0/src/matimo/skills/skills-catalog/SKILL.md +191 -0
  43. matimo_core-0.2.0/src/matimo/skills/tool-creation/SKILL.md +303 -0
  44. matimo_core-0.2.0/src/matimo/skills/tool-discovery/SKILL.md +176 -0
  45. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/tools/calculator/definition.yaml +1 -0
  46. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/tools/convert_to_file/definition.yaml +1 -0
  47. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/tools/edit/definition.yaml +1 -0
  48. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/tools/execute/definition.yaml +3 -0
  49. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/tools/extract_from_file/definition.yaml +1 -0
  50. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/tools/matimo_approve_tool/definition.yaml +2 -1
  51. matimo_core-0.2.0/src/matimo/tools/matimo_approve_tool/matimo_approve_tool.py +131 -0
  52. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/tools/matimo_create_skill/definition.yaml +1 -0
  53. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/tools/matimo_create_skill/matimo_create_skill.py +24 -2
  54. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/tools/matimo_create_tool/definition.yaml +1 -0
  55. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/tools/matimo_create_tool/matimo_create_tool.py +19 -5
  56. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/tools/matimo_get_skill/definition.yaml +1 -0
  57. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/tools/matimo_get_skill/matimo_get_skill.py +4 -3
  58. matimo_core-0.2.0/src/matimo/tools/matimo_get_skill_content/definition.yaml +57 -0
  59. matimo_core-0.2.0/src/matimo/tools/matimo_get_skill_content/matimo_get_skill_content.py +63 -0
  60. matimo_core-0.2.0/src/matimo/tools/matimo_get_skill_sections/definition.yaml +37 -0
  61. matimo_core-0.2.0/src/matimo/tools/matimo_get_skill_sections/matimo_get_skill_sections.py +48 -0
  62. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/tools/matimo_get_tool/definition.yaml +1 -0
  63. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/tools/matimo_get_tool/matimo_get_tool.py +11 -0
  64. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/tools/matimo_get_tool_status/definition.yaml +1 -0
  65. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/tools/matimo_get_tool_status/matimo_get_tool_status.py +29 -3
  66. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/tools/matimo_list_skills/definition.yaml +1 -0
  67. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/tools/matimo_list_skills/matimo_list_skills.py +13 -12
  68. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/tools/matimo_list_user_tools/definition.yaml +1 -0
  69. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/tools/matimo_list_user_tools/matimo_list_user_tools.py +2 -1
  70. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/tools/matimo_reload_tools/definition.yaml +1 -0
  71. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/tools/matimo_reload_tools/matimo_reload_tools.py +2 -1
  72. matimo_core-0.2.0/src/matimo/tools/matimo_search_skills/definition.yaml +46 -0
  73. matimo_core-0.2.0/src/matimo/tools/matimo_search_skills/matimo_search_skills.py +53 -0
  74. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/tools/matimo_search_tools/definition.yaml +1 -0
  75. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/tools/matimo_search_tools/matimo_search_tools.py +2 -1
  76. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/tools/matimo_validate_skill/definition.yaml +1 -0
  77. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/tools/matimo_validate_tool/definition.yaml +1 -0
  78. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/tools/matimo_validate_tool/matimo_validate_tool.py +15 -3
  79. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/tools/read/definition.yaml +1 -0
  80. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/tools/search/definition.yaml +3 -0
  81. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/tools/web/definition.yaml +1 -0
  82. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/tools/web_scraper/definition.yaml +1 -0
  83. matimo_core-0.1.2/src/matimo/instance.py +0 -623
  84. matimo_core-0.1.2/src/matimo/policy/risk_classifier.py +0 -47
  85. matimo_core-0.1.2/src/matimo/tools/matimo_approve_tool/matimo_approve_tool.py +0 -61
  86. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/approval/__init__.py +0 -0
  87. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/auth/__init__.py +0 -0
  88. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/auth/oauth2_config.py +0 -0
  89. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/auth/oauth2_provider_loader.py +0 -0
  90. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/core/__init__.py +0 -0
  91. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/core/registry.py +0 -0
  92. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/core/tfidf_embedding.py +0 -0
  93. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/encodings/__init__.py +0 -0
  94. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/encodings/parameter_encoding.py +0 -0
  95. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/executors/__init__.py +0 -0
  96. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/executors/command_executor.py +0 -0
  97. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/integrations/__init__.py +0 -0
  98. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/mcp/__init__.py +0 -0
  99. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/mcp/secrets/types.py +0 -0
  100. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/policy/__init__.py +0 -0
  101. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/policy/integrity_tracker.py +0 -0
  102. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/sync.py +0 -0
  103. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/tools/calculator/calculator.py +0 -0
  104. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/tools/convert_to_file/convert_to_file.py +0 -0
  105. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/tools/edit/edit.py +0 -0
  106. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/tools/execute/execute.py +0 -0
  107. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/tools/extract_from_file/extract_from_file.py +0 -0
  108. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/tools/matimo_validate_skill/matimo_validate_skill.py +0 -0
  109. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/tools/read/read.py +0 -0
  110. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/tools/search/search.py +0 -0
  111. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/tools/web/web.py +0 -0
  112. {matimo_core-0.1.2 → matimo_core-0.2.0}/src/matimo/tools/web_scraper/web_scraper.py +0 -0
@@ -58,7 +58,6 @@ temp/
58
58
 
59
59
  # Personal scratch notes / working docs — not part of the shipped repo
60
60
  .local-notes/
61
- typescript/examples/mcp/matimo-tools/.matimo-approvals.json
62
61
  typescript/examples/mcp/matimo-tools/fetch-weather/definition.yaml
63
62
  typescript/examples/mcp/matimo-tools/npm_downloads/definition.yaml
64
63
  typescript/examples/mcp/matimo-tools/skills/ecosystem-health/SKILL.md
@@ -68,3 +67,6 @@ typescript/packages/cli/.matimo/certs/server.crt
68
67
  typescript/packages/cli/.matimo/certs/server.key
69
68
  typescript/examples/mcp/.matimo/certs/server.crt
70
69
  typescript/examples/mcp/.matimo/certs/server.key
70
+
71
+ # HITL approval manifests are per-machine state (HMAC-signed approvals); never commit one
72
+ **/.matimo-approvals.json
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ROAIQ TECHNOLOGIES PRIVATE LIMITED
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,13 +1,14 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: matimo-core
3
- Version: 0.1.2
3
+ Version: 0.2.0
4
4
  Summary: Matimo core — framework-agnostic SDK: pre-built providers, skills layer, MCP, and a policy engine you control
5
5
  Project-URL: Homepage, https://matimo.dev
6
- Project-URL: Documentation, https://matimo.dev/docs
6
+ Project-URL: Documentation, https://docs.matimo.dev/
7
7
  Project-URL: Repository, https://github.com/tallclub/matimo
8
8
  Project-URL: Issues, https://github.com/tallclub/matimo/issues
9
9
  License: MIT
10
- Keywords: agents,ai,crewai,langchain,matimo,mcp,tools
10
+ License-File: LICENSE
11
+ Keywords: agentic-ai,agents,agno,ai,ai-governance,crewai,langchain,matimo,mcp,mcp-server,policy-engine,tools
11
12
  Classifier: Development Status :: 4 - Beta
12
13
  Classifier: Intended Audience :: Developers
13
14
  Classifier: License :: OSI Approved :: MIT License
@@ -24,29 +25,33 @@ Requires-Dist: lxml-html-clean>=0.4.5
24
25
  Requires-Dist: markdownify>=1.2.3
25
26
  Requires-Dist: mistune>=3.0
26
27
  Requires-Dist: pydantic>=2.0
27
- Requires-Dist: pypdf>=4.0
28
+ Requires-Dist: pypdf>=6.15.0
28
29
  Requires-Dist: python-docx>=1.1
29
30
  Requires-Dist: pyyaml>=6.0
30
31
  Requires-Dist: readability-lxml>=0.8.4.1
31
32
  Requires-Dist: reportlab>=4.0
32
33
  Requires-Dist: simpleeval>=1.0
33
34
  Requires-Dist: typing-extensions>=4.9
35
+ Provides-Extra: agno
36
+ Requires-Dist: agno>=3.0; extra == 'agno'
34
37
  Provides-Extra: all
38
+ Requires-Dist: agno>=3.0; extra == 'all'
35
39
  Requires-Dist: crewai>=0.80; extra == 'all'
36
40
  Requires-Dist: hvac>=2.0; extra == 'all'
37
41
  Requires-Dist: langchain-core>=0.3; extra == 'all'
38
- Requires-Dist: mcp>=1.0; extra == 'all'
42
+ Requires-Dist: mcp>=1.28.1; extra == 'all'
39
43
  Requires-Dist: python-dotenv>=1.0; extra == 'all'
40
44
  Provides-Extra: aws
41
45
  Requires-Dist: boto3>=1.34; extra == 'aws'
42
46
  Provides-Extra: crewai
43
47
  Requires-Dist: crewai>=0.80; extra == 'crewai'
44
48
  Provides-Extra: dev
49
+ Requires-Dist: agno>=3.0; extra == 'dev'
45
50
  Requires-Dist: boto3>=1.34; extra == 'dev'
46
51
  Requires-Dist: crewai>=0.80; extra == 'dev'
47
52
  Requires-Dist: hvac>=2.0; extra == 'dev'
48
53
  Requires-Dist: langchain-core>=0.3; extra == 'dev'
49
- Requires-Dist: mcp>=1.0; extra == 'dev'
54
+ Requires-Dist: mcp>=1.28.1; extra == 'dev'
50
55
  Requires-Dist: mypy>=1.10; extra == 'dev'
51
56
  Requires-Dist: pytest-asyncio>=0.24; extra == 'dev'
52
57
  Requires-Dist: pytest-cov>=5.0; extra == 'dev'
@@ -60,22 +65,22 @@ Requires-Dist: python-dotenv>=1.0; extra == 'dotenv'
60
65
  Provides-Extra: langchain
61
66
  Requires-Dist: langchain-core>=0.3; extra == 'langchain'
62
67
  Provides-Extra: mcp
63
- Requires-Dist: mcp>=1.0; extra == 'mcp'
68
+ Requires-Dist: mcp>=1.28.1; extra == 'mcp'
64
69
  Provides-Extra: vault
65
70
  Requires-Dist: hvac>=2.0; extra == 'vault'
66
71
  Description-Content-Type: text/markdown
67
72
 
68
73
  # matimo-core
69
74
 
70
- > Matimo core — framework-agnostic SDK with pre-built providers, skills layer, MCP, and a policy engine you control.
75
+ > Matimo core - framework-agnostic SDK with pre-built providers, skills layer, MCP, and a policy engine you control.
71
76
 
72
77
  [![PyPI](https://img.shields.io/pypi/v/matimo-core)](https://pypi.org/project/matimo-core/)
73
78
  [![Python](https://img.shields.io/pypi/pyversions/matimo-core)](https://pypi.org/project/matimo-core/)
74
- [![Docs](https://img.shields.io/badge/docs-matimo.dev-blue)](https://matimo.dev/docs)
75
- [![Tests](https://img.shields.io/badge/tests-658%20passing-brightgreen)](https://github.com/tallclub/matimo)
79
+ [![Docs](https://img.shields.io/badge/docs-matimo.dev-blue)](https://docs.matimo.dev)
80
+ [![Tests](https://img.shields.io/badge/tests-1134%20passing-brightgreen)](https://github.com/tallclub/matimo)
76
81
  [![Coverage](https://img.shields.io/badge/coverage-97%25-brightgreen)](https://github.com/tallclub/matimo)
77
82
 
78
- Write tools once in YAML, use them everywhere — with LangChain, CrewAI, MCP, and more.
83
+ Write tools once in YAML, use them everywhere - with LangChain, CrewAI, MCP, and more.
79
84
 
80
85
  > **Note:** Most users should install [`matimo`](https://pypi.org/project/matimo/) (the convenience wrapper) instead of `matimo-core` directly.
81
86
 
@@ -188,18 +193,18 @@ await server.start()
188
193
  ### `Matimo.init()`
189
194
 
190
195
  ```python
191
- from matimo import Matimo, InitOptions
196
+ from matimo import InitOptions, JsonlFileSink, Matimo
192
197
 
193
198
  matimo = await Matimo.init(
194
199
  tool_paths=['./tools', './agent-tools'], # or a single string
195
200
  auto_discover=False, # discover installed matimo-* packages
196
- include_core=True, # include built-in meta-tools
197
201
  policy_file='./policy.yaml',
198
202
  untrusted_paths=['./agent-tools'],
199
203
  skill_paths=['./skills'],
200
204
  log_level='info', # silent | error | warn | info | debug
201
205
  log_format='json', # json | simple
202
206
  on_event=my_event_handler,
207
+ audit_sink=JsonlFileSink('./logs/matimo-audit.jsonl'), # hash-chained audit log
203
208
  on_hitl=my_approval_callback,
204
209
  )
205
210
  ```
@@ -243,14 +248,23 @@ execution:
243
248
  ## Policy Engine
244
249
 
245
250
  ```python
246
- from matimo import Matimo, InitOptions
251
+ from matimo import ApprovalRequest, JsonlFileSink, Matimo
247
252
 
248
- matimo = await Matimo.init('./tools', InitOptions(
253
+
254
+ async def ask_operator(request: ApprovalRequest) -> bool:
255
+ return input(f"Approve {request.tool_name} {request.params}? (y/n) ") == "y"
256
+
257
+
258
+ matimo = await Matimo.init(
259
+ './tools',
249
260
  policy_file='./policy.yaml',
250
- on_hitl=lambda req: {'approved': True, 'reason': 'auto'},
251
- ))
261
+ on_approval=ask_operator, # calls that need approval ask here
262
+ audit_sink=JsonlFileSink('./matimo-audit.jsonl'), # hash-chained audit log
263
+ )
252
264
  ```
253
265
 
266
+ Calls that need approval: tools with `requires_approval: true`, HTTP `DELETE` and command tools (the 0.2.0 secure default), and calls whose `sql`/`command` argument contains a destructive keyword. With no `on_approval` they are refused.
267
+
254
268
  `policy.yaml`:
255
269
  ```yaml
256
270
  allowedDomains:
@@ -271,7 +285,7 @@ from matimo.mcp.secrets import create_resolver_chain
271
285
  resolver = create_resolver_chain([
272
286
  {'type': 'env'},
273
287
  {'type': 'dotenv', 'path': '.env'},
274
- {'type': 'vault', 'address': 'http://vault:8200'},
288
+ {'type': 'vault', 'addr': 'http://vault:8200'},
275
289
  {'type': 'aws', 'region': 'us-east-1'},
276
290
  ])
277
291
  token = await resolver.resolve('SLACK_BOT_TOKEN')
@@ -287,7 +301,7 @@ from matimo.logging import get_global_matimo_logger
287
301
 
288
302
  matimo = await Matimo.init('./tools', log_level='info', log_format='json')
289
303
  logger = get_global_matimo_logger()
290
- logger.info('Tool executed', {'tool': 'slack_send_channel_message'})
304
+ logger.info('Tool executed', tool='slack_send_channel_message')
291
305
  ```
292
306
 
293
307
  ---
@@ -303,30 +317,35 @@ Built-in tools that let agents manage other tools at runtime:
303
317
  | `matimo_approve_tool` | Promote draft → approved | Yes |
304
318
  | `matimo_reload_tools` | Hot-reload registry | Yes |
305
319
  | `matimo_list_user_tools` | List agent-created tools | No |
320
+ | `matimo_get_tool` | Retrieve a tool's full definition | No |
306
321
  | `matimo_get_tool_status` | Check approval state | Yes |
322
+ | `matimo_search_tools` | Search the loaded tool registry by keyword | No |
307
323
  | `matimo_create_skill` | Create a SKILL.md | Yes |
308
324
  | `matimo_list_skills` | List available skills | No |
309
325
  | `matimo_get_skill` | Read skill content | No |
310
326
  | `matimo_validate_skill` | Validate skill spec | No |
327
+ | `matimo_search_skills` | Semantically rank skills by relevance (TF-IDF) | No |
328
+ | `matimo_get_skill_sections` | Inventory a skill's sections and token costs | No |
329
+ | `matimo_get_skill_content` | Load only specific sections of a skill | No |
311
330
 
312
331
  ---
313
332
 
314
333
  ## Documentation
315
334
 
316
- - [Getting Started](https://matimo.dev/docs/getting-started/QUICK_START)
317
- - [Full API Reference](https://matimo.dev/docs/api-reference/SDK)
318
- - [LangChain Integration](https://matimo.dev/docs/framework-integrations/LANGCHAIN)
319
- - [CrewAI Integration](https://matimo.dev/docs/framework-integrations/CREWAI)
320
- - [MCP Guide](https://matimo.dev/docs/MCP)
321
- - [Policy & Lifecycle](https://matimo.dev/docs/api-reference/POLICY_AND_LIFECYCLE)
322
- - [Meta-Tools Reference](https://matimo.dev/docs/api-reference/META_TOOLS)
335
+ - [Getting Started](https://docs.matimo.dev/getting-started/QUICK_START)
336
+ - [Full API Reference](https://docs.matimo.dev/api-reference/SDK)
337
+ - [LangChain Integration](https://docs.matimo.dev/framework-integrations/LANGCHAIN)
338
+ - [CrewAI Integration](https://docs.matimo.dev/framework-integrations/CREWAI)
339
+ - [MCP Guide](https://docs.matimo.dev/MCP)
340
+ - [Policy & Lifecycle](https://docs.matimo.dev/api-reference/POLICY_AND_LIFECYCLE)
341
+ - [Meta-Tools Reference](https://docs.matimo.dev/api-reference/META_TOOLS)
323
342
 
324
343
  ---
325
344
 
326
345
  ## Links
327
346
 
328
347
  - **PyPI:** https://pypi.org/project/matimo-core/
329
- - **Docs:** https://matimo.dev/docs
348
+ - **Docs:** https://docs.matimo.dev/
330
349
  - **GitHub:** https://github.com/tallclub/matimo
331
350
  - **Changelog:** https://github.com/tallclub/matimo/blob/main/docs/RELEASES.md
332
351
 
@@ -1,14 +1,14 @@
1
1
  # matimo-core
2
2
 
3
- > Matimo core — framework-agnostic SDK with pre-built providers, skills layer, MCP, and a policy engine you control.
3
+ > Matimo core - framework-agnostic SDK with pre-built providers, skills layer, MCP, and a policy engine you control.
4
4
 
5
5
  [![PyPI](https://img.shields.io/pypi/v/matimo-core)](https://pypi.org/project/matimo-core/)
6
6
  [![Python](https://img.shields.io/pypi/pyversions/matimo-core)](https://pypi.org/project/matimo-core/)
7
- [![Docs](https://img.shields.io/badge/docs-matimo.dev-blue)](https://matimo.dev/docs)
8
- [![Tests](https://img.shields.io/badge/tests-658%20passing-brightgreen)](https://github.com/tallclub/matimo)
7
+ [![Docs](https://img.shields.io/badge/docs-matimo.dev-blue)](https://docs.matimo.dev)
8
+ [![Tests](https://img.shields.io/badge/tests-1134%20passing-brightgreen)](https://github.com/tallclub/matimo)
9
9
  [![Coverage](https://img.shields.io/badge/coverage-97%25-brightgreen)](https://github.com/tallclub/matimo)
10
10
 
11
- Write tools once in YAML, use them everywhere — with LangChain, CrewAI, MCP, and more.
11
+ Write tools once in YAML, use them everywhere - with LangChain, CrewAI, MCP, and more.
12
12
 
13
13
  > **Note:** Most users should install [`matimo`](https://pypi.org/project/matimo/) (the convenience wrapper) instead of `matimo-core` directly.
14
14
 
@@ -121,18 +121,18 @@ await server.start()
121
121
  ### `Matimo.init()`
122
122
 
123
123
  ```python
124
- from matimo import Matimo, InitOptions
124
+ from matimo import InitOptions, JsonlFileSink, Matimo
125
125
 
126
126
  matimo = await Matimo.init(
127
127
  tool_paths=['./tools', './agent-tools'], # or a single string
128
128
  auto_discover=False, # discover installed matimo-* packages
129
- include_core=True, # include built-in meta-tools
130
129
  policy_file='./policy.yaml',
131
130
  untrusted_paths=['./agent-tools'],
132
131
  skill_paths=['./skills'],
133
132
  log_level='info', # silent | error | warn | info | debug
134
133
  log_format='json', # json | simple
135
134
  on_event=my_event_handler,
135
+ audit_sink=JsonlFileSink('./logs/matimo-audit.jsonl'), # hash-chained audit log
136
136
  on_hitl=my_approval_callback,
137
137
  )
138
138
  ```
@@ -176,14 +176,23 @@ execution:
176
176
  ## Policy Engine
177
177
 
178
178
  ```python
179
- from matimo import Matimo, InitOptions
179
+ from matimo import ApprovalRequest, JsonlFileSink, Matimo
180
180
 
181
- matimo = await Matimo.init('./tools', InitOptions(
181
+
182
+ async def ask_operator(request: ApprovalRequest) -> bool:
183
+ return input(f"Approve {request.tool_name} {request.params}? (y/n) ") == "y"
184
+
185
+
186
+ matimo = await Matimo.init(
187
+ './tools',
182
188
  policy_file='./policy.yaml',
183
- on_hitl=lambda req: {'approved': True, 'reason': 'auto'},
184
- ))
189
+ on_approval=ask_operator, # calls that need approval ask here
190
+ audit_sink=JsonlFileSink('./matimo-audit.jsonl'), # hash-chained audit log
191
+ )
185
192
  ```
186
193
 
194
+ Calls that need approval: tools with `requires_approval: true`, HTTP `DELETE` and command tools (the 0.2.0 secure default), and calls whose `sql`/`command` argument contains a destructive keyword. With no `on_approval` they are refused.
195
+
187
196
  `policy.yaml`:
188
197
  ```yaml
189
198
  allowedDomains:
@@ -204,7 +213,7 @@ from matimo.mcp.secrets import create_resolver_chain
204
213
  resolver = create_resolver_chain([
205
214
  {'type': 'env'},
206
215
  {'type': 'dotenv', 'path': '.env'},
207
- {'type': 'vault', 'address': 'http://vault:8200'},
216
+ {'type': 'vault', 'addr': 'http://vault:8200'},
208
217
  {'type': 'aws', 'region': 'us-east-1'},
209
218
  ])
210
219
  token = await resolver.resolve('SLACK_BOT_TOKEN')
@@ -220,7 +229,7 @@ from matimo.logging import get_global_matimo_logger
220
229
 
221
230
  matimo = await Matimo.init('./tools', log_level='info', log_format='json')
222
231
  logger = get_global_matimo_logger()
223
- logger.info('Tool executed', {'tool': 'slack_send_channel_message'})
232
+ logger.info('Tool executed', tool='slack_send_channel_message')
224
233
  ```
225
234
 
226
235
  ---
@@ -236,30 +245,35 @@ Built-in tools that let agents manage other tools at runtime:
236
245
  | `matimo_approve_tool` | Promote draft → approved | Yes |
237
246
  | `matimo_reload_tools` | Hot-reload registry | Yes |
238
247
  | `matimo_list_user_tools` | List agent-created tools | No |
248
+ | `matimo_get_tool` | Retrieve a tool's full definition | No |
239
249
  | `matimo_get_tool_status` | Check approval state | Yes |
250
+ | `matimo_search_tools` | Search the loaded tool registry by keyword | No |
240
251
  | `matimo_create_skill` | Create a SKILL.md | Yes |
241
252
  | `matimo_list_skills` | List available skills | No |
242
253
  | `matimo_get_skill` | Read skill content | No |
243
254
  | `matimo_validate_skill` | Validate skill spec | No |
255
+ | `matimo_search_skills` | Semantically rank skills by relevance (TF-IDF) | No |
256
+ | `matimo_get_skill_sections` | Inventory a skill's sections and token costs | No |
257
+ | `matimo_get_skill_content` | Load only specific sections of a skill | No |
244
258
 
245
259
  ---
246
260
 
247
261
  ## Documentation
248
262
 
249
- - [Getting Started](https://matimo.dev/docs/getting-started/QUICK_START)
250
- - [Full API Reference](https://matimo.dev/docs/api-reference/SDK)
251
- - [LangChain Integration](https://matimo.dev/docs/framework-integrations/LANGCHAIN)
252
- - [CrewAI Integration](https://matimo.dev/docs/framework-integrations/CREWAI)
253
- - [MCP Guide](https://matimo.dev/docs/MCP)
254
- - [Policy & Lifecycle](https://matimo.dev/docs/api-reference/POLICY_AND_LIFECYCLE)
255
- - [Meta-Tools Reference](https://matimo.dev/docs/api-reference/META_TOOLS)
263
+ - [Getting Started](https://docs.matimo.dev/getting-started/QUICK_START)
264
+ - [Full API Reference](https://docs.matimo.dev/api-reference/SDK)
265
+ - [LangChain Integration](https://docs.matimo.dev/framework-integrations/LANGCHAIN)
266
+ - [CrewAI Integration](https://docs.matimo.dev/framework-integrations/CREWAI)
267
+ - [MCP Guide](https://docs.matimo.dev/MCP)
268
+ - [Policy & Lifecycle](https://docs.matimo.dev/api-reference/POLICY_AND_LIFECYCLE)
269
+ - [Meta-Tools Reference](https://docs.matimo.dev/api-reference/META_TOOLS)
256
270
 
257
271
  ---
258
272
 
259
273
  ## Links
260
274
 
261
275
  - **PyPI:** https://pypi.org/project/matimo-core/
262
- - **Docs:** https://matimo.dev/docs
276
+ - **Docs:** https://docs.matimo.dev/
263
277
  - **GitHub:** https://github.com/tallclub/matimo
264
278
  - **Changelog:** https://github.com/tallclub/matimo/blob/main/docs/RELEASES.md
265
279
 
@@ -4,12 +4,12 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "matimo-core"
7
- version = "0.1.2"
7
+ version = "0.2.0"
8
8
  description = "Matimo core — framework-agnostic SDK: pre-built providers, skills layer, MCP, and a policy engine you control"
9
9
  readme = "README.md"
10
10
  license = { text = "MIT" }
11
11
  requires-python = ">=3.11"
12
- keywords = ["ai", "tools", "agents", "langchain", "crewai", "mcp", "matimo"]
12
+ keywords = ["ai", "tools", "agents", "langchain", "crewai", "agno", "mcp", "matimo", "mcp-server", "agentic-ai", "ai-governance", "policy-engine"]
13
13
  classifiers = [
14
14
  "Development Status :: 4 - Beta",
15
15
  "Intended Audience :: Developers",
@@ -27,7 +27,7 @@ dependencies = [
27
27
  "pyyaml>=6.0",
28
28
  "anyio>=4.0",
29
29
  "typing-extensions>=4.9",
30
- "pypdf>=4.0",
30
+ "pypdf>=6.15.0",
31
31
  "python-docx>=1.1",
32
32
  "mistune>=3.0",
33
33
  "reportlab>=4.0",
@@ -40,14 +40,16 @@ dependencies = [
40
40
  [project.optional-dependencies]
41
41
  langchain = ["langchain-core>=0.3"]
42
42
  crewai = ["crewai>=0.80"]
43
- mcp = ["mcp>=1.0"]
43
+ agno = ["agno>=3.0"]
44
+ mcp = ["mcp>=1.28.1"]
44
45
  vault = ["hvac>=2.0"]
45
46
  aws = ["boto3>=1.34"]
46
47
  dotenv = ["python-dotenv>=1.0"]
47
48
  all = [
48
49
  "langchain-core>=0.3",
49
50
  "crewai>=0.80",
50
- "mcp>=1.0",
51
+ "agno>=3.0",
52
+ "mcp>=1.28.1",
51
53
  "hvac>=2.0",
52
54
  "python-dotenv>=1.0",
53
55
  ]
@@ -61,7 +63,8 @@ dev = [
61
63
  "types-pyyaml>=6.0",
62
64
  "langchain-core>=0.3",
63
65
  "crewai>=0.80",
64
- "mcp>=1.0",
66
+ "agno>=3.0",
67
+ "mcp>=1.28.1",
65
68
  "hvac>=2.0",
66
69
  "boto3>=1.34",
67
70
  "python-dotenv>=1.0",
@@ -69,7 +72,7 @@ dev = [
69
72
 
70
73
  [project.urls]
71
74
  Homepage = "https://matimo.dev"
72
- Documentation = "https://matimo.dev/docs"
75
+ Documentation = "https://docs.matimo.dev/"
73
76
  Repository = "https://github.com/tallclub/matimo"
74
77
  Issues = "https://github.com/tallclub/matimo/issues"
75
78
 
@@ -80,7 +83,7 @@ core = "matimo:get_core_tools_path"
80
83
  packages = ["src/matimo"]
81
84
 
82
85
  [tool.hatch.build.targets.sdist]
83
- include = ["src/", "README.md", "../../../LICENSE"]
86
+ include = ["src/", "README.md", "LICENSE"]
84
87
 
85
88
  [tool.pytest.ini_options]
86
89
  testpaths = ["tests"]
@@ -34,6 +34,7 @@ from matimo.approval.handler import (
34
34
  ApprovalCallback,
35
35
  ApprovalHandler,
36
36
  ApprovalRequest,
37
+ definition_requires_approval,
37
38
  get_global_approval_handler,
38
39
  set_global_approval_handler,
39
40
  )
@@ -122,7 +123,7 @@ from matimo.errors import (
122
123
 
123
124
  # Executors
124
125
  from matimo.executors.command_executor import CommandExecutor
125
- from matimo.executors.function_executor import FunctionExecutor
126
+ from matimo.executors.function_executor import FunctionExecutor, FunctionToolContext
126
127
  from matimo.executors.http_executor import HttpExecutor
127
128
 
128
129
  # Main entry point + sync API
@@ -150,12 +151,26 @@ from matimo.mcp.tool_converter import convert_parameters_to_mcp_schema
150
151
 
151
152
  # Policy
152
153
  from matimo.policy.approval_manifest import ApprovalManifest, ApprovalRecord
154
+ from matimo.policy.audit_sink import (
155
+ AUDIT_GENESIS_HASH,
156
+ AuditLogVerification,
157
+ AuditSink,
158
+ JsonlFileSink,
159
+ hash_audit_entry,
160
+ redact_secrets,
161
+ verify_audit_log,
162
+ )
153
163
  from matimo.policy.content_validator import ContentViolation, validate_tool_content
154
164
  from matimo.policy.default_policy import DefaultPolicyEngine, PolicyEngine, get_tier_for_tool
155
165
  from matimo.policy.integrity_tracker import IntegrityAction, ToolIntegrityTracker
156
166
  from matimo.policy.policy_loader import load_policy_from_file
157
- from matimo.policy.risk_classifier import classify_risk
167
+ from matimo.policy.risk_classifier import (
168
+ classify_execution_risk,
169
+ classify_risk,
170
+ meets_risk_threshold,
171
+ )
158
172
  from matimo.policy.types import (
173
+ GovernanceMode,
159
174
  HITLCallback,
160
175
  HITLRequest,
161
176
  MatimoEvent,
@@ -170,7 +185,7 @@ from matimo.policy.types import (
170
185
  )
171
186
  from matimo.sync import MatimoSync
172
187
 
173
- __version__ = "0.1.0"
188
+ __version__ = "0.2.0"
174
189
 
175
190
 
176
191
  def get_core_tools_path() -> str:
@@ -231,6 +246,36 @@ def convert_tools_to_crewai(
231
246
  return _inner(tools, matimo_instance, credentials)
232
247
 
233
248
 
249
+ def convert_tools_to_agno(
250
+ tools: list[Any],
251
+ matimo_instance: Matimo,
252
+ credentials: dict[str, str] | None = None,
253
+ **kwargs: Any, # noqa: ANN401
254
+ ) -> list[Any]:
255
+ """Convert Matimo tools to Agno Function list. Requires agno.
256
+
257
+ Extra keyword arguments (context, confirm_risk_levels) are forwarded to
258
+ matimo.integrations.agno.convert_tools_to_agno.
259
+ """
260
+ from matimo.integrations.agno import convert_tools_to_agno as _inner
261
+ return _inner(tools, matimo_instance, credentials, **kwargs)
262
+
263
+
264
+ def MatimoTools( # noqa: N802
265
+ matimo_instance: Matimo,
266
+ tools: list[Any] | None = None,
267
+ **kwargs: Any, # noqa: ANN401
268
+ ) -> Any: # noqa: ANN401
269
+ """Build an Agno Toolkit exposing governed Matimo tools. Requires agno.
270
+
271
+ Named in CapWords to match Agno's <Name>Tools toolkit convention. Returns Any
272
+ because Toolkit comes from an optional dependency (agno). Extra keyword
273
+ arguments are forwarded to matimo.integrations.agno.MatimoTools.
274
+ """
275
+ from matimo.integrations.agno import MatimoTools as _inner
276
+ return _inner(matimo_instance, tools, **kwargs)
277
+
278
+
234
279
  # ---------------------------------------------------------------------------
235
280
  # Decorators
236
281
  # ---------------------------------------------------------------------------
@@ -272,7 +317,7 @@ __all__ = [
272
317
  "ParsedSkillContent", "SemanticSearchResult",
273
318
  "TfIdfEmbeddingProvider", "EmbeddingProvider", "cosine_similarity",
274
319
  # Executors
275
- "HttpExecutor", "CommandExecutor", "FunctionExecutor",
320
+ "HttpExecutor", "CommandExecutor", "FunctionExecutor", "FunctionToolContext",
276
321
  # Auth
277
322
  "inject_auth_parameters", "extract_parameter_placeholders",
278
323
  "OAuth2Handler", "OAuth2ProviderLoader",
@@ -280,17 +325,20 @@ __all__ = [
280
325
  # Approval
281
326
  "ApprovalHandler", "ApprovalRequest", "ApprovalCallback",
282
327
  "get_global_approval_handler", "set_global_approval_handler",
328
+ "definition_requires_approval",
283
329
  # Encodings
284
330
  "apply_parameter_encodings",
285
331
  # Policy
286
332
  "PolicyEngine", "DefaultPolicyEngine", "PolicyConfig",
287
333
  "PolicyDecision", "PolicyAllowed", "PolicyDenied", "PolicyPendingApproval",
288
334
  "RiskLevel", "PolicyTier",
289
- "MatimoEvent", "MatimoEventHandler", "HITLCallback", "HITLRequest",
335
+ "MatimoEvent", "MatimoEventHandler", "GovernanceMode", "HITLCallback", "HITLRequest",
290
336
  "ContentViolation", "validate_tool_content",
291
- "classify_risk", "get_tier_for_tool",
337
+ "classify_risk", "classify_execution_risk", "meets_risk_threshold", "get_tier_for_tool",
292
338
  "ToolIntegrityTracker", "IntegrityAction",
293
339
  "ApprovalManifest", "ApprovalRecord",
340
+ "AuditSink", "JsonlFileSink", "AuditLogVerification", "verify_audit_log",
341
+ "redact_secrets", "hash_audit_entry", "AUDIT_GENESIS_HASH",
294
342
  "load_policy_from_file",
295
343
  # MCP
296
344
  "MCPServer", "MCPServerOptions", "create_mcp_server",
@@ -303,6 +351,8 @@ __all__ = [
303
351
  "get_skills_metadata",
304
352
  "build_relevant_skill_prompt",
305
353
  "convert_tools_to_crewai",
354
+ "convert_tools_to_agno",
355
+ "MatimoTools",
306
356
  # Decorators
307
357
  "tool", "set_global_matimo_instance", "get_global_matimo_instance",
308
358
  # Logging