matimo 0.1.0-alpha.3 → 0.1.0-alpha.4

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 (158) hide show
  1. package/README.md +124 -598
  2. package/package.json +23 -23
  3. package/packages/cli/bin/matimo.cjs +26 -0
  4. package/packages/cli/dist/cli.d.ts +6 -0
  5. package/packages/cli/dist/cli.d.ts.map +1 -0
  6. package/packages/cli/dist/cli.js +95 -0
  7. package/packages/cli/dist/cli.js.map +1 -0
  8. package/packages/cli/dist/commands/install.d.ts +6 -0
  9. package/packages/cli/dist/commands/install.d.ts.map +1 -0
  10. package/packages/cli/dist/commands/install.js +48 -0
  11. package/packages/cli/dist/commands/install.js.map +1 -0
  12. package/packages/cli/dist/commands/list.d.ts +9 -0
  13. package/packages/cli/dist/commands/list.d.ts.map +1 -0
  14. package/packages/cli/dist/commands/list.js +70 -0
  15. package/packages/cli/dist/commands/list.js.map +1 -0
  16. package/packages/cli/dist/commands/search.d.ts +2 -0
  17. package/packages/cli/dist/commands/search.d.ts.map +1 -0
  18. package/packages/cli/dist/commands/search.js +148 -0
  19. package/packages/cli/dist/commands/search.js.map +1 -0
  20. package/packages/core/dist/src/auth/oauth2-config.d.ts.map +1 -0
  21. package/packages/core/dist/src/auth/oauth2-config.js.map +1 -0
  22. package/packages/core/dist/src/auth/oauth2-handler.d.ts.map +1 -0
  23. package/packages/core/dist/src/auth/oauth2-handler.js.map +1 -0
  24. package/packages/core/dist/src/auth/oauth2-provider-loader.d.ts.map +1 -0
  25. package/packages/core/dist/src/auth/oauth2-provider-loader.js.map +1 -0
  26. package/{dist → packages/core/dist/src}/core/schema.d.ts +11 -1
  27. package/packages/core/dist/src/core/schema.d.ts.map +1 -0
  28. package/{dist → packages/core/dist/src}/core/schema.js +12 -3
  29. package/packages/core/dist/src/core/schema.js.map +1 -0
  30. package/{dist → packages/core/dist/src}/core/tool-loader.d.ts +16 -0
  31. package/packages/core/dist/src/core/tool-loader.d.ts.map +1 -0
  32. package/{dist → packages/core/dist/src}/core/tool-loader.js +97 -1
  33. package/packages/core/dist/src/core/tool-loader.js.map +1 -0
  34. package/packages/core/dist/src/core/tool-registry.d.ts.map +1 -0
  35. package/packages/core/dist/src/core/tool-registry.js.map +1 -0
  36. package/{dist → packages/core/dist/src}/core/types.d.ts +15 -1
  37. package/packages/core/dist/src/core/types.d.ts.map +1 -0
  38. package/{dist → packages/core/dist/src}/core/types.js.map +1 -1
  39. package/packages/core/dist/src/decorators/index.d.ts.map +1 -0
  40. package/packages/core/dist/src/decorators/index.js.map +1 -0
  41. package/packages/core/dist/src/decorators/tool-decorator.d.ts.map +1 -0
  42. package/packages/core/dist/src/decorators/tool-decorator.js.map +1 -0
  43. package/packages/core/dist/src/encodings/parameter-encoding.d.ts.map +1 -0
  44. package/packages/core/dist/src/encodings/parameter-encoding.js.map +1 -0
  45. package/packages/core/dist/src/errors/matimo-error.d.ts.map +1 -0
  46. package/packages/core/dist/src/errors/matimo-error.js.map +1 -0
  47. package/packages/core/dist/src/executors/command-executor.d.ts.map +1 -0
  48. package/packages/core/dist/src/executors/command-executor.js.map +1 -0
  49. package/packages/core/dist/src/executors/function-executor.d.ts +23 -0
  50. package/packages/core/dist/src/executors/function-executor.d.ts.map +1 -0
  51. package/packages/core/dist/src/executors/function-executor.js +164 -0
  52. package/packages/core/dist/src/executors/function-executor.js.map +1 -0
  53. package/packages/core/dist/src/executors/http-executor.d.ts.map +1 -0
  54. package/packages/core/dist/src/executors/http-executor.js.map +1 -0
  55. package/{dist → packages/core/dist/src}/index.d.ts +5 -1
  56. package/packages/core/dist/src/index.d.ts.map +1 -0
  57. package/{dist → packages/core/dist/src}/index.js +3 -0
  58. package/packages/core/dist/src/index.js.map +1 -0
  59. package/packages/core/dist/src/integrations/langchain.d.ts +46 -0
  60. package/packages/core/dist/src/integrations/langchain.d.ts.map +1 -0
  61. package/packages/core/dist/src/integrations/langchain.js +197 -0
  62. package/packages/core/dist/src/integrations/langchain.js.map +1 -0
  63. package/{dist → packages/core/dist/src}/matimo-instance.d.ts +30 -4
  64. package/packages/core/dist/src/matimo-instance.d.ts.map +1 -0
  65. package/{dist → packages/core/dist/src}/matimo-instance.js +63 -10
  66. package/packages/core/dist/src/matimo-instance.js.map +1 -0
  67. package/packages/core/dist/tools/calculator/calculator.d.ts +26 -0
  68. package/packages/core/dist/tools/calculator/calculator.d.ts.map +1 -0
  69. package/packages/core/dist/tools/calculator/calculator.js +104 -0
  70. package/packages/core/dist/tools/calculator/calculator.js.map +1 -0
  71. package/packages/core/dist/tsconfig.tsbuildinfo +1 -0
  72. package/dist/auth/oauth2-config.d.ts.map +0 -1
  73. package/dist/auth/oauth2-config.js.map +0 -1
  74. package/dist/auth/oauth2-handler.d.ts.map +0 -1
  75. package/dist/auth/oauth2-handler.js.map +0 -1
  76. package/dist/auth/oauth2-provider-loader.d.ts.map +0 -1
  77. package/dist/auth/oauth2-provider-loader.js.map +0 -1
  78. package/dist/core/schema.d.ts.map +0 -1
  79. package/dist/core/schema.js.map +0 -1
  80. package/dist/core/tool-loader.d.ts.map +0 -1
  81. package/dist/core/tool-loader.js.map +0 -1
  82. package/dist/core/tool-registry.d.ts.map +0 -1
  83. package/dist/core/tool-registry.js.map +0 -1
  84. package/dist/core/types.d.ts.map +0 -1
  85. package/dist/decorators/index.d.ts.map +0 -1
  86. package/dist/decorators/index.js.map +0 -1
  87. package/dist/decorators/tool-decorator.d.ts.map +0 -1
  88. package/dist/decorators/tool-decorator.js.map +0 -1
  89. package/dist/encodings/parameter-encoding.d.ts.map +0 -1
  90. package/dist/encodings/parameter-encoding.js.map +0 -1
  91. package/dist/errors/matimo-error.d.ts.map +0 -1
  92. package/dist/errors/matimo-error.js.map +0 -1
  93. package/dist/executors/command-executor.d.ts.map +0 -1
  94. package/dist/executors/command-executor.js.map +0 -1
  95. package/dist/executors/http-executor.d.ts.map +0 -1
  96. package/dist/executors/http-executor.js.map +0 -1
  97. package/dist/index.d.ts.map +0 -1
  98. package/dist/index.js.map +0 -1
  99. package/dist/matimo-instance.d.ts.map +0 -1
  100. package/dist/matimo-instance.js.map +0 -1
  101. package/tools/calculator/calculator.ts +0 -78
  102. package/tools/calculator/definition.yaml +0 -71
  103. package/tools/echo-tool/definition.yaml +0 -35
  104. package/tools/examples/calculator.yaml +0 -54
  105. package/tools/examples/echo-tool.yaml +0 -35
  106. package/tools/examples/http-client.yaml +0 -66
  107. package/tools/github/definition.yaml +0 -41
  108. package/tools/gmail/README.md +0 -1189
  109. package/tools/gmail/create-draft/definition.yaml +0 -99
  110. package/tools/gmail/definition.yaml +0 -49
  111. package/tools/gmail/delete-message/definition.yaml +0 -42
  112. package/tools/gmail/get-message/definition.yaml +0 -89
  113. package/tools/gmail/list-messages/definition.yaml +0 -84
  114. package/tools/gmail/send-email/definition.yaml +0 -95
  115. package/tools/http-client/definition.yaml +0 -73
  116. package/tools/slack/README.md +0 -200
  117. package/tools/slack/assets/icon.svg +0 -9
  118. package/tools/slack/assets/logo-dark.svg +0 -14
  119. package/tools/slack/assets/logo-light.svg +0 -14
  120. package/tools/slack/assets/logo.svg +0 -14
  121. package/tools/slack/definition.yaml +0 -54
  122. package/tools/slack/get-user/definition.yaml +0 -31
  123. package/tools/slack/list-channels/definition.yaml +0 -46
  124. package/tools/slack/send-message/definition.yaml +0 -30
  125. package/tools/slack/slack_add_reaction/definition.yaml +0 -45
  126. package/tools/slack/slack_create_channel/definition.yaml +0 -41
  127. package/tools/slack/slack_get_channel_history/definition.yaml +0 -58
  128. package/tools/slack/slack_get_reactions/definition.yaml +0 -36
  129. package/tools/slack/slack_get_thread_replies/definition.yaml +0 -45
  130. package/tools/slack/slack_get_user_info/definition.yaml +0 -32
  131. package/tools/slack/slack_join_channel/definition.yaml +0 -35
  132. package/tools/slack/slack_reply_to_message/definition.yaml +0 -49
  133. package/tools/slack/slack_search_messages/definition.yaml +0 -46
  134. package/tools/slack/slack_send_channel_message/definition.yaml +0 -34
  135. package/tools/slack/slack_send_dm/definition.yaml +0 -37
  136. package/tools/slack/slack_set_channel_topic/definition.yaml +0 -40
  137. package/tools/slack/slack_upload_file/definition.yaml +0 -152
  138. /package/{dist → packages/core/dist/src}/auth/oauth2-config.d.ts +0 -0
  139. /package/{dist → packages/core/dist/src}/auth/oauth2-config.js +0 -0
  140. /package/{dist → packages/core/dist/src}/auth/oauth2-handler.d.ts +0 -0
  141. /package/{dist → packages/core/dist/src}/auth/oauth2-handler.js +0 -0
  142. /package/{dist → packages/core/dist/src}/auth/oauth2-provider-loader.d.ts +0 -0
  143. /package/{dist → packages/core/dist/src}/auth/oauth2-provider-loader.js +0 -0
  144. /package/{dist → packages/core/dist/src}/core/tool-registry.d.ts +0 -0
  145. /package/{dist → packages/core/dist/src}/core/tool-registry.js +0 -0
  146. /package/{dist → packages/core/dist/src}/core/types.js +0 -0
  147. /package/{dist → packages/core/dist/src}/decorators/index.d.ts +0 -0
  148. /package/{dist → packages/core/dist/src}/decorators/index.js +0 -0
  149. /package/{dist → packages/core/dist/src}/decorators/tool-decorator.d.ts +0 -0
  150. /package/{dist → packages/core/dist/src}/decorators/tool-decorator.js +0 -0
  151. /package/{dist → packages/core/dist/src}/encodings/parameter-encoding.d.ts +0 -0
  152. /package/{dist → packages/core/dist/src}/encodings/parameter-encoding.js +0 -0
  153. /package/{dist → packages/core/dist/src}/errors/matimo-error.d.ts +0 -0
  154. /package/{dist → packages/core/dist/src}/errors/matimo-error.js +0 -0
  155. /package/{dist → packages/core/dist/src}/executors/command-executor.d.ts +0 -0
  156. /package/{dist → packages/core/dist/src}/executors/command-executor.js +0 -0
  157. /package/{dist → packages/core/dist/src}/executors/http-executor.d.ts +0 -0
  158. /package/{dist → packages/core/dist/src}/executors/http-executor.js +0 -0
package/README.md CHANGED
@@ -15,692 +15,218 @@
15
15
  <a href="https://nodejs.org/"><img src="https://img.shields.io/badge/Node.js-18+-green?style=for-the-badge" alt="Node.js"></a>
16
16
  </p>
17
17
 
18
- **Matimo** is a universal, configuration-driven AI tools ecosystem accessible through **multiple integration paths**. Define tools **once in YAML** and access them via SDK, MCP server, CLI, or HTTP across any AI framework or agent system.
18
+ **Matimo** is a universal, configuration-driven AI tools ecosystem. Define tools **once in YAML** and use them everywhere SDK, MCP server, CLI, REST API, or any AI framework (LangChain, CrewAI, Claude, etc.).
19
19
 
20
- If you want tools that feel **fast, maintainable, and framework-agnostic**, this is it.
20
+ **Define once Plug into any agent ecosystem.**
21
21
 
22
- [Documentation](./docs) · [Getting Started](./docs/getting-started/QUICK_START.md) · [API Reference](./docs/api-reference/SDK.md) · [Tool Spec](./docs/tool-development/TOOL_SPECIFICATION.md) · [GitHub](https://github.com/tallclub/matimo) · [Why Matimo?](#why-matimo)
22
+ [📖 Documentation](./docs) · [🚀 Quick Start](./docs/getting-started/QUICK_START.md) · [📚 API Reference](./docs/api-reference/SDK.md) · [🛠️ Add Tools](./docs/tool-development/ADDING_TOOLS.md) · [🤖 Examples](./examples)
23
23
 
24
- ## Quick Start (TL;DR)
24
+ ---
25
25
 
26
- Runtime: **Node ≥18**, **pnpm 8.15+**
26
+ ## Quick Start
27
27
 
28
28
  ```bash
29
- # Clone and install
30
- git clone https://github.com/tallclub/matimo.git
31
- cd matimo
32
- pnpm install
33
- pnpm build
29
+ npm install matimo
34
30
 
35
- # Run tests
36
- pnpm test
31
+ # OR auto-discover tools from node_modules/@matimo/*
32
+ npm install matimo @matimo/slack @matimo/gmail
33
+ ```
37
34
 
38
- # Start using
39
- const { MatimoInstance } = require('matimo');
35
+ ```typescript
36
+ import { MatimoInstance } from 'matimo';
40
37
 
41
- // Use built-in tools from npm package
42
- const matimo = await MatimoInstance.init('./node_modules/matimo/tools');
38
+ // Factory pattern: Simple and direct
39
+ const matimo = await MatimoInstance.init({ autoDiscover: true });
43
40
 
44
- // Execute built-in Slack tool
45
- const result = await matimo.execute('slack_send_message', {
46
- channel: '#general',
47
- message: 'Hello from Matimo!'
41
+ const result = await matimo.execute('slack-send-message', {
42
+ channel: '#general',
43
+ text: 'Hello from Matimo!',
48
44
  });
49
-
50
- // Or add custom tools alongside built-in ones
51
- const customMatimo = await MatimoInstance.init('./tools');
52
45
  ```
53
46
 
54
- Prefer factory pattern (simple) or decorator pattern (class-based code). See [SDK Usage Patterns - Level 1](#level-1-pure-sdk-patterns-no-framework-required) for details.
47
+ See [Three Integration Patterns](#three-integration-patterns) and [examples/](./examples) for more.
55
48
 
56
49
  ---
57
50
 
58
51
  ## Why Matimo?
59
52
 
60
- ### The Problem It Solves
61
-
62
- Building agent workflows is exciting but painful: every framework (LangChain, CrewAI, AutoGen, LlamaIndex, custom TS agents, Claude via MCP, etc.) has its own way of defining, calling, and executing tools.
53
+ **The Problem:** Every AI framework (LangChain, CrewAI, custom agents, etc.) defines tools differently. You duplicate tool logic across frameworks.
63
54
 
64
- You end up duplicating tool logic, schemas, and integrations repeatedly.
55
+ **The Solution:** Define tools **once** in clean YAML, use them **everywhere** — with built-in:
65
56
 
66
- **Matimo fixes this.** Define tools **once** in clean YAML files (with Zod validation for safety) and use them everywhere:
57
+ - TypeScript SDK (factory & decorator patterns)
58
+ - LangChain integration (with examples)
59
+ - Matimo CLI (tool discovery & management)
60
+ - Auto-discovery from npm packages
61
+ - OAuth2 support + parameter validation
67
62
 
68
- - **Pure TypeScript SDK** (factory or decorator patterns)
69
- - **LangChain** (examples included)
70
- - **MCP Server** (Claude-native) — coming soon
71
- - **REST API** — coming soon
72
- - **CLI** — coming soon
73
- - **Python SDK** — coming soon
74
- - **Tool Marketplace** (2000+ tools goal) — coming soon
75
-
76
- **Define once → Plug into any agent ecosystem.**
77
-
78
- ### Why Open Source?
79
-
80
- I built Matimo because I needed it while working on my own agent product — and I couldn't find a truly framework-agnostic, fully open-source alternative (most are paid or tightly coupled to one framework).
81
-
82
- I'm a solo developer (nomadic coder at heart) vibe coding, **all help is appreciated** to make Matimo a go-to standard for agent tools.
83
-
84
- ### How You Can Help Right Now
85
-
86
- - ⭐ **Star the repo** to show support and increase visibility
87
- - 🐛 **Open issues** for bugs, missing features, or pain points
88
- - 💡 **Suggest tools** to add (YAML examples welcome!)
89
- - 🔀 **Submit PRs** — we follow TDD + Conventional Commits (see CONTRIBUTING.md)
90
- - 📢 **Spread the word** on X/Twitter, Reddit (r/LocalLLM, r/AI_Agents, etc.), Discord communities
91
-
92
- Let's build a simple, powerful shovel for the agentic world together.
93
-
94
- With ❤️
95
- [Sajesh](https://www.linkedin.com/in/sajeshnair/)
96
- Creator of Matimo
63
+ See [Contributing](./CONTRIBUTING.md) or [Why Matimo?](./docs/index.md#why-matimo) for the full story.
97
64
 
98
65
  ---
99
66
 
100
- ## Built so far
101
-
102
- **SDK with 2 Patterns**
103
-
104
- - Factory pattern (simple, recommended)
105
- - Decorator pattern (class-based agents)
106
-
107
- **Tool Execution & Discovery**
108
-
109
- - YAML/JSON tool definitions with validation
110
- - Command executor (shell commands + parameter templating)
111
- - HTTP executor (REST APIs with auth)
112
- - Tool registry with search, filter, discover
113
-
114
- **Quality & Type Safety**
115
-
116
- - 100% test passing
117
- - Full TypeScript strict mode (zero `any` types)
118
- - Zod schema validation
119
- - ESLint clean
120
-
121
- ## Built-in Tools (50+ Operations)
122
-
123
- **Communication**
124
- - **Slack**: Send messages, upload files, manage channels, reactions, threads (16 operations)
125
- - **Gmail**: Send emails, create drafts, list messages, get message details (4 operations)
126
-
127
- **Development**
128
- - **GitHub**: Repository operations, issues, PRs, commits (coming soon)
129
- - **HTTP Client**: Generic REST API calls with auth support
130
-
131
- **Data & Infrastructure**
132
- - **AWS**: EC2, S3, Lambda operations (coming soon)
133
- - **Stripe**: Payment processing, subscriptions (coming soon)
134
-
135
- **Utilities**
136
- - **Calculator**: Arithmetic operations
137
- - **Echo Tool**: Simple command testing
138
-
139
- All tools include:
140
- - ✅ Full TypeScript/JavaScript support
141
- - ✅ OAuth2 authentication (where applicable)
142
- - ✅ Parameter validation with Zod
143
- - ✅ Response schema validation
144
- - ✅ Error handling with retry logic
145
- - ✅ Comprehensive documentation
146
-
147
- ## Planned Features
148
-
149
- **More Tools** - Jira, Notion, Linear, HubSpot, Twilio, etc
150
-
151
- **Tool Marketplace** — Community-contributed tools registry
152
-
153
- **MCP Server** — Claude & MCP client integration
154
-
155
- **REST API** — HTTP endpoints for tool execution
156
-
157
- **CLI** — Command-line tool management & testing
158
-
159
- **OAuth2** — GitHub, Google, Slack authentication
160
-
161
- **Python SDK** — Multi-language support
162
-
163
- **Health Monitoring** — Detect API schema changes
164
-
165
- **Rate Limiting** — Token bucket algorithm per tool
166
-
167
- ## Installation
168
-
169
- ### Option 1: From npm Registry (Recommended for Applications)
170
-
171
- Install Matimo as a dependency in your project:
67
+ ## Three Integration Patterns
172
68
 
173
- ```bash
174
- npm install matimo
175
- # or
176
- pnpm add matimo
177
- # or
178
- yarn add matimo
179
- ```
180
-
181
- Then import and use:
69
+ ### 1️⃣ Factory Pattern (Simplest)
182
70
 
183
71
  ```typescript
184
- import { MatimoInstance } from 'matimo';
185
-
186
- const matimo = await MatimoInstance.init('./tools');
187
- const result = await matimo.execute('tool-name', {
188
- /* params */
189
- });
72
+ const matimo = await MatimoInstance.init({ autoDiscover: true });
73
+ const result = await matimo.execute('calculator', { operation: 'add', a: 5, b: 3 });
190
74
  ```
191
75
 
192
- ### Option 2: Clone & Build Locally (For Development)
193
-
194
- Contribute to Matimo or use the latest pre-release version:
195
-
196
- ```bash
197
- git clone https://github.com/tallclub/matimo.git
198
- cd matimo
199
- pnpm install && pnpm build
200
-
201
- # Link for local development
202
- pnpm link --global
203
- # or use in local projects:
204
- npm link ../path/to/matimo
205
- ```
206
-
207
- ## SDK Usage Patterns
208
-
209
- ### Level 1: Pure SDK Patterns (No Framework Required)
210
-
211
- Use Matimo directly without any AI framework. Perfect for CLI tools, backends, scheduled jobs, and simple integrations.
212
-
213
- #### 1. Factory Pattern (Recommended for Simple Use Cases)
214
-
215
- Simplest, ergonomic, single-initialization API:
76
+ ### 2️⃣ Decorator Pattern (Class-Based)
216
77
 
217
78
  ```typescript
218
- import { matimo } from 'matimo';
219
-
220
- // Initialize once
221
- const matimoInstance = await matimo.init('./tools');
222
-
223
- // Execute tools by name
224
- const result = await matimoInstance.execute('calculator', {
225
- operation: 'add',
226
- a: 5,
227
- b: 3,
228
- });
229
-
230
- // Discover tools
231
- const allTools = matimoInstance.listTools();
232
- const tool = matimoInstance.getTool('calculator');
233
- const mathTools = matimoInstance.getToolsByTag('math');
234
- const results = matimoInstance.searchTools('calculator');
79
+ @tool('slack-send-message')
80
+ async sendMessage(channel: string, text: string) { /* Auto-executed */ }
235
81
  ```
236
82
 
237
- **Use when:** You need simple tool execution without LLM orchestration.
238
-
239
- #### 2. Decorator Pattern (Recommended for Class-Based Code)
240
-
241
- For class-based applications with automatic tool binding:
83
+ ### 3️⃣ LangChain Integration
242
84
 
243
85
  ```typescript
244
- import { tool } from 'matimo';
245
- import { matimo } from 'matimo';
246
-
247
- // Initialize Matimo (once)
248
- const matimoInstance = await matimo.init('./tools');
249
-
250
- // NOTE: `setGlobalMatimoInstance()` is convenient for quick demos.
251
- // For production code prefer explicit injection (constructor/factory) or an explicit binder.
252
-
253
- // Constructor / DI example (recommended for production)
254
- class MyAgent {
255
- constructor(public matimo: MatimoInstance) {}
256
-
257
- @tool('calculator')
258
- async calculate(operation: string, a: number, b: number) {
259
- // @tool decorator intercepts this call
260
- // Argument order matches tool parameters: operation, a, b
261
- // Method body can be empty - decorator does the work
262
- }
263
-
264
- @tool('github-get-repo')
265
- async getRepo(owner: string, repo: string) {
266
- // @tool decorator intercepts this call
267
- // Argument order matches tool parameters: owner, repo
268
- // Method body can be empty - decorator does the work
269
- }
270
- }
271
-
272
- const agent = new MyAgent(matimoInstance);
273
- // When you call agent.calculate('add', 5, 3):
274
- // 1. @tool decorator intercepts the call
275
- // 2. Decorator maps arguments to parameters: { operation: 'add', a: 5, b: 3 }
276
- // 3. Decorator calls matimo.execute('calculator', {...})
277
- // 4. Result is returned to you
278
- const result = await agent.calculate('add', 5, 3);
86
+ const tools = matimo.listTools().map(tool => ({
87
+ type: 'function',
88
+ function: { name: tool.name, description: tool.description, ... }
89
+ }));
279
90
  ```
280
91
 
281
- **Use when:** You prefer method-based calling style or class-based architecture.
282
-
283
- **How @tool decorator works:**
284
-
285
- - ✅ **Intercepts method calls** - Decorator intercepts and executes via Matimo
286
- - ✅ **Auto-maps arguments** - Method args become tool parameters (in order)
287
- - ✅ **Auto-executes tool** - Calls `matimo.execute(toolName, params)` automatically
288
- - ✅ **Returns tool result** - The result from Matimo is returned to you
289
- - ✅ **Fully scalable** - Add 100 tools = just add 100 `@tool()` decorated methods, no routing code
290
- - ✅ **Works with DI** - Uses instance property or global instance
291
- - ✅ **Method body optional** - Can be empty since decorator replaces it
292
-
293
- ### Level 2: Framework Integration Patterns (With AI Framework)
294
-
295
- Integrate Matimo tools with LangChain(TS), CrewAI (coming soon) , or other AI frameworks for intelligent tool orchestration. The LLM automatically decides which tool to use.
296
-
297
- #### LangChain Integration (Recommended for AI Agents)
298
-
299
- Three complete, production-ready examples in [examples/tools](./examples/tools):
300
-
301
- 1. **LangChain Official API** (⭐ Most Recommended)
302
- - Uses `createAgent()` + `tool()` from LangChain core
303
- - Automatic schema generation and tool orchestration
304
- - [See example](./examples/tools/agents/langchain-agent.ts)
305
-
306
- 2. **Decorator Pattern with LangChain**
307
- - Uses `@tool()` decorators with OpenAI function calling
308
- - Integrates Matimo tools into class-based LangChain agents
309
- - [See example](./examples/tools/agents/decorator-pattern-agent.ts)
310
-
311
- 3. **Factory Pattern with LangChain**
312
- - Direct `matimo.execute()` calls in LangChain agent
313
- - Simple functional approach
314
- - [See example](./examples/tools/agents/factory-pattern-agent.ts)
315
-
316
- All examples load tools from YAML once and reuse them across patterns — **single source of truth**.
317
-
318
- **Quick Start:** See [examples/tools/README.md](./examples/tools/README.md) for setup instructions and running the agents.
319
-
320
- **Use when:** You need intelligent tool selection based on natural language prompts.
321
-
322
- ## Integration Paths
323
-
324
- ### SDK (Available Now)
325
-
326
- **Level 1: Pure SDK** (No framework required)
327
-
328
- - **Factory Pattern** — Simplest API for any use case
329
- - **Decorator Pattern** — Best for class-based code
92
+ See [SDK Usage Patterns](./docs/user-guide/SDK_PATTERNS.md) and [LangChain Integration](./docs/framework-integrations/LANGCHAIN.md) for details.
330
93
 
331
- See [SDK Usage Patterns - Level 1](#level-1-pure-sdk-patterns-no-framework-required) above for examples.
94
+ ---
332
95
 
333
- **Level 2: Framework Integration** (With AI framework)
96
+ ## Installation
334
97
 
335
- - **LangChain Integration** — Production-ready AI agents with OpenAI GPT
336
- - **CrewAI Integration** — Coming in Phase 2
337
- - **Anthropic SDK Integration** — Coming in Phase 2
98
+ ### From npm (Recommended)
338
99
 
339
- See [SDK Usage Patterns - Level 2](#level-2-framework-integration-patterns-with-ai-framework) above and [examples/tools/README.md](./examples/tools/README.md) for complete working examples.
100
+ ```bash
101
+ npm install matimo
340
102
 
341
- ### Advanced (Coming Soon)
103
+ # Install tool providers
104
+ npm install @matimo/slack @matimo/gmail
105
+ ```
342
106
 
343
- **MCP Server (Claude Integration)**
107
+ Then use with auto-discovery:
344
108
 
345
109
  ```typescript
346
- // MCP Server - Coming in Phase 2
347
- // import { MCPServer } from 'matimo/mcp';
348
-
349
- const server = new MCPServer({
350
- toolsPath: './tools',
351
- autoLoad: true,
352
- });
353
-
354
- await server.start();
355
- // Claude can now discover and call all loaded tools
110
+ const matimo = await MatimoInstance.init({ autoDiscover: true });
356
111
  ```
357
112
 
358
- **REST API (HTTP Endpoints)**
113
+ ### Matimo CLI (Tool Management)
359
114
 
360
115
  ```bash
361
- # Coming soon
362
- matimo api --port 3000
116
+ npm install -g @matimo/cli
363
117
 
364
- curl -X POST http://localhost:3000/tools/calculator/execute \
365
- -d '{"operation":"add","a":5,"b":3}'
118
+ matimo list # Show installed packages
119
+ matimo search email # Find tools
120
+ matimo install slack # Install tools
366
121
  ```
367
122
 
368
- **CLI (Command Line)**
369
-
370
- ```bash
371
- matimo list # List all tools
372
- matimo execute calculator --operation add --a 5 --b 3
373
- matimo validate tools/calculator.yaml # Validate tool YAML
374
- matimo test calculator # Test tool
375
- ```
123
+ See [CLI Docs](./packages/cli/README.md) for full reference.
376
124
 
377
- ## Tool Definition (YAML)
125
+ ### From Source (Contributors)
378
126
 
379
- Tools are defined once in YAML, executed everywhere. Each tool specifies its execution type, parameters, schema, and auth:
380
-
381
- ```yaml
382
- name: calculator
383
- version: 1.0.0
384
- description: Perform basic mathematical operations
385
-
386
- parameters:
387
- operation:
388
- type: string
389
- enum: [add, subtract, multiply, divide]
390
- required: true
391
- description: Mathematical operation
392
- a:
393
- type: number
394
- required: true
395
- description: First operand
396
- b:
397
- type: number
398
- required: true
399
- description: Second operand
400
-
401
- execution:
402
- type: command
403
- command: ts-node
404
- args: ['tools/calculator/calculator.ts', '{operation}', '{a}', '{b}']
405
- timeout: 30000
406
-
407
- output_schema:
408
- type: object
409
- properties:
410
- result:
411
- type: number
412
- description: Calculation result
413
-
414
- error_handling:
415
- retry: 3
416
- backoff_type: exponential
417
- initial_delay_ms: 1000
127
+ ```bash
128
+ git clone https://github.com/tallclub/matimo
129
+ cd matimo && pnpm install && pnpm build
130
+ pnpm test
131
+ cd examples/tools && pnpm install && pnpm agent:factory
418
132
  ```
419
133
 
420
- ### Execution Types
421
-
422
- **Implemented:**
423
-
424
- - **`command`** — Shell commands with parameter templating
425
- - **`http`** — REST APIs with auth and response validation
426
-
427
- **Coming:**
428
-
429
- - **`script`** — Safe JavaScript/Python execution (sandboxed)
430
- - **`docker`** — Containerized execution
431
- - **`custom`** — External executables
432
-
433
- ## Architecture
434
-
435
- ```
436
- ┌─────────────────────────────────────────────┐
437
- │ AI Agents & Frameworks │
438
- │ (Claude, LangChain, CrewAI, Custom) │
439
- └──────────┬────────────────┬─────────────────┘
440
- │ │
441
- ┌─────▼─────┐ ┌─────▼─────┐
442
- │ SDK │ │ MCP │
443
- │ │ │ │
444
- └─────┬─────┘ └──────┬────┘
445
- │ │
446
- └────────┬───────┘
447
-
448
- ┌──────────▼──────────┐
449
- │ Matimo Core │
450
- │ - Loader │
451
- │ - Validator │
452
- │ - Executors │
453
- └──────────┬──────────┘
454
-
455
- ┌────────────┼────────────┐
456
- │ │ │
457
- ▼ ▼ ▼
458
- ┌────────┐ ┌──────────┐ ┌────────┐
459
- │Command │ │ HTTP │ │ Schema │
460
- │Exec │ │ Exec │ │Validate│
461
- └────────┘ └──────────┘ └────────┘
462
- │ │ │
463
- └────────────┼────────────┘
464
-
465
- ┌───────────▼───────────┐
466
- │ Tool Definitions │
467
- │ (YAML/JSON files) │
468
- │ calculator │
469
- │ http-client │
470
- │ echo-tool │
471
- │ 1000+ coming soon │
472
- └───────────────────────┘
473
- ```
134
+ ---
474
135
 
475
- ## Project Structure
136
+ ## Features
476
137
 
477
- ```
478
- matimo/
479
- ├── src/
480
- │ ├── core/ # Core types, schemas
481
- │ ├── executors/ # Command & HTTP execution
482
- │ ├── decorators/ # @tool decorator pattern
483
- │ ├── mcp/ # MCP server
484
- │ ├── cli/ # CLI interface
485
- │ ├── errors/ # Error handling
486
- │ └── logging/ # Structured logging
487
- ├── tools/
488
- │ ├── calculator/ # Calculator tool
489
- │ ├── echo-tool/ # Echo tool
490
- │ └── http-client/ # HTTP client tool
491
- ├── test/ # tests
492
- │ ├── unit/
493
- │ └── integration/
494
- ├── docs/
495
- │ ├── quick-start.md
496
- │ ├── api.md
497
- │ ├── tool-spec.md
498
- │ └── ...
499
- └── package.json
500
- ```
138
+ **Now:**
501
139
 
502
- ## Development
140
+ - ✅ Factory & Decorator patterns (SDK)
141
+ - ✅ LangChain integration
142
+ - ✅ YAML tool definitions with Zod validation
143
+ - ✅ Slack & Gmail tools (20+ operations)
144
+ - ✅ Auto-discovery from npm packages
145
+ - ✅ Matimo CLI (install, list, search)
146
+ - ✅ OAuth2 support
147
+ - ✅ 100% test coverage, TypeScript strict mode
503
148
 
504
- ### Prerequisites
149
+ **Coming Soon:**
505
150
 
506
- - **Node.js** 18+
507
- - **pnpm** 8.15+
508
- - **TypeScript** 5.9+
151
+ - 🔜 MCP Server (Claude integration)
152
+ - 🔜 REST API
153
+ - 🔜 More tool providers (GitHub, Stripe, Twilio, etc.)
154
+ - 🔜 Tool Marketplace
155
+ - 🔜 Python SDK
509
156
 
510
- ### Setup
157
+ ---
511
158
 
512
- ```bash
513
- git clone https://github.com/tallclub/matimo.git
514
- cd matimo
515
- pnpm install
516
- pnpm build
517
- ```
159
+ ## Adding Tools to Matimo
518
160
 
519
- ### Commands
161
+ Create tool providers as independent npm packages:
520
162
 
521
163
  ```bash
522
- pnpm build # Compile TypeScript
523
- pnpm test # Run all tests
524
- pnpm test:watch # Watch mode
525
- pnpm test:coverage # Coverage report
526
- pnpm lint # ESLint
527
- pnpm format # Prettier formatting
164
+ mkdir packages/github
165
+ cd packages/github && cat > package.json << 'EOF'
166
+ { "name": "@matimo/github", "type": "module", ... }
167
+ EOF
168
+
169
+ mkdir tools/github-create-issue
170
+ cat > tools/github-create-issue/definition.yaml << 'EOF'
171
+ name: github-create-issue
172
+ parameters:
173
+ owner: { type: string, required: true }
174
+ repo: { type: string, required: true }
175
+ title: { type: string, required: true }
176
+ execution:
177
+ type: http
178
+ method: POST
179
+ url: https://api.github.com/repos/{owner}/{repo}/issues
180
+ headers:
181
+ Authorization: "Bearer {GITHUB_TOKEN}"
182
+ EOF
528
183
  ```
529
184
 
530
- ### Testing
531
-
532
- Matimo uses Jest with TypeScript. Tests follow TDD principles:
185
+ Then publish to npm as `@matimo/github`. Users install and auto-discover:
533
186
 
534
187
  ```bash
535
- pnpm test # All tests
536
- pnpm test types.test.ts # Specific file
537
- pnpm test:watch # Watch mode
538
- pnpm test:coverage # Coverage (target: 80%+)
188
+ npm install @matimo/github
189
+ # New tools automatically available!
190
+ const matimo = await MatimoInstance.init({ autoDiscover: true });
539
191
  ```
540
192
 
541
- **Coverage Target:** 80%+ (currently 112 tests, 11+ suites)
542
-
543
- ## Community
544
-
545
- We welcome contributions!
546
-
547
- ### Getting Started
548
-
549
- 1. **Fork** the repository
550
- 2. **Create branch** (`git checkout -b feature/amazing-feature`)
551
- 3. **Write tests first** (TDD approach)
552
- 4. **Make changes**
553
- 5. **Run tests** (`pnpm test && pnpm lint`)
554
- 6. **Commit** with conventional commits
555
- 7. **Push** and open PR
556
-
557
- ### Commit Format
558
-
559
- We enforce [Conventional Commits](https://www.conventionalcommits.org/):
193
+ See [Adding Tools to Matimo](./docs/tool-development/ADDING_TOOLS.md) for the complete 6-step guide.
560
194
 
561
- ```
562
- feat(scope): short description
563
- fix(executor): validate parameters
564
- docs(readme): update guide
565
- test(decorator): add tests
566
- ```
567
-
568
- ### What Can You Contribute?
569
-
570
- - Core SDK improvements
571
- - Bug fixes
572
- - Documentation
573
- - Test coverage
574
- - Tool definitions
575
- - New executor types
576
- - Performance optimizations
577
- - Security
578
- - Ideas
579
-
580
- See [CONTRIBUTING.md](./CONTRIBUTING.md) for detailed guidelines.
195
+ ---
581
196
 
582
197
  ## Documentation
583
198
 
584
- - **[Quick Start](./docs/getting-started/QUICK_START.md)** — Get up and running in 5 minutes
585
- - **[API Reference](./docs/api-reference/SDK.md)** — Complete SDK API
586
- - **[Tool Specification](./docs/tool-development/TOOL_SPECIFICATION.md)** — How to write YAML tools
587
- - **[Decorator Guide](./docs/tool-development/DECORATOR_GUIDE.md)** — Using @tool decorators
588
- - **[Commit Guidelines](./docs/community/COMMIT_GUIDELINES.md)** — Conventional commits
589
- - **[Development Standards](./docs/user-guide/DEVELOPMENT_STANDARDS.md)** — Code quality rules
590
- - **[Architecture Overview](./docs/architecture/OVERVIEW.md)** — System design and patterns
591
- - **[Framework Integrations](./docs/framework-integrations/LANGCHAIN.md)** — LangChain, CrewAI patterns
592
-
593
- ## Roadmap
594
-
595
- ### Foundation (Complete)
596
-
597
- **Completed:**
598
-
599
- - Tool loading (YAML/JSON)
600
- - Command & HTTP executors
601
- - Factory & Decorator patterns
602
- - Tool registry & discovery
603
- - 112+ tests (100% passing)
604
- - Full TypeScript strict mode
605
-
606
- ### Reliability (Coming)
607
-
608
- **Upcoming:**
609
-
610
- - MCP server (Claude integration)
611
- - CLI tool management
612
- - REST API server
613
- - OAuth2 authentication
614
- - Rate limiting
615
- - Health monitoring
616
-
617
- ### Ecosystem (Coming)
618
-
619
- **Future:**
620
-
621
- - Python SDK
622
- - MCP
623
- - Skills/Workflows (multi-tool orchestration)
624
- - 2000+ pre-configured tools
625
-
626
- ## Performance Benchemark Expected
627
-
628
- - **Tool Execution:** <100ms overhead per call
629
- - **Schema Validation:** <10ms per request
630
- - **Memory:** ~50MB base + 1-2MB per loaded tool
631
- - **Concurrency:** 100+ simultaneous tools
632
-
633
- ## Security
634
-
635
- ### Implemented
199
+ - [Getting Started](./docs/getting-started/)
200
+ - [API Reference](./docs/api-reference/SDK.md)
201
+ - [Tool Development](./docs/tool-development/ADDING_TOOLS.md)
202
+ - [Architecture Overview](./docs/architecture/OVERVIEW.md)
203
+ - [Contributing](./CONTRIBUTING.md)
636
204
 
637
- **Currently:**
638
-
639
- - No hardcoded credentials (environment variables only)
640
- - Input validation (Zod schemas)
641
- - Safe error messages (no secret leaks)
642
- - Full TypeScript strict mode
643
-
644
- ### Coming
645
-
646
- **Next:**
647
-
648
- - Response validation against schemas
649
- - Health monitoring (detect API changes)
650
- - OAuth2 token management
651
- - Rate limiting
652
-
653
- **Future:**
654
-
655
- - Sandboxed execution (Docker/Firejail)
656
- - Encryption at rest
657
- - Audit logging
658
- - Zero-trust architecture
659
-
660
- See [SECURITY.md](./SECURITY.md) for detailed guidelines.
205
+ ---
661
206
 
662
207
  ## License
663
208
 
664
209
  MIT © 2026 Matimo Contributors
665
210
 
666
- ## Support
667
-
668
- - 📖 [Docs](./docs)
669
- - 💬 [Discussions](https://github.com/tallclub/matimo/discussions)
670
- - 🐛 [Issues](https://github.com/tallclub/matimo/issues)
671
-
672
- ## Contributors
673
-
674
- <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
675
-
676
- [![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)
677
-
678
- <!-- ALL-CONTRIBUTORS-BADGE:END -->
679
-
680
- <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
681
- <!-- prettier-ignore-start -->
682
- <!-- markdownlint-disable -->
683
- <table>
684
- <tbody>
685
- <tr>
686
- <td align="center" valign="top" width="14.28%"><a href="https://github.com/tallclub"><img src="https://avatars.githubusercontent.com/u/112923179?v=4?s=100" width="50px;" alt="tallclub" style="border-radius: 50%;"/>
687
- </tr>
688
- </tbody>
689
- </table>
211
+ ---
690
212
 
691
- <!-- markdownlint-restore -->
692
- <!-- prettier-ignore-end -->
213
+ ## Support the Project
693
214
 
694
- <!-- ALL-CONTRIBUTORS-LIST:END -->
215
+ - ⭐ Star the repo
216
+ - 🐛 Open issues for bugs or features
217
+ - 🔀 Submit PRs (see [Contributing](./CONTRIBUTING.md))
218
+ - 📢 Share on Twitter, Reddit, Discord
695
219
 
696
- Contributions are welcome — see [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.
220
+ ---
697
221
 
698
- ## Star History
222
+ ## Contributors
699
223
 
700
- [![Star History Chart](https://api.star-history.com/svg?repos=tallclub/matimo&type=date&legend=top-left)](https://www.star-history.com/#tallclub/matimo&type=date&legend=top-left)
224
+ <a href="https://github.com/tallclub/matimo/graphs/contributors">
225
+ <img src="https://contrib.rocks/image?repo=tallclub/matimo" />
226
+ </a>
701
227
 
702
228
  ---
703
229
 
704
- **Ready to integrate AI tools across your framework?**
230
+ ## Star History
705
231
 
706
- [Get Started Now →](./docs/getting-started/QUICK_START.md)
232
+ [![Star History Chart](https://api.star-history.com/svg?repos=tallclub/matimo&type=Date)](https://star-history.com/#tallclub/matimo&Date)