@mcpilotx/intentorch 0.5.0
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.
- package/LICENSE +201 -0
- package/README.md +545 -0
- package/dist/ai/ai.d.ts +205 -0
- package/dist/ai/ai.js +1200 -0
- package/dist/ai/cloud-intent-engine.d.ts +270 -0
- package/dist/ai/cloud-intent-engine.js +956 -0
- package/dist/ai/command.d.ts +59 -0
- package/dist/ai/command.js +285 -0
- package/dist/ai/config.d.ts +66 -0
- package/dist/ai/config.js +211 -0
- package/dist/ai/enhanced-intent.d.ts +17 -0
- package/dist/ai/enhanced-intent.js +32 -0
- package/dist/ai/index.d.ts +29 -0
- package/dist/ai/index.js +44 -0
- package/dist/ai/intent.d.ts +16 -0
- package/dist/ai/intent.js +30 -0
- package/dist/core/ai-config.d.ts +25 -0
- package/dist/core/ai-config.js +326 -0
- package/dist/core/config-manager.d.ts +36 -0
- package/dist/core/config-manager.js +400 -0
- package/dist/core/config-validator.d.ts +9 -0
- package/dist/core/config-validator.js +184 -0
- package/dist/core/constants.d.ts +34 -0
- package/dist/core/constants.js +37 -0
- package/dist/core/error-ai.d.ts +23 -0
- package/dist/core/error-ai.js +217 -0
- package/dist/core/error-handler.d.ts +197 -0
- package/dist/core/error-handler.js +467 -0
- package/dist/core/index.d.ts +13 -0
- package/dist/core/index.js +17 -0
- package/dist/core/logger.d.ts +27 -0
- package/dist/core/logger.js +108 -0
- package/dist/core/performance-monitor.d.ts +74 -0
- package/dist/core/performance-monitor.js +260 -0
- package/dist/core/providers.d.ts +36 -0
- package/dist/core/providers.js +304 -0
- package/dist/core/retry-manager.d.ts +41 -0
- package/dist/core/retry-manager.js +204 -0
- package/dist/core/types.d.ts +155 -0
- package/dist/core/types.js +2 -0
- package/dist/daemon/index.d.ts +10 -0
- package/dist/daemon/index.js +15 -0
- package/dist/daemon/intent-engine.d.ts +22 -0
- package/dist/daemon/intent-engine.js +50 -0
- package/dist/daemon/orchestrator.d.ts +24 -0
- package/dist/daemon/orchestrator.js +100 -0
- package/dist/daemon/pm.d.ts +33 -0
- package/dist/daemon/pm.js +127 -0
- package/dist/daemon/process.d.ts +11 -0
- package/dist/daemon/process.js +49 -0
- package/dist/daemon/server.d.ts +17 -0
- package/dist/daemon/server.js +435 -0
- package/dist/daemon/service.d.ts +36 -0
- package/dist/daemon/service.js +278 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.js +36 -0
- package/dist/mcp/client.d.ts +51 -0
- package/dist/mcp/client.js +276 -0
- package/dist/mcp/index.d.ts +162 -0
- package/dist/mcp/index.js +199 -0
- package/dist/mcp/tool-registry.d.ts +71 -0
- package/dist/mcp/tool-registry.js +308 -0
- package/dist/mcp/transport.d.ts +83 -0
- package/dist/mcp/transport.js +515 -0
- package/dist/mcp/types.d.ts +136 -0
- package/dist/mcp/types.js +31 -0
- package/dist/runtime/adapter-advanced.d.ts +184 -0
- package/dist/runtime/adapter-advanced.js +160 -0
- package/dist/runtime/adapter.d.ts +9 -0
- package/dist/runtime/adapter.js +2 -0
- package/dist/runtime/detector-advanced.d.ts +59 -0
- package/dist/runtime/detector-advanced.js +487 -0
- package/dist/runtime/detector.d.ts +5 -0
- package/dist/runtime/detector.js +56 -0
- package/dist/runtime/docker-adapter.d.ts +18 -0
- package/dist/runtime/docker-adapter.js +170 -0
- package/dist/runtime/docker.d.ts +17 -0
- package/dist/runtime/docker.js +71 -0
- package/dist/runtime/executable-analyzer.d.ts +56 -0
- package/dist/runtime/executable-analyzer.js +391 -0
- package/dist/runtime/go-adapter.d.ts +19 -0
- package/dist/runtime/go-adapter.js +190 -0
- package/dist/runtime/index.d.ts +9 -0
- package/dist/runtime/index.js +10 -0
- package/dist/runtime/node-adapter.d.ts +10 -0
- package/dist/runtime/node-adapter.js +23 -0
- package/dist/runtime/node.d.ts +20 -0
- package/dist/runtime/node.js +86 -0
- package/dist/runtime/python-adapter.d.ts +11 -0
- package/dist/runtime/python-adapter.js +102 -0
- package/dist/runtime/python.d.ts +17 -0
- package/dist/runtime/python.js +72 -0
- package/dist/runtime/rust-adapter.d.ts +21 -0
- package/dist/runtime/rust-adapter.js +267 -0
- package/dist/sdk.d.ts +500 -0
- package/dist/sdk.js +904 -0
- package/docs/README.ZH_CN.md +545 -0
- package/docs/api.md +888 -0
- package/docs/architecture.md +731 -0
- package/docs/development.md +744 -0
- package/package.json +112 -0
package/README.md
ADDED
|
@@ -0,0 +1,545 @@
|
|
|
1
|
+
# IntentOrch - Intent-Driven MCP Orchestration Toolkit
|
|
2
|
+
|
|
3
|
+
<div align="right">
|
|
4
|
+
<small>
|
|
5
|
+
<strong>Language:</strong>
|
|
6
|
+
<a href="README.md">English</a> |
|
|
7
|
+
<a href="docs/README.ZH_CN.md">ไธญๆ</a>
|
|
8
|
+
</small>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
[](https://www.npmjs.com/package/@mcpilotx/intentorch)
|
|
12
|
+
[](https://opensource.org/licenses/Apache-2.0)
|
|
13
|
+
[](https://www.typescriptlang.org/)
|
|
14
|
+
[](https://nodejs.org/)
|
|
15
|
+
[](https://github.com/MCPilotX/IntentOrch)
|
|
16
|
+
|
|
17
|
+
**Transform natural language into executable workflows with AI-powered intent parsing and MCP tool orchestration.**
|
|
18
|
+
|
|
19
|
+
IntentOrch is a developer-first toolkit that bridges human intent with MCP (Model Context Protocol) capabilities. It understands what you want to accomplish, breaks it down into actionable steps, and orchestrates the right tools to get it done.
|
|
20
|
+
|
|
21
|
+
## ๐ฏ What Problem Does IntentOrch Solve?
|
|
22
|
+
|
|
23
|
+
Building AI applications that can actually *do things* is hard. You need to:
|
|
24
|
+
- Parse natural language instructions
|
|
25
|
+
- Map intents to available tools
|
|
26
|
+
- Handle dependencies between steps
|
|
27
|
+
- Execute workflows reliably
|
|
28
|
+
- Provide meaningful feedback
|
|
29
|
+
|
|
30
|
+
IntentOrch handles all of this complexity so you can focus on building amazing applications.
|
|
31
|
+
|
|
32
|
+
## โจ Core Features
|
|
33
|
+
|
|
34
|
+
### ๐ค **Intent-Driven Workflows**
|
|
35
|
+
```typescript
|
|
36
|
+
// Tell IntentOrch what you want to accomplish
|
|
37
|
+
const result = await sdk.executeIntent(
|
|
38
|
+
"Analyze the README.md file and suggest improvements"
|
|
39
|
+
);
|
|
40
|
+
// IntentOrch will: parse the intent, select tools, execute steps, return results
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### ๐ง **MCP Tool Orchestration**
|
|
44
|
+
- Connect to any MCP-compatible server
|
|
45
|
+
- Automatic tool discovery and registration
|
|
46
|
+
- Intelligent tool selection based on intent
|
|
47
|
+
- Parallel and sequential execution planning
|
|
48
|
+
|
|
49
|
+
### ๐ง **Cloud Intent Engine**
|
|
50
|
+
- LLM-powered intent parsing and decomposition
|
|
51
|
+
- Dependency graph generation (DAG)
|
|
52
|
+
- Parameter mapping from intent to tools
|
|
53
|
+
- Execution planning and optimization
|
|
54
|
+
|
|
55
|
+
### ๐ **Runtime Intelligence**
|
|
56
|
+
- Automatic detection of project runtimes (Node.js, Python, Docker, Go, Rust)
|
|
57
|
+
- Runtime-specific adapter configuration
|
|
58
|
+
- Service lifecycle management
|
|
59
|
+
|
|
60
|
+
### ๐ก **Advanced Transport Layer**
|
|
61
|
+
- Multiple transport types (stdio, HTTP, SSE)
|
|
62
|
+
- Intelligent log filtering
|
|
63
|
+
- Multi-line JSON support
|
|
64
|
+
- Error recovery and retry mechanisms
|
|
65
|
+
|
|
66
|
+
## ๐ Quick Start
|
|
67
|
+
|
|
68
|
+
### Installation
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
npm install @mcpilotx/intentorch
|
|
72
|
+
# or
|
|
73
|
+
yarn add @mcpilotx/intentorch
|
|
74
|
+
# or
|
|
75
|
+
pnpm add @mcpilotx/intentorch
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Your First Intent-Driven Application
|
|
79
|
+
|
|
80
|
+
```typescript
|
|
81
|
+
import { createSDK } from '@mcpilotx/intentorch';
|
|
82
|
+
|
|
83
|
+
// Create SDK instance
|
|
84
|
+
const sdk = createSDK();
|
|
85
|
+
|
|
86
|
+
// Configure AI (supports DeepSeek, OpenAI, Ollama)
|
|
87
|
+
await sdk.configureAI({
|
|
88
|
+
provider: 'deepseek',
|
|
89
|
+
apiKey: process.env.DEEPSEEK_API_KEY,
|
|
90
|
+
model: 'deepseek-chat'
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
// Connect to MCP servers
|
|
94
|
+
await sdk.connectMCPServer({
|
|
95
|
+
name: 'filesystem',
|
|
96
|
+
transport: {
|
|
97
|
+
type: 'stdio',
|
|
98
|
+
command: 'npx',
|
|
99
|
+
args: ['@modelcontextprotocol/server-filesystem', '.']
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
// Execute your first intent-driven workflow
|
|
104
|
+
const result = await sdk.executeIntent(
|
|
105
|
+
"Read the package.json file and tell me what dependencies it has"
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
console.log('Workflow completed!');
|
|
109
|
+
console.log('Answer:', result.answer);
|
|
110
|
+
console.log('Tools used:', result.toolCalls?.length || 0);
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Quick Test Script
|
|
114
|
+
|
|
115
|
+
Create `quick-test.js`:
|
|
116
|
+
|
|
117
|
+
```javascript
|
|
118
|
+
const { createSDK } = require('@mcpilotx/intentorch');
|
|
119
|
+
|
|
120
|
+
async function quickTest() {
|
|
121
|
+
console.log('๐ Testing IntentOrch...');
|
|
122
|
+
|
|
123
|
+
const sdk = createSDK();
|
|
124
|
+
console.log('โ
SDK created');
|
|
125
|
+
|
|
126
|
+
// Initialize Cloud Intent Engine
|
|
127
|
+
await sdk.initCloudIntentEngine();
|
|
128
|
+
console.log('โ
Cloud Intent Engine initialized');
|
|
129
|
+
|
|
130
|
+
// List available tools (even without MCP servers)
|
|
131
|
+
const tools = sdk.listTools();
|
|
132
|
+
console.log(`๐ฆ ${tools.length} tools available`);
|
|
133
|
+
|
|
134
|
+
console.log('๐ IntentOrch is ready to transform your intents into actions!');
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
quickTest().catch(console.error);
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Run it:
|
|
141
|
+
```bash
|
|
142
|
+
node quick-test.js
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## ๐๏ธ Core Concepts
|
|
146
|
+
|
|
147
|
+
### 1. Intent Parsing
|
|
148
|
+
IntentOrch uses LLMs to understand natural language instructions and break them down into atomic intents:
|
|
149
|
+
|
|
150
|
+
```
|
|
151
|
+
"Analyze the project and create a summary"
|
|
152
|
+
โ
|
|
153
|
+
1. Read project files
|
|
154
|
+
2. Analyze code structure
|
|
155
|
+
3. Generate summary report
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### 2. Tool Selection
|
|
159
|
+
For each atomic intent, IntentOrch selects the most appropriate MCP tool:
|
|
160
|
+
|
|
161
|
+
```
|
|
162
|
+
Intent: "Read project files"
|
|
163
|
+
โ
|
|
164
|
+
Tool: filesystem/read_file
|
|
165
|
+
Parameters: { path: "package.json" }
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### 3. Workflow Orchestration
|
|
169
|
+
IntentOrch creates and executes dependency-aware workflows:
|
|
170
|
+
|
|
171
|
+
```typescript
|
|
172
|
+
const workflow = await sdk.parseAndPlan(
|
|
173
|
+
"Clone a repo, analyze the code, and generate documentation"
|
|
174
|
+
);
|
|
175
|
+
// Returns: { steps: 3, dependencies: [...], estimatedTime: "2m" }
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### 4. Execution with Tracking
|
|
179
|
+
Monitor each step of the workflow execution:
|
|
180
|
+
|
|
181
|
+
```typescript
|
|
182
|
+
const result = await sdk.executeIntentWithTracking(
|
|
183
|
+
"Process user data and generate report",
|
|
184
|
+
{
|
|
185
|
+
onStepStart: (step) => console.log(`Starting: ${step.intentDescription}`),
|
|
186
|
+
onStepComplete: (step) => console.log(`Completed in ${step.duration}ms`),
|
|
187
|
+
onError: (error, step) => console.log(`Failed: ${step.toolName}`)
|
|
188
|
+
}
|
|
189
|
+
);
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
## ๐ Comprehensive Examples
|
|
193
|
+
|
|
194
|
+
### Example 1: File Analysis Workflow
|
|
195
|
+
|
|
196
|
+
```typescript
|
|
197
|
+
import { createSDK } from '@mcpilotx/intentorch';
|
|
198
|
+
|
|
199
|
+
async function analyzeProject() {
|
|
200
|
+
const sdk = createSDK();
|
|
201
|
+
|
|
202
|
+
// Configure AI and MCP
|
|
203
|
+
await sdk.configureAI({
|
|
204
|
+
provider: 'deepseek',
|
|
205
|
+
apiKey: process.env.DEEPSEEK_API_KEY
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
await sdk.connectMCPServer({
|
|
209
|
+
name: 'filesystem',
|
|
210
|
+
transport: {
|
|
211
|
+
type: 'stdio',
|
|
212
|
+
command: 'npx',
|
|
213
|
+
args: ['@modelcontextprotocol/server-filesystem', '.']
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
// Execute intent-driven analysis
|
|
218
|
+
const result = await sdk.executeIntent(`
|
|
219
|
+
Analyze this TypeScript project:
|
|
220
|
+
1. Read all .ts files in src/
|
|
221
|
+
2. Identify the main architecture patterns
|
|
222
|
+
3. Suggest improvements for error handling
|
|
223
|
+
4. Generate a brief architecture summary
|
|
224
|
+
`);
|
|
225
|
+
|
|
226
|
+
return result;
|
|
227
|
+
}
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
### Example 2: Multi-Server Orchestration
|
|
231
|
+
|
|
232
|
+
```typescript
|
|
233
|
+
import { createSDK } from '@mcpilotx/intentorch';
|
|
234
|
+
|
|
235
|
+
async function multiServerWorkflow() {
|
|
236
|
+
const sdk = createSDK();
|
|
237
|
+
|
|
238
|
+
// Connect to multiple MCP servers
|
|
239
|
+
await sdk.connectAllFromConfig({
|
|
240
|
+
servers: [
|
|
241
|
+
{
|
|
242
|
+
name: 'filesystem',
|
|
243
|
+
transport: {
|
|
244
|
+
type: 'stdio',
|
|
245
|
+
command: 'npx',
|
|
246
|
+
args: ['@modelcontextprotocol/server-filesystem', '.']
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
name: 'git',
|
|
251
|
+
transport: {
|
|
252
|
+
type: 'stdio',
|
|
253
|
+
command: 'npx',
|
|
254
|
+
args: ['@modelcontextprotocol/server-git', '.']
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
]
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
// Complex intent that uses multiple servers
|
|
261
|
+
const result = await sdk.executeIntent(`
|
|
262
|
+
Analyze the git history of this project:
|
|
263
|
+
1. Get recent commits
|
|
264
|
+
2. Check which files changed most frequently
|
|
265
|
+
3. Read those files to understand the changes
|
|
266
|
+
4. Suggest areas that need better testing
|
|
267
|
+
`);
|
|
268
|
+
|
|
269
|
+
return result;
|
|
270
|
+
}
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
### Example 3: Custom Tool Integration
|
|
274
|
+
|
|
275
|
+
```typescript
|
|
276
|
+
import { createSDK, ToolRegistry } from '@mcpilotx/intentorch';
|
|
277
|
+
|
|
278
|
+
async function customToolWorkflow() {
|
|
279
|
+
const sdk = createSDK();
|
|
280
|
+
|
|
281
|
+
// Register custom tools
|
|
282
|
+
sdk.toolRegistry.registerTool({
|
|
283
|
+
name: 'calculate_metrics',
|
|
284
|
+
description: 'Calculate code quality metrics',
|
|
285
|
+
inputSchema: {
|
|
286
|
+
type: 'object',
|
|
287
|
+
properties: {
|
|
288
|
+
filePath: { type: 'string' },
|
|
289
|
+
metrics: {
|
|
290
|
+
type: 'array',
|
|
291
|
+
items: { type: 'string', enum: ['complexity', 'coverage', 'duplication'] }
|
|
292
|
+
}
|
|
293
|
+
},
|
|
294
|
+
required: ['filePath']
|
|
295
|
+
}
|
|
296
|
+
}, async (args) => {
|
|
297
|
+
// Your custom metric calculation logic
|
|
298
|
+
return {
|
|
299
|
+
complexity: 8.5,
|
|
300
|
+
coverage: 0.85,
|
|
301
|
+
duplication: 0.12
|
|
302
|
+
};
|
|
303
|
+
});
|
|
304
|
+
|
|
305
|
+
// Use custom tools in intent execution
|
|
306
|
+
const result = await sdk.executeIntent(
|
|
307
|
+
"Calculate code metrics for src/sdk.ts and suggest refactoring"
|
|
308
|
+
);
|
|
309
|
+
|
|
310
|
+
return result;
|
|
311
|
+
}
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
## ๐๏ธ Architecture Overview
|
|
315
|
+
|
|
316
|
+
```
|
|
317
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
318
|
+
โ Your Application โ
|
|
319
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
320
|
+
โ IntentOrch SDK โ
|
|
321
|
+
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โ
|
|
322
|
+
โ โ Intent โ โ Tool โ โ Runtime โ โ
|
|
323
|
+
โ โ Engine โ โ Registry โ โ Adapters โ โ
|
|
324
|
+
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โ
|
|
325
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
326
|
+
โ MCP Transport Layer โ
|
|
327
|
+
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โ
|
|
328
|
+
โ โ Stdio โ โ HTTP โ โ SSE โ โ
|
|
329
|
+
โ โ Transport โ โ Transport โ โ Transport โ โ
|
|
330
|
+
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โ
|
|
331
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
|
|
332
|
+
โ MCP Servers (Local/Remote) โ
|
|
333
|
+
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โ
|
|
334
|
+
โ โ Filesystem โ โ Git โ โ Database โ โ
|
|
335
|
+
โ โ Server โ โ Server โ โ Server โ โ
|
|
336
|
+
โ โโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โ
|
|
337
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
### Key Components
|
|
341
|
+
|
|
342
|
+
1. **Cloud Intent Engine** - LLM-powered intent parsing and workflow planning
|
|
343
|
+
2. **Tool Registry** - Unified management of all MCP and custom tools
|
|
344
|
+
3. **Runtime Adapters** - Support for Node.js, Python, Docker, Go, Rust
|
|
345
|
+
4. **Transport Layer** - Communication with MCP servers (stdio/HTTP/SSE)
|
|
346
|
+
5. **Service Manager** - Lifecycle management of orchestrated services
|
|
347
|
+
|
|
348
|
+
## ๐ง Advanced Configuration
|
|
349
|
+
|
|
350
|
+
### Cloud Intent Engine Configuration
|
|
351
|
+
|
|
352
|
+
```typescript
|
|
353
|
+
await sdk.initCloudIntentEngine({
|
|
354
|
+
llm: {
|
|
355
|
+
provider: 'deepseek',
|
|
356
|
+
model: 'deepseek-chat',
|
|
357
|
+
temperature: 0.7,
|
|
358
|
+
maxTokens: 2000
|
|
359
|
+
},
|
|
360
|
+
planning: {
|
|
361
|
+
maxParallelSteps: 3,
|
|
362
|
+
timeoutPerStep: 30000,
|
|
363
|
+
retryAttempts: 2
|
|
364
|
+
}
|
|
365
|
+
});
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
### Transport Configuration with Log Filtering
|
|
369
|
+
|
|
370
|
+
```typescript
|
|
371
|
+
const sdk = createSDK({
|
|
372
|
+
mcp: {
|
|
373
|
+
servers: [{
|
|
374
|
+
name: 'filesystem',
|
|
375
|
+
transport: {
|
|
376
|
+
type: 'stdio',
|
|
377
|
+
command: 'npx',
|
|
378
|
+
args: ['@modelcontextprotocol/server-filesystem'],
|
|
379
|
+
logFilter: {
|
|
380
|
+
ignorePatterns: ['^DEBUG:', '^TRACE:'],
|
|
381
|
+
keepPatterns: ['^ERROR:', '^FATAL:'],
|
|
382
|
+
timeout: 2000
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
}]
|
|
386
|
+
}
|
|
387
|
+
});
|
|
388
|
+
```
|
|
389
|
+
|
|
390
|
+
### Performance Monitoring
|
|
391
|
+
|
|
392
|
+
```typescript
|
|
393
|
+
import { getPerformanceMonitor } from '@mcpilotx/intentorch';
|
|
394
|
+
|
|
395
|
+
const monitor = getPerformanceMonitor();
|
|
396
|
+
|
|
397
|
+
// Monitor workflow execution
|
|
398
|
+
monitor.on('workflow_start', (data) => {
|
|
399
|
+
console.log(`Workflow started: ${data.query}`);
|
|
400
|
+
});
|
|
401
|
+
|
|
402
|
+
monitor.on('workflow_complete', (data) => {
|
|
403
|
+
console.log(`Workflow completed in ${data.duration}ms`);
|
|
404
|
+
});
|
|
405
|
+
|
|
406
|
+
// Get performance report
|
|
407
|
+
setInterval(async () => {
|
|
408
|
+
const report = await monitor.getReport();
|
|
409
|
+
console.log('Performance Report:', report);
|
|
410
|
+
}, 60000);
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
## ๐งช Testing & Development
|
|
414
|
+
|
|
415
|
+
### Running Tests
|
|
416
|
+
|
|
417
|
+
```bash
|
|
418
|
+
# Run all tests
|
|
419
|
+
npm test
|
|
420
|
+
|
|
421
|
+
# Run with coverage
|
|
422
|
+
npm test -- --coverage
|
|
423
|
+
|
|
424
|
+
# Run specific test suite
|
|
425
|
+
npm test -- tests/integration.test.ts
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
### Building from Source
|
|
429
|
+
|
|
430
|
+
```bash
|
|
431
|
+
# Clone repository
|
|
432
|
+
git clone https://github.com/MCPilotX/IntentOrch.git
|
|
433
|
+
cd IntentOrch
|
|
434
|
+
|
|
435
|
+
# Install dependencies
|
|
436
|
+
npm install
|
|
437
|
+
|
|
438
|
+
# Build the SDK
|
|
439
|
+
npm run build
|
|
440
|
+
|
|
441
|
+
# Run examples
|
|
442
|
+
npm run examples
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
### Current Test Status
|
|
446
|
+
|
|
447
|
+
| Module | Statements | Branches | Functions | Lines | Status |
|
|
448
|
+
|--------|------------|----------|-----------|-------|--------|
|
|
449
|
+
| **Overall** | 14.57% | 9.31% | 17.24% | 14.74% | โ
|
|
|
450
|
+
| **ToolRegistry** | 100% | 90% | 100% | 100% | ๐ Excellent |
|
|
451
|
+
| **MCP Client** | 65.18% | 50% | 50% | 66.66% | ๐ Good |
|
|
452
|
+
| **MCP Transport** | 48.14% | 40.42% | 36.84% | 47.64% | ๐ Improving |
|
|
453
|
+
|
|
454
|
+
**Total Tests:** 209 tests (100% passing)
|
|
455
|
+
|
|
456
|
+
## ๐ API Reference
|
|
457
|
+
|
|
458
|
+
### Core SDK Methods
|
|
459
|
+
|
|
460
|
+
| Method | Description | Example |
|
|
461
|
+
|--------|-------------|---------|
|
|
462
|
+
| `createSDK()` | Create SDK instance | `const sdk = createSDK()` |
|
|
463
|
+
| `sdk.executeIntent()` | Execute intent-driven workflow | `await sdk.executeIntent("Analyze project")` |
|
|
464
|
+
| `sdk.parseAndPlan()` | Parse intent and create plan | `await sdk.parseAndPlan("Complex task")` |
|
|
465
|
+
| `sdk.configureAI()` | Configure AI provider | `await sdk.configureAI(config)` |
|
|
466
|
+
| `sdk.connectMCPServer()` | Connect to MCP server | `await sdk.connectMCPServer(config)` |
|
|
467
|
+
| `sdk.initCloudIntentEngine()` | Initialize intent engine | `await sdk.initCloudIntentEngine()` |
|
|
468
|
+
|
|
469
|
+
### Tool Registry Methods
|
|
470
|
+
|
|
471
|
+
| Method | Description |
|
|
472
|
+
|--------|-------------|
|
|
473
|
+
| `sdk.toolRegistry.registerTool()` | Register custom tool |
|
|
474
|
+
| `sdk.listTools()` | List all available tools |
|
|
475
|
+
| `sdk.searchTools()` | Search tools by name/description |
|
|
476
|
+
| `sdk.executeTool()` | Execute specific tool |
|
|
477
|
+
|
|
478
|
+
### Runtime Detection
|
|
479
|
+
|
|
480
|
+
```typescript
|
|
481
|
+
import { EnhancedRuntimeDetector } from '@mcpilotx/intentorch';
|
|
482
|
+
|
|
483
|
+
const detection = await EnhancedRuntimeDetector.detect('.');
|
|
484
|
+
console.log('Runtime:', detection.runtime); // 'node', 'python', 'docker', etc.
|
|
485
|
+
console.log('Confidence:', detection.confidence);
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
## ๐ฏ Use Cases
|
|
489
|
+
|
|
490
|
+
### 1. **AI-Powered Development Tools**
|
|
491
|
+
Build VS Code extensions, CLI tools, or IDEs that understand developer intent and execute complex tasks autonomously.
|
|
492
|
+
|
|
493
|
+
### 2. **Automated Workflow Orchestration**
|
|
494
|
+
Create intelligent automation that can read files, call APIs, make decisions, and generate reports.
|
|
495
|
+
|
|
496
|
+
### 3. **Intelligent Chat Applications**
|
|
497
|
+
Build chatbots with access to tools and external data sources that can actually *do things*.
|
|
498
|
+
|
|
499
|
+
### 4. **DevOps Automation**
|
|
500
|
+
Automate infrastructure management, deployment, and monitoring with AI-driven decision making.
|
|
501
|
+
|
|
502
|
+
### 5. **Educational Tools**
|
|
503
|
+
Create interactive learning environments with AI tutors that can demonstrate concepts through action.
|
|
504
|
+
|
|
505
|
+
## ๐ค Contributing
|
|
506
|
+
|
|
507
|
+
We welcome contributions! Please see our [Contributing Guide](docs/development.md) for details.
|
|
508
|
+
|
|
509
|
+
### Quick Contribution Steps:
|
|
510
|
+
1. Fork the repository
|
|
511
|
+
2. Create a feature branch
|
|
512
|
+
3. Make your changes
|
|
513
|
+
4. Run tests: `npm test`
|
|
514
|
+
5. Submit a pull request
|
|
515
|
+
|
|
516
|
+
## ๐ License
|
|
517
|
+
|
|
518
|
+
Apache 2.0 - See [LICENSE](LICENSE) for details.
|
|
519
|
+
|
|
520
|
+
## ๐ Support
|
|
521
|
+
|
|
522
|
+
- **Documentation**: See [docs/](docs/) for detailed guides
|
|
523
|
+
- **Issues**: [GitHub Issues](https://github.com/MCPilotX/IntentOrch/issues)
|
|
524
|
+
- **Examples**: Check [examples/](examples/) directory
|
|
525
|
+
- **Community**: Join our Discord/Slack (link in GitHub)
|
|
526
|
+
|
|
527
|
+
## ๐ Ready to Build?
|
|
528
|
+
|
|
529
|
+
Start transforming natural language into executable workflows today!
|
|
530
|
+
|
|
531
|
+
```typescript
|
|
532
|
+
import { createSDK } from '@mcpilotx/intentorch';
|
|
533
|
+
|
|
534
|
+
const sdk = createSDK();
|
|
535
|
+
const future = await sdk.executeIntent(
|
|
536
|
+
"What amazing things can I build with IntentOrch?"
|
|
537
|
+
);
|
|
538
|
+
console.log(future.answer);
|
|
539
|
+
```
|
|
540
|
+
|
|
541
|
+
---
|
|
542
|
+
|
|
543
|
+
**Built with โค๏ธ by the MCPilot Team**
|
|
544
|
+
|
|
545
|
+
*IntentOrch: Where intent meets execution.*
|