@agenticc/core 1.0.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 +21 -0
- package/README.md +370 -0
- package/README.zh-CN.md +372 -0
- package/dist/audit/index.d.ts +9 -0
- package/dist/audit/index.d.ts.map +1 -0
- package/dist/audit/index.js +9 -0
- package/dist/audit/index.js.map +1 -0
- package/dist/audit/logger.d.ts +211 -0
- package/dist/audit/logger.d.ts.map +1 -0
- package/dist/audit/logger.js +268 -0
- package/dist/audit/logger.js.map +1 -0
- package/dist/audit/query.d.ts +164 -0
- package/dist/audit/query.d.ts.map +1 -0
- package/dist/audit/query.js +250 -0
- package/dist/audit/query.js.map +1 -0
- package/dist/conversation/context-builder.d.ts +119 -0
- package/dist/conversation/context-builder.d.ts.map +1 -0
- package/dist/conversation/context-builder.js +252 -0
- package/dist/conversation/context-builder.js.map +1 -0
- package/dist/conversation/index.d.ts +10 -0
- package/dist/conversation/index.d.ts.map +1 -0
- package/dist/conversation/index.js +10 -0
- package/dist/conversation/index.js.map +1 -0
- package/dist/conversation/message-store.d.ts +231 -0
- package/dist/conversation/message-store.d.ts.map +1 -0
- package/dist/conversation/message-store.js +404 -0
- package/dist/conversation/message-store.js.map +1 -0
- package/dist/conversation/session.d.ts +201 -0
- package/dist/conversation/session.d.ts.map +1 -0
- package/dist/conversation/session.js +285 -0
- package/dist/conversation/session.js.map +1 -0
- package/dist/core/agent.d.ts +277 -0
- package/dist/core/agent.d.ts.map +1 -0
- package/dist/core/agent.js +674 -0
- package/dist/core/agent.js.map +1 -0
- package/dist/core/agentic-loop.d.ts +98 -0
- package/dist/core/agentic-loop.d.ts.map +1 -0
- package/dist/core/agentic-loop.js +496 -0
- package/dist/core/agentic-loop.js.map +1 -0
- package/dist/core/index.d.ts +14 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +14 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/intent-parser.d.ts +101 -0
- package/dist/core/intent-parser.d.ts.map +1 -0
- package/dist/core/intent-parser.js +221 -0
- package/dist/core/intent-parser.js.map +1 -0
- package/dist/core/plan-generator.d.ts +133 -0
- package/dist/core/plan-generator.d.ts.map +1 -0
- package/dist/core/plan-generator.js +294 -0
- package/dist/core/plan-generator.js.map +1 -0
- package/dist/core/plugin-manager.d.ts +120 -0
- package/dist/core/plugin-manager.d.ts.map +1 -0
- package/dist/core/plugin-manager.js +369 -0
- package/dist/core/plugin-manager.js.map +1 -0
- package/dist/core/response-handler.d.ts +141 -0
- package/dist/core/response-handler.d.ts.map +1 -0
- package/dist/core/response-handler.js +384 -0
- package/dist/core/response-handler.js.map +1 -0
- package/dist/core/tool-executor.d.ts +143 -0
- package/dist/core/tool-executor.d.ts.map +1 -0
- package/dist/core/tool-executor.js +354 -0
- package/dist/core/tool-executor.js.map +1 -0
- package/dist/core/tool-registry.d.ts +133 -0
- package/dist/core/tool-registry.d.ts.map +1 -0
- package/dist/core/tool-registry.js +252 -0
- package/dist/core/tool-registry.js.map +1 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +47 -0
- package/dist/index.js.map +1 -0
- package/dist/knowledge/chunker.d.ts +78 -0
- package/dist/knowledge/chunker.d.ts.map +1 -0
- package/dist/knowledge/chunker.js +233 -0
- package/dist/knowledge/chunker.js.map +1 -0
- package/dist/knowledge/embedder.d.ts +93 -0
- package/dist/knowledge/embedder.d.ts.map +1 -0
- package/dist/knowledge/embedder.js +205 -0
- package/dist/knowledge/embedder.js.map +1 -0
- package/dist/knowledge/index.d.ts +10 -0
- package/dist/knowledge/index.d.ts.map +1 -0
- package/dist/knowledge/index.js +11 -0
- package/dist/knowledge/index.js.map +1 -0
- package/dist/knowledge/loaders/index.d.ts +10 -0
- package/dist/knowledge/loaders/index.d.ts.map +1 -0
- package/dist/knowledge/loaders/index.js +10 -0
- package/dist/knowledge/loaders/index.js.map +1 -0
- package/dist/knowledge/loaders/markdown.d.ts +88 -0
- package/dist/knowledge/loaders/markdown.d.ts.map +1 -0
- package/dist/knowledge/loaders/markdown.js +205 -0
- package/dist/knowledge/loaders/markdown.js.map +1 -0
- package/dist/knowledge/loaders/yaml.d.ts +112 -0
- package/dist/knowledge/loaders/yaml.d.ts.map +1 -0
- package/dist/knowledge/loaders/yaml.js +368 -0
- package/dist/knowledge/loaders/yaml.js.map +1 -0
- package/dist/knowledge/retriever.d.ts +144 -0
- package/dist/knowledge/retriever.d.ts.map +1 -0
- package/dist/knowledge/retriever.js +399 -0
- package/dist/knowledge/retriever.js.map +1 -0
- package/dist/knowledge/store.d.ts +146 -0
- package/dist/knowledge/store.d.ts.map +1 -0
- package/dist/knowledge/store.js +420 -0
- package/dist/knowledge/store.js.map +1 -0
- package/dist/llm/adapter.d.ts +194 -0
- package/dist/llm/adapter.d.ts.map +1 -0
- package/dist/llm/adapter.js +42 -0
- package/dist/llm/adapter.js.map +1 -0
- package/dist/llm/adapters/anyrouter.d.ts +84 -0
- package/dist/llm/adapters/anyrouter.d.ts.map +1 -0
- package/dist/llm/adapters/anyrouter.js +372 -0
- package/dist/llm/adapters/anyrouter.js.map +1 -0
- package/dist/llm/adapters/claude.d.ts +66 -0
- package/dist/llm/adapters/claude.d.ts.map +1 -0
- package/dist/llm/adapters/claude.js +323 -0
- package/dist/llm/adapters/claude.js.map +1 -0
- package/dist/llm/adapters/index.d.ts +12 -0
- package/dist/llm/adapters/index.d.ts.map +1 -0
- package/dist/llm/adapters/index.js +12 -0
- package/dist/llm/adapters/index.js.map +1 -0
- package/dist/llm/adapters/mimo.d.ts +85 -0
- package/dist/llm/adapters/mimo.d.ts.map +1 -0
- package/dist/llm/adapters/mimo.js +316 -0
- package/dist/llm/adapters/mimo.js.map +1 -0
- package/dist/llm/adapters/openai.d.ts +53 -0
- package/dist/llm/adapters/openai.d.ts.map +1 -0
- package/dist/llm/adapters/openai.js +293 -0
- package/dist/llm/adapters/openai.js.map +1 -0
- package/dist/llm/adapters/qwen.d.ts +53 -0
- package/dist/llm/adapters/qwen.d.ts.map +1 -0
- package/dist/llm/adapters/qwen.js +299 -0
- package/dist/llm/adapters/qwen.js.map +1 -0
- package/dist/llm/adapters/siliconflow.d.ts +69 -0
- package/dist/llm/adapters/siliconflow.d.ts.map +1 -0
- package/dist/llm/adapters/siliconflow.js +331 -0
- package/dist/llm/adapters/siliconflow.js.map +1 -0
- package/dist/llm/index.d.ts +9 -0
- package/dist/llm/index.d.ts.map +1 -0
- package/dist/llm/index.js +12 -0
- package/dist/llm/index.js.map +1 -0
- package/dist/llm/manager.d.ts +97 -0
- package/dist/llm/manager.d.ts.map +1 -0
- package/dist/llm/manager.js +337 -0
- package/dist/llm/manager.js.map +1 -0
- package/dist/test-utils/arbitraries.d.ts +230 -0
- package/dist/test-utils/arbitraries.d.ts.map +1 -0
- package/dist/test-utils/arbitraries.js +280 -0
- package/dist/test-utils/arbitraries.js.map +1 -0
- package/dist/test-utils/cleanup.d.ts +184 -0
- package/dist/test-utils/cleanup.d.ts.map +1 -0
- package/dist/test-utils/cleanup.js +282 -0
- package/dist/test-utils/cleanup.js.map +1 -0
- package/dist/test-utils/config.d.ts +80 -0
- package/dist/test-utils/config.d.ts.map +1 -0
- package/dist/test-utils/config.js +94 -0
- package/dist/test-utils/config.js.map +1 -0
- package/dist/test-utils/index.d.ts +10 -0
- package/dist/test-utils/index.d.ts.map +1 -0
- package/dist/test-utils/index.js +36 -0
- package/dist/test-utils/index.js.map +1 -0
- package/dist/test-utils/mocks.d.ts +170 -0
- package/dist/test-utils/mocks.d.ts.map +1 -0
- package/dist/test-utils/mocks.js +281 -0
- package/dist/test-utils/mocks.js.map +1 -0
- package/dist/types/config.d.ts +170 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +120 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/knowledge.d.ts +95 -0
- package/dist/types/knowledge.d.ts.map +1 -0
- package/dist/types/knowledge.js +7 -0
- package/dist/types/knowledge.js.map +1 -0
- package/dist/types/loop.d.ts +148 -0
- package/dist/types/loop.d.ts.map +1 -0
- package/dist/types/loop.js +16 -0
- package/dist/types/loop.js.map +1 -0
- package/dist/types/plugin.d.ts +137 -0
- package/dist/types/plugin.d.ts.map +1 -0
- package/dist/types/plugin.js +15 -0
- package/dist/types/plugin.js.map +1 -0
- package/dist/types/response.d.ts +186 -0
- package/dist/types/response.d.ts.map +1 -0
- package/dist/types/response.js +99 -0
- package/dist/types/response.js.map +1 -0
- package/dist/types/streaming.d.ts +478 -0
- package/dist/types/streaming.d.ts.map +1 -0
- package/dist/types/streaming.js +483 -0
- package/dist/types/streaming.js.map +1 -0
- package/dist/types/tool.d.ts +118 -0
- package/dist/types/tool.d.ts.map +1 -0
- package/dist/types/tool.js +42 -0
- package/dist/types/tool.js.map +1 -0
- package/dist/utils/error.d.ts +22 -0
- package/dist/utils/error.d.ts.map +1 -0
- package/dist/utils/error.js +36 -0
- package/dist/utils/error.js.map +1 -0
- package/package.json +102 -0
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plan Generator
|
|
3
|
+
*
|
|
4
|
+
* Generates execution plans based on parsed intent and retrieved knowledge.
|
|
5
|
+
* Determines which tools to call and in what order.
|
|
6
|
+
*
|
|
7
|
+
* _Requirements: 1.3_
|
|
8
|
+
*/
|
|
9
|
+
const DEFAULT_SYSTEM_PROMPT = `You are a plan generator for a game server management system.
|
|
10
|
+
Given a user intent and available tools, generate an execution plan.
|
|
11
|
+
|
|
12
|
+
Your task:
|
|
13
|
+
1. Analyze the intent and determine which tools are needed
|
|
14
|
+
2. Order the tool calls appropriately (dependencies first)
|
|
15
|
+
3. Provide arguments for each tool call
|
|
16
|
+
4. Assess the risk level of the overall plan
|
|
17
|
+
|
|
18
|
+
Respond in JSON format:
|
|
19
|
+
{
|
|
20
|
+
"success": true/false,
|
|
21
|
+
"plan": {
|
|
22
|
+
"description": "Overall plan description",
|
|
23
|
+
"riskLevel": "low|medium|high",
|
|
24
|
+
"requiresConfirmation": true/false,
|
|
25
|
+
"confidence": 0.0-1.0,
|
|
26
|
+
"steps": [
|
|
27
|
+
{
|
|
28
|
+
"stepNumber": 1,
|
|
29
|
+
"toolName": "tool_name",
|
|
30
|
+
"arguments": { "arg1": "value1" },
|
|
31
|
+
"description": "What this step does",
|
|
32
|
+
"dependsOnPrevious": false,
|
|
33
|
+
"condition": "optional condition"
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
"failureReason": "reason if success is false",
|
|
38
|
+
"missingInfo": ["list of missing information"],
|
|
39
|
+
"suggestions": ["alternative suggestions"]
|
|
40
|
+
}`;
|
|
41
|
+
/**
|
|
42
|
+
* Plan Generator
|
|
43
|
+
*
|
|
44
|
+
* Uses LLM to generate execution plans based on intent and available tools.
|
|
45
|
+
*/
|
|
46
|
+
export class PlanGenerator {
|
|
47
|
+
llmManager;
|
|
48
|
+
toolRegistry;
|
|
49
|
+
config;
|
|
50
|
+
planCounter = 0;
|
|
51
|
+
constructor(llmManager, toolRegistry, config) {
|
|
52
|
+
this.llmManager = llmManager;
|
|
53
|
+
this.toolRegistry = toolRegistry;
|
|
54
|
+
this.config = {
|
|
55
|
+
systemPrompt: config?.systemPrompt ?? DEFAULT_SYSTEM_PROMPT,
|
|
56
|
+
maxSteps: config?.maxSteps ?? 10,
|
|
57
|
+
requireConfirmationForHighRisk: config?.requireConfirmationForHighRisk ?? true,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Generate an execution plan based on intent and knowledge
|
|
62
|
+
*
|
|
63
|
+
* @param intent - Parsed user intent
|
|
64
|
+
* @param knowledge - Retrieved knowledge results
|
|
65
|
+
* @param history - Optional conversation history
|
|
66
|
+
* @returns Plan generation result
|
|
67
|
+
*/
|
|
68
|
+
async generate(intent, knowledge, history) {
|
|
69
|
+
const tools = this.toolRegistry.getDefinitions();
|
|
70
|
+
// If no tools available, return failure
|
|
71
|
+
if (tools.length === 0) {
|
|
72
|
+
return {
|
|
73
|
+
success: false,
|
|
74
|
+
failureReason: 'No tools available to execute the request',
|
|
75
|
+
suggestions: ['Register tools before generating plans'],
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
const messages = this.buildMessages(intent, knowledge, tools, history);
|
|
79
|
+
try {
|
|
80
|
+
const response = await this.llmManager.generate('tool_calling', messages, {
|
|
81
|
+
temperature: 0.2,
|
|
82
|
+
});
|
|
83
|
+
return this.parseResponse(response, intent);
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
console.warn('Plan generation failed:', error);
|
|
87
|
+
return {
|
|
88
|
+
success: false,
|
|
89
|
+
failureReason: `Plan generation failed: ${error instanceof Error ? error.message : 'Unknown error'}`,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Build messages for LLM call
|
|
95
|
+
*/
|
|
96
|
+
buildMessages(intent, knowledge, tools, history) {
|
|
97
|
+
const messages = [{ role: 'system', content: this.config.systemPrompt }];
|
|
98
|
+
// Add conversation history
|
|
99
|
+
if (history && history.length > 0) {
|
|
100
|
+
messages.push(...history.slice(-3)); // Last 3 messages for context
|
|
101
|
+
}
|
|
102
|
+
// Build user message with context
|
|
103
|
+
const userMessage = this.buildUserMessage(intent, knowledge, tools);
|
|
104
|
+
messages.push({ role: 'user', content: userMessage });
|
|
105
|
+
return messages;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Build the user message with all context
|
|
109
|
+
*/
|
|
110
|
+
buildUserMessage(intent, knowledge, tools) {
|
|
111
|
+
const parts = [];
|
|
112
|
+
// Intent information
|
|
113
|
+
parts.push('## User Intent');
|
|
114
|
+
parts.push(`Action: ${intent.action}`);
|
|
115
|
+
parts.push(`Operation Type: ${intent.operationType}`);
|
|
116
|
+
if (intent.target) {
|
|
117
|
+
parts.push(`Target: ${intent.target}`);
|
|
118
|
+
}
|
|
119
|
+
if (intent.entities.length > 0) {
|
|
120
|
+
parts.push(`Entities: ${intent.entities.join(', ')}`);
|
|
121
|
+
}
|
|
122
|
+
if (intent.parameters) {
|
|
123
|
+
parts.push(`Parameters: ${JSON.stringify(intent.parameters)}`);
|
|
124
|
+
}
|
|
125
|
+
parts.push(`Original Message: ${intent.originalMessage}`);
|
|
126
|
+
parts.push('');
|
|
127
|
+
// Available tools
|
|
128
|
+
parts.push('## Available Tools');
|
|
129
|
+
for (const tool of tools) {
|
|
130
|
+
parts.push(`- ${tool.function.name}: ${tool.function.description}`);
|
|
131
|
+
const params = tool.function.parameters;
|
|
132
|
+
if (params.required.length > 0) {
|
|
133
|
+
parts.push(` Required params: ${params.required.join(', ')}`);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
parts.push('');
|
|
137
|
+
// Retrieved knowledge
|
|
138
|
+
if (knowledge.length > 0) {
|
|
139
|
+
parts.push('## Relevant Knowledge');
|
|
140
|
+
for (const result of knowledge.slice(0, 5)) {
|
|
141
|
+
parts.push(`- [${result.document.category}] ${result.document.title || 'Untitled'}`);
|
|
142
|
+
parts.push(` ${result.document.content.slice(0, 200)}...`);
|
|
143
|
+
}
|
|
144
|
+
parts.push('');
|
|
145
|
+
}
|
|
146
|
+
parts.push('Generate an execution plan based on the above information.');
|
|
147
|
+
return parts.join('\n');
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Parse LLM response into PlanGenerationResult
|
|
151
|
+
*/
|
|
152
|
+
parseResponse(response, intent) {
|
|
153
|
+
try {
|
|
154
|
+
// Extract JSON from response
|
|
155
|
+
const jsonMatch = response.match(/```(?:json)?\s*([\s\S]*?)```/) || response.match(/\{[\s\S]*\}/);
|
|
156
|
+
const jsonStr = jsonMatch ? (jsonMatch[1] || jsonMatch[0]).trim() : response.trim();
|
|
157
|
+
const parsed = JSON.parse(jsonStr);
|
|
158
|
+
if (!parsed.success) {
|
|
159
|
+
return {
|
|
160
|
+
success: false,
|
|
161
|
+
failureReason: parsed.failureReason || 'Plan generation failed',
|
|
162
|
+
missingInfo: parsed.missingInfo,
|
|
163
|
+
suggestions: parsed.suggestions,
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
const plan = this.validateAndBuildPlan(parsed.plan, intent);
|
|
167
|
+
return {
|
|
168
|
+
success: true,
|
|
169
|
+
plan,
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
catch (error) {
|
|
173
|
+
console.warn('Failed to parse plan response:', error);
|
|
174
|
+
return {
|
|
175
|
+
success: false,
|
|
176
|
+
failureReason: 'Failed to parse plan generation response',
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Validate and build execution plan from parsed response
|
|
182
|
+
*/
|
|
183
|
+
validateAndBuildPlan(rawPlan, intent) {
|
|
184
|
+
const steps = [];
|
|
185
|
+
const rawSteps = Array.isArray(rawPlan.steps) ? rawPlan.steps : [];
|
|
186
|
+
for (let i = 0; i < Math.min(rawSteps.length, this.config.maxSteps); i++) {
|
|
187
|
+
const rawStep = rawSteps[i];
|
|
188
|
+
// Validate tool exists
|
|
189
|
+
const toolName = String(rawStep.toolName || '');
|
|
190
|
+
if (!this.toolRegistry.has(toolName)) {
|
|
191
|
+
console.warn(`Unknown tool in plan: ${toolName}`);
|
|
192
|
+
continue;
|
|
193
|
+
}
|
|
194
|
+
steps.push({
|
|
195
|
+
stepNumber: i + 1,
|
|
196
|
+
toolName,
|
|
197
|
+
arguments: typeof rawStep.arguments === 'object' && rawStep.arguments !== null
|
|
198
|
+
? rawStep.arguments
|
|
199
|
+
: {},
|
|
200
|
+
description: String(rawStep.description || `Execute ${toolName}`),
|
|
201
|
+
dependsOnPrevious: Boolean(rawStep.dependsOnPrevious),
|
|
202
|
+
condition: rawStep.condition ? String(rawStep.condition) : undefined,
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
const riskLevel = this.validateRiskLevel(rawPlan.riskLevel);
|
|
206
|
+
const requiresConfirmation = this.config.requireConfirmationForHighRisk &&
|
|
207
|
+
(riskLevel === 'high' || Boolean(rawPlan.requiresConfirmation));
|
|
208
|
+
return {
|
|
209
|
+
id: this.generatePlanId(),
|
|
210
|
+
steps,
|
|
211
|
+
description: String(rawPlan.description || 'Execution plan'),
|
|
212
|
+
riskLevel,
|
|
213
|
+
requiresConfirmation,
|
|
214
|
+
confidence: typeof rawPlan.confidence === 'number' ? Math.max(0, Math.min(1, rawPlan.confidence)) : 0.5,
|
|
215
|
+
intent,
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Validate risk level
|
|
220
|
+
*/
|
|
221
|
+
validateRiskLevel(level) {
|
|
222
|
+
if (level === 'low' || level === 'medium' || level === 'high') {
|
|
223
|
+
return level;
|
|
224
|
+
}
|
|
225
|
+
return 'medium';
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Generate unique plan ID
|
|
229
|
+
*/
|
|
230
|
+
generatePlanId() {
|
|
231
|
+
this.planCounter++;
|
|
232
|
+
return `plan_${Date.now()}_${this.planCounter}`;
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Create a simple single-step plan for direct tool calls
|
|
236
|
+
*/
|
|
237
|
+
createDirectPlan(toolName, args, intent) {
|
|
238
|
+
const tool = this.toolRegistry.get(toolName);
|
|
239
|
+
const riskLevel = tool?.riskLevel ?? 'low';
|
|
240
|
+
return {
|
|
241
|
+
id: this.generatePlanId(),
|
|
242
|
+
steps: [
|
|
243
|
+
{
|
|
244
|
+
stepNumber: 1,
|
|
245
|
+
toolName,
|
|
246
|
+
arguments: args,
|
|
247
|
+
description: `Execute ${toolName}`,
|
|
248
|
+
dependsOnPrevious: false,
|
|
249
|
+
},
|
|
250
|
+
],
|
|
251
|
+
description: `Direct execution of ${toolName}`,
|
|
252
|
+
riskLevel,
|
|
253
|
+
requiresConfirmation: tool?.requiresConfirmation ??
|
|
254
|
+
(this.config.requireConfirmationForHighRisk && riskLevel === 'high'),
|
|
255
|
+
confidence: 1.0,
|
|
256
|
+
intent,
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Estimate risk level based on operation type and tools
|
|
261
|
+
*/
|
|
262
|
+
estimateRiskLevel(intent, toolNames) {
|
|
263
|
+
// High risk operations
|
|
264
|
+
if (intent.operationType === 'delete') {
|
|
265
|
+
return 'high';
|
|
266
|
+
}
|
|
267
|
+
// Check tool risk levels
|
|
268
|
+
for (const name of toolNames) {
|
|
269
|
+
const tool = this.toolRegistry.get(name);
|
|
270
|
+
if (tool?.riskLevel === 'high') {
|
|
271
|
+
return 'high';
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
// Medium risk operations
|
|
275
|
+
if (intent.operationType === 'update' || intent.operationType === 'configure') {
|
|
276
|
+
return 'medium';
|
|
277
|
+
}
|
|
278
|
+
// Check for medium risk tools
|
|
279
|
+
for (const name of toolNames) {
|
|
280
|
+
const tool = this.toolRegistry.get(name);
|
|
281
|
+
if (tool?.riskLevel === 'medium') {
|
|
282
|
+
return 'medium';
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
return 'low';
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Get current configuration
|
|
289
|
+
*/
|
|
290
|
+
getConfig() {
|
|
291
|
+
return { ...this.config };
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
//# sourceMappingURL=plan-generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plan-generator.js","sourceRoot":"","sources":["../../src/core/plan-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA2EH,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+B5B,CAAC;AAEH;;;;GAIG;AACH,MAAM,OAAO,aAAa;IAChB,UAAU,CAAa;IACvB,YAAY,CAAe;IAC3B,MAAM,CAAgC;IACtC,WAAW,GAAW,CAAC,CAAC;IAEhC,YAAY,UAAsB,EAAE,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C,IAAI,IAAI,EAAE,SAAS,KAAK,QAAQ,EAAE,CAAC;gBACjC,OAAO,QAAQ,CAAC;YAClB,CAAC;QACH,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;OAEG;IACH,SAAS;QACP,OAAO,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;IAC5B,CAAC;CACF"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plugin Manager
|
|
3
|
+
*
|
|
4
|
+
* Manages plugin lifecycle, tool registration, and namespace handling.
|
|
5
|
+
* Provides dependency injection for plugins through PluginContext.
|
|
6
|
+
*
|
|
7
|
+
* @module core/plugin-manager
|
|
8
|
+
*/
|
|
9
|
+
import type { AgentPlugin, PluginContext, PluginInfo, PluginManagerOptions } from '../types/plugin.js';
|
|
10
|
+
import type { Tool, ToolDefinition } from '../types/tool.js';
|
|
11
|
+
/**
|
|
12
|
+
* Error thrown when plugin operations fail
|
|
13
|
+
*/
|
|
14
|
+
export declare class PluginError extends Error {
|
|
15
|
+
readonly pluginName: string;
|
|
16
|
+
readonly reason: string;
|
|
17
|
+
constructor(message: string, pluginName: string, reason: string);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Plugin Manager
|
|
21
|
+
*
|
|
22
|
+
* Handles plugin loading, unloading, and tool management.
|
|
23
|
+
* Supports namespace-based tool isolation, dependency injection, and dependency resolution.
|
|
24
|
+
*/
|
|
25
|
+
export declare class PluginManager {
|
|
26
|
+
private plugins;
|
|
27
|
+
private allTools;
|
|
28
|
+
private options;
|
|
29
|
+
private context?;
|
|
30
|
+
private loadingPlugins;
|
|
31
|
+
constructor(options?: Partial<PluginManagerOptions>);
|
|
32
|
+
/**
|
|
33
|
+
* Set the plugin context for dependency injection
|
|
34
|
+
*/
|
|
35
|
+
setContext(context: PluginContext): void;
|
|
36
|
+
/**
|
|
37
|
+
* Load a plugin
|
|
38
|
+
*
|
|
39
|
+
* @param plugin - The plugin to load
|
|
40
|
+
* @throws PluginError if loading fails
|
|
41
|
+
*/
|
|
42
|
+
load(plugin: AgentPlugin): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* Load plugin dependencies
|
|
45
|
+
* @private
|
|
46
|
+
*/
|
|
47
|
+
private loadDependencies;
|
|
48
|
+
/**
|
|
49
|
+
* Unload a plugin
|
|
50
|
+
*
|
|
51
|
+
* @param pluginName - Name of the plugin to unload
|
|
52
|
+
* @returns true if unloaded, false if not found
|
|
53
|
+
*/
|
|
54
|
+
unload(pluginName: string): Promise<boolean>;
|
|
55
|
+
/**
|
|
56
|
+
* Get a plugin by name
|
|
57
|
+
*/
|
|
58
|
+
getPlugin(name: string): AgentPlugin | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* Check if a plugin is loaded
|
|
61
|
+
*/
|
|
62
|
+
hasPlugin(name: string): boolean;
|
|
63
|
+
/**
|
|
64
|
+
* List all loaded plugins
|
|
65
|
+
*/
|
|
66
|
+
listPlugins(): PluginInfo[];
|
|
67
|
+
/**
|
|
68
|
+
* Get a tool by name
|
|
69
|
+
*/
|
|
70
|
+
getTool(name: string): Tool | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* Check if a tool exists
|
|
73
|
+
*/
|
|
74
|
+
hasTool(name: string): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* List all tools
|
|
77
|
+
*/
|
|
78
|
+
listTools(): Tool[];
|
|
79
|
+
/**
|
|
80
|
+
* List tool names
|
|
81
|
+
*/
|
|
82
|
+
listToolNames(): string[];
|
|
83
|
+
/**
|
|
84
|
+
* Get tool definitions for LLM Function Calling
|
|
85
|
+
*/
|
|
86
|
+
getToolDefinitions(): ToolDefinition[];
|
|
87
|
+
/**
|
|
88
|
+
* Get the number of loaded plugins
|
|
89
|
+
*/
|
|
90
|
+
get pluginCount(): number;
|
|
91
|
+
/**
|
|
92
|
+
* Get the number of registered tools
|
|
93
|
+
*/
|
|
94
|
+
get toolCount(): number;
|
|
95
|
+
/**
|
|
96
|
+
* Clear all plugins
|
|
97
|
+
*/
|
|
98
|
+
clear(): Promise<void>;
|
|
99
|
+
/**
|
|
100
|
+
* Run health checks on all plugins
|
|
101
|
+
*/
|
|
102
|
+
healthCheck(): Promise<Map<string, boolean>>;
|
|
103
|
+
/**
|
|
104
|
+
* Get namespaced tool name
|
|
105
|
+
*/
|
|
106
|
+
private getNamespacedToolName;
|
|
107
|
+
/**
|
|
108
|
+
* Handle tool name conflict
|
|
109
|
+
*/
|
|
110
|
+
private handleConflict;
|
|
111
|
+
/**
|
|
112
|
+
* Validate plugin definition
|
|
113
|
+
*/
|
|
114
|
+
private validatePlugin;
|
|
115
|
+
/**
|
|
116
|
+
* Validate tool definition
|
|
117
|
+
*/
|
|
118
|
+
private validateTool;
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=plugin-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-manager.d.ts","sourceRoot":"","sources":["../../src/core/plugin-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,WAAW,EACX,aAAa,EACb,UAAU,EACV,oBAAoB,EAErB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAI7D;;GAEG;AACH,qBAAa,WAAY,SAAQ,KAAK;aAGlB,UAAU,EAAE,MAAM;aAClB,MAAM,EAAE,MAAM;gBAF9B,OAAO,EAAE,MAAM,EACC,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM;CAKjC;AAYD;;;;;GAKG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,OAAO,CAAuC;IACtD,OAAO,CAAC,QAAQ,CAAgC;IAChD,OAAO,CAAC,OAAO,CAAuB;IACtC,OAAO,CAAC,OAAO,CAAC,CAAgB;IAChC,OAAO,CAAC,cAAc,CAA0B;gBAEpC,OAAO,GAAE,OAAO,CAAC,oBA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