@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.
Files changed (101) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +545 -0
  3. package/dist/ai/ai.d.ts +205 -0
  4. package/dist/ai/ai.js +1200 -0
  5. package/dist/ai/cloud-intent-engine.d.ts +270 -0
  6. package/dist/ai/cloud-intent-engine.js +956 -0
  7. package/dist/ai/command.d.ts +59 -0
  8. package/dist/ai/command.js +285 -0
  9. package/dist/ai/config.d.ts +66 -0
  10. package/dist/ai/config.js +211 -0
  11. package/dist/ai/enhanced-intent.d.ts +17 -0
  12. package/dist/ai/enhanced-intent.js +32 -0
  13. package/dist/ai/index.d.ts +29 -0
  14. package/dist/ai/index.js +44 -0
  15. package/dist/ai/intent.d.ts +16 -0
  16. package/dist/ai/intent.js +30 -0
  17. package/dist/core/ai-config.d.ts +25 -0
  18. package/dist/core/ai-config.js +326 -0
  19. package/dist/core/config-manager.d.ts +36 -0
  20. package/dist/core/config-manager.js +400 -0
  21. package/dist/core/config-validator.d.ts +9 -0
  22. package/dist/core/config-validator.js +184 -0
  23. package/dist/core/constants.d.ts +34 -0
  24. package/dist/core/constants.js +37 -0
  25. package/dist/core/error-ai.d.ts +23 -0
  26. package/dist/core/error-ai.js +217 -0
  27. package/dist/core/error-handler.d.ts +197 -0
  28. package/dist/core/error-handler.js +467 -0
  29. package/dist/core/index.d.ts +13 -0
  30. package/dist/core/index.js +17 -0
  31. package/dist/core/logger.d.ts +27 -0
  32. package/dist/core/logger.js +108 -0
  33. package/dist/core/performance-monitor.d.ts +74 -0
  34. package/dist/core/performance-monitor.js +260 -0
  35. package/dist/core/providers.d.ts +36 -0
  36. package/dist/core/providers.js +304 -0
  37. package/dist/core/retry-manager.d.ts +41 -0
  38. package/dist/core/retry-manager.js +204 -0
  39. package/dist/core/types.d.ts +155 -0
  40. package/dist/core/types.js +2 -0
  41. package/dist/daemon/index.d.ts +10 -0
  42. package/dist/daemon/index.js +15 -0
  43. package/dist/daemon/intent-engine.d.ts +22 -0
  44. package/dist/daemon/intent-engine.js +50 -0
  45. package/dist/daemon/orchestrator.d.ts +24 -0
  46. package/dist/daemon/orchestrator.js +100 -0
  47. package/dist/daemon/pm.d.ts +33 -0
  48. package/dist/daemon/pm.js +127 -0
  49. package/dist/daemon/process.d.ts +11 -0
  50. package/dist/daemon/process.js +49 -0
  51. package/dist/daemon/server.d.ts +17 -0
  52. package/dist/daemon/server.js +435 -0
  53. package/dist/daemon/service.d.ts +36 -0
  54. package/dist/daemon/service.js +278 -0
  55. package/dist/index.d.ts +30 -0
  56. package/dist/index.js +36 -0
  57. package/dist/mcp/client.d.ts +51 -0
  58. package/dist/mcp/client.js +276 -0
  59. package/dist/mcp/index.d.ts +162 -0
  60. package/dist/mcp/index.js +199 -0
  61. package/dist/mcp/tool-registry.d.ts +71 -0
  62. package/dist/mcp/tool-registry.js +308 -0
  63. package/dist/mcp/transport.d.ts +83 -0
  64. package/dist/mcp/transport.js +515 -0
  65. package/dist/mcp/types.d.ts +136 -0
  66. package/dist/mcp/types.js +31 -0
  67. package/dist/runtime/adapter-advanced.d.ts +184 -0
  68. package/dist/runtime/adapter-advanced.js +160 -0
  69. package/dist/runtime/adapter.d.ts +9 -0
  70. package/dist/runtime/adapter.js +2 -0
  71. package/dist/runtime/detector-advanced.d.ts +59 -0
  72. package/dist/runtime/detector-advanced.js +487 -0
  73. package/dist/runtime/detector.d.ts +5 -0
  74. package/dist/runtime/detector.js +56 -0
  75. package/dist/runtime/docker-adapter.d.ts +18 -0
  76. package/dist/runtime/docker-adapter.js +170 -0
  77. package/dist/runtime/docker.d.ts +17 -0
  78. package/dist/runtime/docker.js +71 -0
  79. package/dist/runtime/executable-analyzer.d.ts +56 -0
  80. package/dist/runtime/executable-analyzer.js +391 -0
  81. package/dist/runtime/go-adapter.d.ts +19 -0
  82. package/dist/runtime/go-adapter.js +190 -0
  83. package/dist/runtime/index.d.ts +9 -0
  84. package/dist/runtime/index.js +10 -0
  85. package/dist/runtime/node-adapter.d.ts +10 -0
  86. package/dist/runtime/node-adapter.js +23 -0
  87. package/dist/runtime/node.d.ts +20 -0
  88. package/dist/runtime/node.js +86 -0
  89. package/dist/runtime/python-adapter.d.ts +11 -0
  90. package/dist/runtime/python-adapter.js +102 -0
  91. package/dist/runtime/python.d.ts +17 -0
  92. package/dist/runtime/python.js +72 -0
  93. package/dist/runtime/rust-adapter.d.ts +21 -0
  94. package/dist/runtime/rust-adapter.js +267 -0
  95. package/dist/sdk.d.ts +500 -0
  96. package/dist/sdk.js +904 -0
  97. package/docs/README.ZH_CN.md +545 -0
  98. package/docs/api.md +888 -0
  99. package/docs/architecture.md +731 -0
  100. package/docs/development.md +744 -0
  101. package/package.json +112 -0
@@ -0,0 +1,205 @@
1
+ /**
2
+ * Simplified AI Core Service
3
+ * Focused on converting natural language to MCP tool calls
4
+ */
5
+ export type AIProvider = 'openai' | 'anthropic' | 'google' | 'azure' | 'deepseek' | 'ollama' | 'none';
6
+ export interface SimpleAIConfig {
7
+ provider: AIProvider;
8
+ apiKey?: string;
9
+ endpoint?: string;
10
+ model?: string;
11
+ apiVersion?: string;
12
+ region?: string;
13
+ }
14
+ export interface AskResult {
15
+ type: 'tool_call' | 'suggestions' | 'error';
16
+ tool?: ToolCall;
17
+ suggestions?: string[];
18
+ message?: string;
19
+ help?: string;
20
+ confidence?: number;
21
+ }
22
+ export interface ToolCall {
23
+ service: string;
24
+ tool: string;
25
+ params: Record<string, any>;
26
+ }
27
+ export declare class AIError extends Error {
28
+ code: string;
29
+ message: string;
30
+ category: 'config' | 'connection' | 'execution';
31
+ suggestions: string[];
32
+ constructor(code: string, message: string, category: 'config' | 'connection' | 'execution', suggestions?: string[]);
33
+ }
34
+ /**
35
+ * Simplified AI Core Service
36
+ */
37
+ export declare class SimpleAI {
38
+ private config;
39
+ private enabled;
40
+ private client;
41
+ constructor();
42
+ /**
43
+ * Configure AI service
44
+ */
45
+ configure(config: SimpleAIConfig): Promise<void>;
46
+ /**
47
+ * Initialize AI client
48
+ */
49
+ private initializeClient;
50
+ /**
51
+ * Test AI connection
52
+ */
53
+ testConnection(): Promise<{
54
+ success: boolean;
55
+ message: string;
56
+ }>;
57
+ /**
58
+ * Test OpenAI connection
59
+ */
60
+ private testOpenAIConnection;
61
+ /**
62
+ * Test Anthropic connection
63
+ */
64
+ private testAnthropicConnection;
65
+ /**
66
+ * Test Google (Gemini) connection
67
+ */
68
+ private testGoogleConnection;
69
+ /**
70
+ * Test Azure OpenAI connection
71
+ */
72
+ private testAzureConnection;
73
+ /**
74
+ * Test DeepSeek connection
75
+ */
76
+ private testDeepSeekConnection;
77
+ /**
78
+ * Test Ollama connection
79
+ */
80
+ private testOllamaConnection;
81
+ /**
82
+ * Process natural language query
83
+ */
84
+ ask(query: string): Promise<AskResult>;
85
+ /**
86
+ * Analyze intent (simplified version)
87
+ */
88
+ private analyzeIntent;
89
+ /**
90
+ * Analyze intent with LLM (optional)
91
+ */
92
+ private analyzeWithLLM;
93
+ /**
94
+ * Call AI API based on provider
95
+ */
96
+ private callAIAPI;
97
+ /**
98
+ * Get default model for provider
99
+ */
100
+ private getDefaultModel;
101
+ /**
102
+ * Call OpenAI API
103
+ */
104
+ private callOpenAI;
105
+ /**
106
+ * Call Anthropic API
107
+ */
108
+ private callAnthropic;
109
+ /**
110
+ * Call Google (Gemini) API
111
+ */
112
+ private callGoogle;
113
+ /**
114
+ * Call Azure OpenAI API
115
+ */
116
+ private callAzure;
117
+ /**
118
+ * Call DeepSeek API
119
+ */
120
+ private callDeepSeek;
121
+ /**
122
+ * Call Ollama API
123
+ */
124
+ private callOllama;
125
+ /**
126
+ * Parse AI response to extract intent
127
+ */
128
+ private parseAIResponse;
129
+ /**
130
+ * Extract parameters from query
131
+ */
132
+ private extractParams;
133
+ /**
134
+ * Map intent to tool call
135
+ */
136
+ private mapIntentToTool;
137
+ /**
138
+ * Get fallback suggestions (when AI is not available)
139
+ */
140
+ private getFallbackSuggestions;
141
+ /**
142
+ * Get AI status
143
+ */
144
+ getStatus(): {
145
+ enabled: boolean;
146
+ provider: string;
147
+ configured: boolean;
148
+ };
149
+ /**
150
+ * Call raw LLM API with custom messages and options
151
+ * This method supports advanced use cases like function calling, JSON mode, etc.
152
+ */
153
+ callRawAPI(options: {
154
+ messages: Array<{
155
+ role: string;
156
+ content: string;
157
+ }>;
158
+ temperature?: number;
159
+ maxTokens?: number;
160
+ responseFormat?: {
161
+ type: 'text' | 'json_object';
162
+ };
163
+ functions?: Array<{
164
+ name: string;
165
+ description?: string;
166
+ parameters: Record<string, any>;
167
+ }>;
168
+ functionCall?: 'auto' | 'none' | {
169
+ name: string;
170
+ };
171
+ }): Promise<any>;
172
+ /**
173
+ * Call OpenAI raw API
174
+ */
175
+ private callOpenAIRaw;
176
+ /**
177
+ * Call Anthropic raw API
178
+ */
179
+ private callAnthropicRaw;
180
+ /**
181
+ * Call Google raw API
182
+ */
183
+ private callGoogleRaw;
184
+ /**
185
+ * Call Azure OpenAI raw API
186
+ */
187
+ private callAzureRaw;
188
+ /**
189
+ * Call DeepSeek raw API
190
+ */
191
+ private callDeepSeekRaw;
192
+ /**
193
+ * Call Ollama raw API
194
+ */
195
+ private callOllamaRaw;
196
+ /**
197
+ * Reset configuration
198
+ */
199
+ reset(): void;
200
+ /**
201
+ * Get friendly error message
202
+ */
203
+ static getFriendlyError(error: AIError): string;
204
+ }
205
+ //# sourceMappingURL=ai.d.ts.map