@vfarcic/dot-ai 1.0.3 → 1.1.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/README.md +1 -0
- package/dist/core/ai-provider.interface.d.ts +12 -8
- package/dist/core/ai-provider.interface.d.ts.map +1 -1
- package/dist/core/artifacthub.d.ts +1 -1
- package/dist/core/artifacthub.d.ts.map +1 -1
- package/dist/core/base-vector-service.d.ts +22 -9
- package/dist/core/base-vector-service.d.ts.map +1 -1
- package/dist/core/base-vector-service.js +106 -37
- package/dist/core/capabilities.d.ts.map +1 -1
- package/dist/core/capabilities.js +5 -2
- package/dist/core/capability-operations.d.ts +55 -7
- package/dist/core/capability-operations.d.ts.map +1 -1
- package/dist/core/capability-operations.js +1 -3
- package/dist/core/capability-scan-workflow.d.ts +64 -8
- package/dist/core/capability-scan-workflow.d.ts.map +1 -1
- package/dist/core/capability-scan-workflow.js +14 -13
- package/dist/core/capability-tools.d.ts +1 -1
- package/dist/core/capability-tools.d.ts.map +1 -1
- package/dist/core/capability-tools.js +1 -1
- package/dist/core/capability-vector-service.d.ts +3 -4
- package/dist/core/capability-vector-service.d.ts.map +1 -1
- package/dist/core/capability-vector-service.js +2 -2
- package/dist/core/command-executor.d.ts +3 -4
- package/dist/core/command-executor.d.ts.map +1 -1
- package/dist/core/command-executor.js +8 -4
- package/dist/core/crd-availability.d.ts +3 -5
- package/dist/core/crd-availability.d.ts.map +1 -1
- package/dist/core/crd-availability.js +8 -18
- package/dist/core/deploy-operation.d.ts +6 -5
- package/dist/core/deploy-operation.d.ts.map +1 -1
- package/dist/core/deploy-operation.js +16 -10
- package/dist/core/discovery.d.ts +6 -14
- package/dist/core/discovery.d.ts.map +1 -1
- package/dist/core/discovery.js +35 -51
- package/dist/core/embedding-service.d.ts.map +1 -1
- package/dist/core/embedding-service.js +1 -1
- package/dist/core/error-handling.d.ts +13 -13
- package/dist/core/error-handling.d.ts.map +1 -1
- package/dist/core/error-handling.js +2 -3
- package/dist/core/generic-session-manager.d.ts +2 -2
- package/dist/core/generic-session-manager.d.ts.map +1 -1
- package/dist/core/helm-types.d.ts +5 -5
- package/dist/core/helm-types.d.ts.map +1 -1
- package/dist/core/index.d.ts +4 -11
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +8 -14
- package/dist/core/knowledge-types.d.ts +114 -0
- package/dist/core/knowledge-types.d.ts.map +1 -0
- package/dist/core/knowledge-types.js +10 -0
- package/dist/core/memory.d.ts +12 -12
- package/dist/core/memory.d.ts.map +1 -1
- package/dist/core/mermaid-tools.d.ts +24 -1
- package/dist/core/mermaid-tools.d.ts.map +1 -1
- package/dist/core/mermaid-tools.js +10 -8
- package/dist/core/packaging.d.ts +23 -1
- package/dist/core/packaging.d.ts.map +1 -1
- package/dist/core/pattern-operations.d.ts +32 -9
- package/dist/core/pattern-operations.d.ts.map +1 -1
- package/dist/core/pattern-operations.js +17 -22
- package/dist/core/pattern-vector-service.d.ts +3 -4
- package/dist/core/pattern-vector-service.d.ts.map +1 -1
- package/dist/core/pattern-vector-service.js +2 -2
- package/dist/core/platform-utils.d.ts +2 -2
- package/dist/core/platform-utils.d.ts.map +1 -1
- package/dist/core/plugin-manager.d.ts +6 -2
- package/dist/core/plugin-manager.d.ts.map +1 -1
- package/dist/core/plugin-manager.js +9 -16
- package/dist/core/plugin-registry.d.ts +59 -0
- package/dist/core/plugin-registry.d.ts.map +1 -0
- package/dist/core/plugin-registry.js +80 -0
- package/dist/core/policy-operations.d.ts +101 -21
- package/dist/core/policy-operations.d.ts.map +1 -1
- package/dist/core/policy-operations.js +45 -47
- package/dist/core/policy-vector-service.d.ts +3 -4
- package/dist/core/policy-vector-service.d.ts.map +1 -1
- package/dist/core/policy-vector-service.js +2 -2
- package/dist/core/providers/host-provider.d.ts +1 -1
- package/dist/core/providers/host-provider.d.ts.map +1 -1
- package/dist/core/providers/host-provider.js +2 -2
- package/dist/core/providers/provider-debug-utils.d.ts +2 -2
- package/dist/core/providers/provider-debug-utils.d.ts.map +1 -1
- package/dist/core/providers/tool-utils.d.ts +10 -2
- package/dist/core/providers/tool-utils.d.ts.map +1 -1
- package/dist/core/providers/tool-utils.js +2 -2
- package/dist/core/providers/vercel-provider.d.ts.map +1 -1
- package/dist/core/providers/vercel-provider.js +29 -23
- package/dist/core/resource-tools.d.ts +29 -1
- package/dist/core/resource-tools.d.ts.map +1 -1
- package/dist/core/resource-vector-service.d.ts +3 -4
- package/dist/core/resource-vector-service.d.ts.map +1 -1
- package/dist/core/resource-vector-service.js +2 -2
- package/dist/core/schema.d.ts +15 -14
- package/dist/core/schema.d.ts.map +1 -1
- package/dist/core/schema.js +32 -34
- package/dist/core/shared-prompt-loader.d.ts +1 -1
- package/dist/core/shared-prompt-loader.d.ts.map +1 -1
- package/dist/core/solution-cr.js +1 -1
- package/dist/core/solution-utils.d.ts +22 -3
- package/dist/core/solution-utils.d.ts.map +1 -1
- package/dist/core/solution-utils.js +1 -1
- package/dist/core/telemetry/client.d.ts +0 -6
- package/dist/core/telemetry/client.d.ts.map +1 -1
- package/dist/core/telemetry/client.js +6 -17
- package/dist/core/telemetry/config.js +1 -1
- package/dist/core/telemetry/index.d.ts +1 -1
- package/dist/core/telemetry/index.d.ts.map +1 -1
- package/dist/core/telemetry/index.js +1 -2
- package/dist/core/tracing/tool-tracing.d.ts +1 -1
- package/dist/core/tracing/tool-tracing.d.ts.map +1 -1
- package/dist/core/unified-creation-session.d.ts +15 -8
- package/dist/core/unified-creation-session.d.ts.map +1 -1
- package/dist/core/unified-creation-session.js +19 -19
- package/dist/core/unified-creation-types.d.ts +2 -2
- package/dist/core/unified-creation-types.d.ts.map +1 -1
- package/dist/core/visualization.d.ts +1 -1
- package/dist/core/visualization.d.ts.map +1 -1
- package/dist/core/workflow.d.ts +8 -5
- package/dist/core/workflow.d.ts.map +1 -1
- package/dist/evaluation/dataset-analyzer.d.ts +13 -7
- package/dist/evaluation/dataset-analyzer.d.ts.map +1 -1
- package/dist/evaluation/dataset-analyzer.js +1 -1
- package/dist/evaluation/datasets/loader.d.ts +2 -2
- package/dist/evaluation/datasets/loader.d.ts.map +1 -1
- package/dist/evaluation/eval-runner.js +7 -5
- package/dist/evaluation/evaluators/base-comparative.d.ts +1 -1
- package/dist/evaluation/evaluators/base-comparative.d.ts.map +1 -1
- package/dist/evaluation/evaluators/base-comparative.js +4 -3
- package/dist/evaluation/evaluators/base.d.ts +5 -5
- package/dist/evaluation/evaluators/base.d.ts.map +1 -1
- package/dist/evaluation/evaluators/capability-comparative.js +1 -1
- package/dist/evaluation/platform-synthesizer.d.ts.map +1 -1
- package/dist/interfaces/mcp.d.ts.map +1 -1
- package/dist/interfaces/mcp.js +26 -15
- package/dist/interfaces/openapi-generator.d.ts +116 -12
- package/dist/interfaces/openapi-generator.d.ts.map +1 -1
- package/dist/interfaces/openapi-generator.js +490 -199
- package/dist/interfaces/rest-api.d.ts +28 -6
- package/dist/interfaces/rest-api.d.ts.map +1 -1
- package/dist/interfaces/rest-api.js +436 -245
- package/dist/interfaces/rest-registry.d.ts +4 -4
- package/dist/interfaces/rest-registry.d.ts.map +1 -1
- package/dist/interfaces/rest-registry.js +6 -5
- package/dist/interfaces/rest-route-registry.d.ts +165 -0
- package/dist/interfaces/rest-route-registry.d.ts.map +1 -0
- package/dist/interfaces/rest-route-registry.js +230 -0
- package/dist/interfaces/routes/index.d.ts +22 -0
- package/dist/interfaces/routes/index.d.ts.map +1 -0
- package/dist/interfaces/routes/index.js +347 -0
- package/dist/interfaces/schemas/common.d.ts +177 -0
- package/dist/interfaces/schemas/common.d.ts.map +1 -0
- package/dist/interfaces/schemas/common.js +102 -0
- package/dist/interfaces/schemas/events.d.ts +131 -0
- package/dist/interfaces/schemas/events.d.ts.map +1 -0
- package/dist/interfaces/schemas/events.js +66 -0
- package/dist/interfaces/schemas/index.d.ts +21 -0
- package/dist/interfaces/schemas/index.d.ts.map +1 -0
- package/dist/interfaces/schemas/index.js +138 -0
- package/dist/interfaces/schemas/knowledge.d.ts +210 -0
- package/dist/interfaces/schemas/knowledge.d.ts.map +1 -0
- package/dist/interfaces/schemas/knowledge.js +117 -0
- package/dist/interfaces/schemas/logs.d.ts +82 -0
- package/dist/interfaces/schemas/logs.d.ts.map +1 -0
- package/dist/interfaces/schemas/logs.js +46 -0
- package/dist/interfaces/schemas/prompts.d.ts +191 -0
- package/dist/interfaces/schemas/prompts.d.ts.map +1 -0
- package/dist/interfaces/schemas/prompts.js +91 -0
- package/dist/interfaces/schemas/resources.d.ts +378 -0
- package/dist/interfaces/schemas/resources.d.ts.map +1 -0
- package/dist/interfaces/schemas/resources.js +173 -0
- package/dist/interfaces/schemas/sessions.d.ts +90 -0
- package/dist/interfaces/schemas/sessions.d.ts.map +1 -0
- package/dist/interfaces/schemas/sessions.js +56 -0
- package/dist/interfaces/schemas/tools.d.ts +194 -0
- package/dist/interfaces/schemas/tools.d.ts.map +1 -0
- package/dist/interfaces/schemas/tools.js +101 -0
- package/dist/interfaces/schemas/visualization.d.ts +373 -0
- package/dist/interfaces/schemas/visualization.d.ts.map +1 -0
- package/dist/interfaces/schemas/visualization.js +134 -0
- package/dist/mcp/server.js +5 -4
- package/dist/tools/answer-question.d.ts +1 -1
- package/dist/tools/answer-question.d.ts.map +1 -1
- package/dist/tools/answer-question.js +9 -8
- package/dist/tools/deploy-manifests.d.ts +4 -2
- package/dist/tools/deploy-manifests.d.ts.map +1 -1
- package/dist/tools/deploy-manifests.js +10 -6
- package/dist/tools/generate-manifests.d.ts.map +1 -1
- package/dist/tools/generate-manifests.js +28 -20
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +6 -1
- package/dist/tools/manage-knowledge.d.ts +77 -0
- package/dist/tools/manage-knowledge.d.ts.map +1 -0
- package/dist/tools/manage-knowledge.js +573 -0
- package/dist/tools/operate-analysis.d.ts +31 -2
- package/dist/tools/operate-analysis.d.ts.map +1 -1
- package/dist/tools/operate-execution.d.ts +2 -3
- package/dist/tools/operate-execution.d.ts.map +1 -1
- package/dist/tools/operate-execution.js +7 -7
- package/dist/tools/operate.d.ts +7 -2
- package/dist/tools/operate.d.ts.map +1 -1
- package/dist/tools/operate.js +2 -2
- package/dist/tools/organizational-data.d.ts +30 -4
- package/dist/tools/organizational-data.d.ts.map +1 -1
- package/dist/tools/organizational-data.js +24 -19
- package/dist/tools/project-setup/discovery.d.ts.map +1 -1
- package/dist/tools/project-setup/generate-scope.d.ts +1 -1
- package/dist/tools/project-setup/generate-scope.d.ts.map +1 -1
- package/dist/tools/project-setup/types.d.ts +1 -0
- package/dist/tools/project-setup/types.d.ts.map +1 -1
- package/dist/tools/prompts.d.ts +28 -2
- package/dist/tools/prompts.d.ts.map +1 -1
- package/dist/tools/query.d.ts +17 -3
- package/dist/tools/query.d.ts.map +1 -1
- package/dist/tools/query.js +1 -7
- package/dist/tools/recommend.d.ts +24 -6
- package/dist/tools/recommend.d.ts.map +1 -1
- package/dist/tools/recommend.js +18 -15
- package/dist/tools/remediate.d.ts +12 -3
- package/dist/tools/remediate.d.ts.map +1 -1
- package/dist/tools/remediate.js +22 -14
- package/dist/tools/version.d.ts +19 -5
- package/dist/tools/version.d.ts.map +1 -1
- package/dist/tools/version.js +106 -54
- package/package.json +11 -5
- package/prompts/knowledge-ask.md +29 -0
- package/dist/core/vector-db-service.d.ts +0 -108
- package/dist/core/vector-db-service.d.ts.map +0 -1
- package/dist/core/vector-db-service.js +0 -647
|
@@ -0,0 +1,573 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Knowledge Base Management Tool
|
|
4
|
+
*
|
|
5
|
+
* MCP tool for managing the knowledge base: ingest documents, search, delete, and retrieve chunks.
|
|
6
|
+
* Documents are chunked (via plugin), embedded, and stored in Qdrant for semantic search.
|
|
7
|
+
*
|
|
8
|
+
* PRD #356: Knowledge Base System
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.MANAGE_KNOWLEDGE_TOOL_INPUT_SCHEMA = exports.MANAGE_KNOWLEDGE_TOOL_DESCRIPTION = exports.MANAGE_KNOWLEDGE_TOOL_NAME = void 0;
|
|
12
|
+
exports.searchKnowledgeBase = searchKnowledgeBase;
|
|
13
|
+
exports.handleManageKnowledgeTool = handleManageKnowledgeTool;
|
|
14
|
+
const zod_1 = require("zod");
|
|
15
|
+
const plugin_registry_1 = require("../core/plugin-registry");
|
|
16
|
+
const embedding_service_1 = require("../core/embedding-service");
|
|
17
|
+
/**
|
|
18
|
+
* Collection name for knowledge base chunks in Qdrant
|
|
19
|
+
*/
|
|
20
|
+
const KNOWLEDGE_COLLECTION = 'knowledge-base';
|
|
21
|
+
// Tool metadata for MCP registration
|
|
22
|
+
exports.MANAGE_KNOWLEDGE_TOOL_NAME = 'manageKnowledge';
|
|
23
|
+
exports.MANAGE_KNOWLEDGE_TOOL_DESCRIPTION = 'Manage the knowledge base: ingest documents, search with natural language, or delete chunks. ' +
|
|
24
|
+
'Use "ingest" to store organizational documentation, "search" to find relevant content semantically, ' +
|
|
25
|
+
'or "deleteByUri" to remove all chunks for a document. ' +
|
|
26
|
+
'TIP: For complex questions, you can call search multiple times with different phrasings to gather ' +
|
|
27
|
+
'comprehensive information before synthesizing your answer.';
|
|
28
|
+
// Input schema using Zod
|
|
29
|
+
exports.MANAGE_KNOWLEDGE_TOOL_INPUT_SCHEMA = {
|
|
30
|
+
operation: zod_1.z
|
|
31
|
+
.enum(['ingest', 'search', 'deleteByUri'])
|
|
32
|
+
.describe('Operation to perform: "ingest" to add documents, "search" for semantic search, "deleteByUri" to remove all chunks for a document.'),
|
|
33
|
+
content: zod_1.z
|
|
34
|
+
.string()
|
|
35
|
+
.optional()
|
|
36
|
+
.describe('Document content to ingest (required for ingest operation).'),
|
|
37
|
+
uri: zod_1.z
|
|
38
|
+
.string()
|
|
39
|
+
.optional()
|
|
40
|
+
.describe('Full URL identifying the document (required for ingest and deleteByUri). ' +
|
|
41
|
+
'E.g., https://github.com/org/repo/blob/main/docs/guide.md'),
|
|
42
|
+
metadata: zod_1.z
|
|
43
|
+
.record(zod_1.z.string(), zod_1.z.unknown())
|
|
44
|
+
.optional()
|
|
45
|
+
.describe('Optional metadata to store with chunks'),
|
|
46
|
+
query: zod_1.z
|
|
47
|
+
.string()
|
|
48
|
+
.optional()
|
|
49
|
+
.describe('Natural language search query (required for search operation).'),
|
|
50
|
+
limit: zod_1.z
|
|
51
|
+
.number()
|
|
52
|
+
.optional()
|
|
53
|
+
.describe('Maximum number of results to return for search (default: 20).'),
|
|
54
|
+
uriFilter: zod_1.z
|
|
55
|
+
.string()
|
|
56
|
+
.optional()
|
|
57
|
+
.describe('Optional URL prefix to filter search results (e.g., "https://github.com/org/repo/").'),
|
|
58
|
+
interaction_id: zod_1.z.string().optional().describe('INTERNAL ONLY - Do not populate.'),
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* Plugin name for agentic-tools
|
|
62
|
+
*/
|
|
63
|
+
const PLUGIN_NAME = 'agentic-tools';
|
|
64
|
+
/**
|
|
65
|
+
* Create error response matching other tool patterns
|
|
66
|
+
*/
|
|
67
|
+
function createErrorResponse(message, details) {
|
|
68
|
+
return {
|
|
69
|
+
success: false,
|
|
70
|
+
error: { message, ...details },
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Handle the ingest operation
|
|
75
|
+
*/
|
|
76
|
+
async function handleIngestOperation(args, logger, requestId) {
|
|
77
|
+
const { content, uri, metadata } = args;
|
|
78
|
+
// Validate required parameters
|
|
79
|
+
if (!content) {
|
|
80
|
+
return createErrorResponse('Missing required parameter: content', {
|
|
81
|
+
operation: 'ingest',
|
|
82
|
+
hint: 'Provide the document content to ingest',
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
if (!uri) {
|
|
86
|
+
return createErrorResponse('Missing required parameter: uri', {
|
|
87
|
+
operation: 'ingest',
|
|
88
|
+
hint: 'Provide the full URL identifying the document (e.g., https://github.com/org/repo/blob/main/docs/guide.md)',
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
// Check plugin availability
|
|
92
|
+
if (!(0, plugin_registry_1.isPluginInitialized)()) {
|
|
93
|
+
return createErrorResponse('Plugin system not available', {
|
|
94
|
+
operation: 'ingest',
|
|
95
|
+
hint: 'The agentic-tools plugin must be running for knowledge base operations',
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
// Check embedding service availability
|
|
99
|
+
const embeddingService = new embedding_service_1.EmbeddingService();
|
|
100
|
+
if (!embeddingService.isAvailable()) {
|
|
101
|
+
const status = embeddingService.getStatus();
|
|
102
|
+
return createErrorResponse('Embedding service not available', {
|
|
103
|
+
operation: 'ingest',
|
|
104
|
+
reason: status.reason,
|
|
105
|
+
hint: 'Set OPENAI_API_KEY environment variable to enable embeddings',
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
logger.info('Starting document ingestion', {
|
|
109
|
+
requestId,
|
|
110
|
+
uri,
|
|
111
|
+
contentSize: Buffer.byteLength(content, 'utf8'),
|
|
112
|
+
hasMetadata: !!metadata,
|
|
113
|
+
});
|
|
114
|
+
try {
|
|
115
|
+
// Step 1: Delete any existing chunks for this URI (ensures clean replacement)
|
|
116
|
+
const deletedCount = await deleteChunksByUri(uri, logger, requestId);
|
|
117
|
+
if (deletedCount > 0) {
|
|
118
|
+
logger.info('Deleted existing chunks before re-ingestion', {
|
|
119
|
+
requestId,
|
|
120
|
+
uri,
|
|
121
|
+
chunksDeleted: deletedCount,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
// Step 2: Chunk the document
|
|
125
|
+
logger.debug('Calling knowledge_chunk plugin tool', { requestId, uri });
|
|
126
|
+
const chunkResponse = await (0, plugin_registry_1.invokePluginTool)(PLUGIN_NAME, 'knowledge_chunk', {
|
|
127
|
+
content,
|
|
128
|
+
uri,
|
|
129
|
+
});
|
|
130
|
+
if (!chunkResponse.success) {
|
|
131
|
+
const error = chunkResponse.error;
|
|
132
|
+
const errorMessage = error?.message || 'Chunking failed';
|
|
133
|
+
logger.error('Plugin chunking failed', new Error(errorMessage), { requestId, uri });
|
|
134
|
+
return createErrorResponse('Document chunking failed', {
|
|
135
|
+
operation: 'ingest',
|
|
136
|
+
error: errorMessage,
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
// Extract chunk data from plugin response
|
|
140
|
+
const chunkResult = chunkResponse.result;
|
|
141
|
+
if (!chunkResult.success || !chunkResult.data) {
|
|
142
|
+
return createErrorResponse('Document chunking failed', {
|
|
143
|
+
operation: 'ingest',
|
|
144
|
+
error: chunkResult.error || chunkResult.message,
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
const { chunks, totalChunks } = chunkResult.data;
|
|
148
|
+
// Handle empty content (no chunks created)
|
|
149
|
+
if (totalChunks === 0) {
|
|
150
|
+
logger.info('Empty content - no chunks created', { requestId, uri });
|
|
151
|
+
const response = {
|
|
152
|
+
success: true,
|
|
153
|
+
operation: 'ingest',
|
|
154
|
+
chunksCreated: 0,
|
|
155
|
+
chunkIds: [],
|
|
156
|
+
uri,
|
|
157
|
+
message: 'Empty or whitespace-only content - no chunks created',
|
|
158
|
+
};
|
|
159
|
+
return response;
|
|
160
|
+
}
|
|
161
|
+
// Step 3: Initialize collection via plugin
|
|
162
|
+
const vectorSize = embeddingService.getDimensions();
|
|
163
|
+
logger.debug('Initializing knowledge collection via plugin', { requestId, vectorSize });
|
|
164
|
+
const initResponse = await (0, plugin_registry_1.invokePluginTool)(PLUGIN_NAME, 'collection_initialize', {
|
|
165
|
+
collection: KNOWLEDGE_COLLECTION,
|
|
166
|
+
vectorSize,
|
|
167
|
+
createTextIndex: true,
|
|
168
|
+
});
|
|
169
|
+
if (!initResponse.success) {
|
|
170
|
+
const error = initResponse.error;
|
|
171
|
+
const errorMessage = error?.message || 'Collection initialization failed';
|
|
172
|
+
logger.error('Collection initialization failed', new Error(errorMessage), { requestId });
|
|
173
|
+
return createErrorResponse('Failed to initialize knowledge collection', {
|
|
174
|
+
operation: 'ingest',
|
|
175
|
+
error: errorMessage,
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
// Step 4: Store each chunk with embedding via plugin
|
|
179
|
+
const chunkIds = [];
|
|
180
|
+
const ingestedAt = new Date().toISOString();
|
|
181
|
+
for (const chunk of chunks) {
|
|
182
|
+
logger.debug('Generating embedding for chunk', {
|
|
183
|
+
requestId,
|
|
184
|
+
chunkId: chunk.id,
|
|
185
|
+
chunkIndex: chunk.chunkIndex,
|
|
186
|
+
});
|
|
187
|
+
// Generate embedding for chunk content
|
|
188
|
+
const embedding = await embeddingService.generateEmbedding(chunk.content);
|
|
189
|
+
// Build payload for Qdrant
|
|
190
|
+
const payload = {
|
|
191
|
+
content: chunk.content,
|
|
192
|
+
uri,
|
|
193
|
+
metadata: metadata || {},
|
|
194
|
+
checksum: chunk.checksum,
|
|
195
|
+
ingestedAt,
|
|
196
|
+
chunkIndex: chunk.chunkIndex,
|
|
197
|
+
totalChunks: chunk.totalChunks,
|
|
198
|
+
extractedPolicyIds: [],
|
|
199
|
+
};
|
|
200
|
+
logger.debug('Storing chunk via plugin', {
|
|
201
|
+
requestId,
|
|
202
|
+
chunkId: chunk.id,
|
|
203
|
+
chunkIndex: chunk.chunkIndex,
|
|
204
|
+
totalChunks: chunk.totalChunks,
|
|
205
|
+
});
|
|
206
|
+
// Store via plugin
|
|
207
|
+
const storeResponse = await (0, plugin_registry_1.invokePluginTool)(PLUGIN_NAME, 'vector_store', {
|
|
208
|
+
collection: KNOWLEDGE_COLLECTION,
|
|
209
|
+
id: chunk.id,
|
|
210
|
+
embedding,
|
|
211
|
+
payload,
|
|
212
|
+
});
|
|
213
|
+
if (!storeResponse.success) {
|
|
214
|
+
const error = storeResponse.error;
|
|
215
|
+
const errorMessage = error?.message || 'Store failed';
|
|
216
|
+
logger.error('Failed to store chunk', new Error(errorMessage), {
|
|
217
|
+
requestId,
|
|
218
|
+
chunkId: chunk.id,
|
|
219
|
+
});
|
|
220
|
+
return createErrorResponse('Failed to store chunk', {
|
|
221
|
+
operation: 'ingest',
|
|
222
|
+
chunkId: chunk.id,
|
|
223
|
+
error: errorMessage,
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
chunkIds.push(chunk.id);
|
|
227
|
+
}
|
|
228
|
+
logger.info('Document ingestion completed', {
|
|
229
|
+
requestId,
|
|
230
|
+
uri,
|
|
231
|
+
chunksCreated: chunkIds.length,
|
|
232
|
+
});
|
|
233
|
+
const response = {
|
|
234
|
+
success: true,
|
|
235
|
+
operation: 'ingest',
|
|
236
|
+
chunksCreated: chunkIds.length,
|
|
237
|
+
chunkIds,
|
|
238
|
+
uri,
|
|
239
|
+
message: `Successfully ingested document into ${chunkIds.length} chunks`,
|
|
240
|
+
};
|
|
241
|
+
return response;
|
|
242
|
+
}
|
|
243
|
+
catch (error) {
|
|
244
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
245
|
+
logger.error('Document ingestion failed', error, { requestId, uri });
|
|
246
|
+
return createErrorResponse('Document ingestion failed', {
|
|
247
|
+
operation: 'ingest',
|
|
248
|
+
error: errorMessage,
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Default limit for search results
|
|
254
|
+
*/
|
|
255
|
+
const DEFAULT_SEARCH_LIMIT = 20;
|
|
256
|
+
/**
|
|
257
|
+
* Reusable knowledge base search function.
|
|
258
|
+
* Can be called from MCP tool handler or HTTP endpoints.
|
|
259
|
+
*
|
|
260
|
+
* @param params Search parameters
|
|
261
|
+
* @returns Search results with chunks or error
|
|
262
|
+
*/
|
|
263
|
+
async function searchKnowledgeBase(params) {
|
|
264
|
+
const { query, limit = DEFAULT_SEARCH_LIMIT, uriFilter } = params;
|
|
265
|
+
// Check plugin availability
|
|
266
|
+
if (!(0, plugin_registry_1.isPluginInitialized)()) {
|
|
267
|
+
return {
|
|
268
|
+
success: false,
|
|
269
|
+
chunks: [],
|
|
270
|
+
totalMatches: 0,
|
|
271
|
+
error: 'Plugin system not available',
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
// Check embedding service availability
|
|
275
|
+
const embeddingService = new embedding_service_1.EmbeddingService();
|
|
276
|
+
if (!embeddingService.isAvailable()) {
|
|
277
|
+
const status = embeddingService.getStatus();
|
|
278
|
+
return {
|
|
279
|
+
success: false,
|
|
280
|
+
chunks: [],
|
|
281
|
+
totalMatches: 0,
|
|
282
|
+
error: `Embedding service not available: ${status.reason}`,
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
// Generate embedding for the search query
|
|
286
|
+
const queryEmbedding = await embeddingService.generateEmbedding(query);
|
|
287
|
+
// Build filter if uriFilter is provided
|
|
288
|
+
let filter;
|
|
289
|
+
if (uriFilter) {
|
|
290
|
+
filter = {
|
|
291
|
+
must: [
|
|
292
|
+
{
|
|
293
|
+
key: 'uri',
|
|
294
|
+
match: {
|
|
295
|
+
value: uriFilter,
|
|
296
|
+
},
|
|
297
|
+
},
|
|
298
|
+
],
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
// Call vector_search plugin tool
|
|
302
|
+
const searchResponse = await (0, plugin_registry_1.invokePluginTool)(PLUGIN_NAME, 'vector_search', {
|
|
303
|
+
collection: KNOWLEDGE_COLLECTION,
|
|
304
|
+
embedding: queryEmbedding,
|
|
305
|
+
limit,
|
|
306
|
+
filter,
|
|
307
|
+
scoreThreshold: 0, // Return all results up to limit, let consumer filter by score
|
|
308
|
+
});
|
|
309
|
+
if (!searchResponse.success) {
|
|
310
|
+
const error = searchResponse.error;
|
|
311
|
+
const errorMessage = error?.message || error?.error || 'Search failed';
|
|
312
|
+
// If collection doesn't exist (Not Found), return empty result (not error)
|
|
313
|
+
if (errorMessage.includes('Not Found') || errorMessage.includes('not found')) {
|
|
314
|
+
return {
|
|
315
|
+
success: true,
|
|
316
|
+
chunks: [],
|
|
317
|
+
totalMatches: 0,
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
return {
|
|
321
|
+
success: false,
|
|
322
|
+
chunks: [],
|
|
323
|
+
totalMatches: 0,
|
|
324
|
+
error: errorMessage,
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
// Extract results from plugin response
|
|
328
|
+
const searchResult = searchResponse.result;
|
|
329
|
+
if (!searchResult.success) {
|
|
330
|
+
const errorMessage = searchResult.error || searchResult.message;
|
|
331
|
+
// If collection doesn't exist, return empty result (not error)
|
|
332
|
+
if (errorMessage.includes('Not Found') || errorMessage.includes('not found')) {
|
|
333
|
+
return {
|
|
334
|
+
success: true,
|
|
335
|
+
chunks: [],
|
|
336
|
+
totalMatches: 0,
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
return {
|
|
340
|
+
success: false,
|
|
341
|
+
chunks: [],
|
|
342
|
+
totalMatches: 0,
|
|
343
|
+
error: errorMessage,
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
// Transform results to KnowledgeSearchResultItem format
|
|
347
|
+
const results = searchResult.data || [];
|
|
348
|
+
const chunks = results.map((result) => ({
|
|
349
|
+
id: result.id,
|
|
350
|
+
content: result.payload.content,
|
|
351
|
+
score: result.score,
|
|
352
|
+
matchType: 'semantic', // Dense vector search only (BM25 deferred)
|
|
353
|
+
uri: result.payload.uri,
|
|
354
|
+
metadata: result.payload.metadata || {},
|
|
355
|
+
chunkIndex: result.payload.chunkIndex,
|
|
356
|
+
totalChunks: result.payload.totalChunks,
|
|
357
|
+
extractedPolicies: undefined, // Populated by PRD #357
|
|
358
|
+
}));
|
|
359
|
+
return {
|
|
360
|
+
success: true,
|
|
361
|
+
chunks,
|
|
362
|
+
totalMatches: chunks.length,
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* Handle the search operation (MCP tool handler)
|
|
367
|
+
*/
|
|
368
|
+
async function handleSearchOperation(args, logger, requestId) {
|
|
369
|
+
const { query, limit = DEFAULT_SEARCH_LIMIT, uriFilter } = args;
|
|
370
|
+
// Validate required parameters
|
|
371
|
+
if (!query) {
|
|
372
|
+
return createErrorResponse('Missing required parameter: query', {
|
|
373
|
+
operation: 'search',
|
|
374
|
+
hint: 'Provide a natural language search query',
|
|
375
|
+
});
|
|
376
|
+
}
|
|
377
|
+
logger.info('Starting knowledge base search', {
|
|
378
|
+
requestId,
|
|
379
|
+
queryLength: query.length,
|
|
380
|
+
limit,
|
|
381
|
+
hasUriFilter: !!uriFilter,
|
|
382
|
+
});
|
|
383
|
+
try {
|
|
384
|
+
// Use the reusable search function
|
|
385
|
+
const searchResult = await searchKnowledgeBase({ query, limit, uriFilter });
|
|
386
|
+
if (!searchResult.success) {
|
|
387
|
+
logger.error('Knowledge base search failed', new Error(searchResult.error), { requestId });
|
|
388
|
+
return createErrorResponse('Search failed', {
|
|
389
|
+
operation: 'search',
|
|
390
|
+
error: searchResult.error,
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
logger.info('Knowledge base search completed', {
|
|
394
|
+
requestId,
|
|
395
|
+
query: query.substring(0, 50) + (query.length > 50 ? '...' : ''),
|
|
396
|
+
resultsFound: searchResult.chunks.length,
|
|
397
|
+
});
|
|
398
|
+
const response = {
|
|
399
|
+
success: true,
|
|
400
|
+
operation: 'search',
|
|
401
|
+
chunks: searchResult.chunks,
|
|
402
|
+
totalMatches: searchResult.totalMatches,
|
|
403
|
+
query,
|
|
404
|
+
message: searchResult.chunks.length > 0
|
|
405
|
+
? `Found ${searchResult.chunks.length} matching chunks`
|
|
406
|
+
: 'No matching documents found',
|
|
407
|
+
agentInstructions: searchResult.chunks.length > 0
|
|
408
|
+
? `Use the chunks as source material to answer the user's question:
|
|
409
|
+
1. Extract and combine only the relevant information from the chunks
|
|
410
|
+
2. Synthesize a coherent answer that directly addresses the user's query
|
|
411
|
+
3. Discard irrelevant text - chunks may contain both relevant and irrelevant content
|
|
412
|
+
4. At the end, include a "Sources:" section listing the unique source URIs as clickable markdown links
|
|
413
|
+
5. Do NOT show raw chunks, scores, or chunk metadata to the user`
|
|
414
|
+
: undefined,
|
|
415
|
+
};
|
|
416
|
+
return response;
|
|
417
|
+
}
|
|
418
|
+
catch (error) {
|
|
419
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
420
|
+
logger.error('Knowledge base search failed', error, { requestId });
|
|
421
|
+
return createErrorResponse('Search failed', {
|
|
422
|
+
operation: 'search',
|
|
423
|
+
error: errorMessage,
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* Helper to delete all chunks for a URI.
|
|
429
|
+
* Returns the number of chunks deleted, or throws an error.
|
|
430
|
+
* Handles "collection not found" gracefully (returns 0).
|
|
431
|
+
*/
|
|
432
|
+
async function deleteChunksByUri(uri, logger, requestId) {
|
|
433
|
+
// Query all chunks matching the URI
|
|
434
|
+
const queryResponse = await (0, plugin_registry_1.invokePluginTool)(PLUGIN_NAME, 'vector_query', {
|
|
435
|
+
collection: KNOWLEDGE_COLLECTION,
|
|
436
|
+
filter: {
|
|
437
|
+
must: [{ key: 'uri', match: { value: uri } }],
|
|
438
|
+
},
|
|
439
|
+
limit: 10000, // High limit to get all chunks for a document
|
|
440
|
+
});
|
|
441
|
+
if (!queryResponse.success) {
|
|
442
|
+
const error = queryResponse.error;
|
|
443
|
+
const errorMessage = error?.message || error?.error || 'Query failed';
|
|
444
|
+
// If collection doesn't exist (Not Found), return 0 (no chunks to delete)
|
|
445
|
+
if (errorMessage.includes('Not Found') || errorMessage.includes('not found')) {
|
|
446
|
+
logger.debug('Collection not found - no chunks to delete', { requestId, uri });
|
|
447
|
+
return 0;
|
|
448
|
+
}
|
|
449
|
+
throw new Error(`Failed to query chunks for deletion: ${errorMessage}`);
|
|
450
|
+
}
|
|
451
|
+
// Extract results from plugin response
|
|
452
|
+
const queryResult = queryResponse.result;
|
|
453
|
+
if (!queryResult.success) {
|
|
454
|
+
const errorMessage = queryResult.error || queryResult.message;
|
|
455
|
+
// If collection doesn't exist, return 0
|
|
456
|
+
if (errorMessage.includes('Not Found') || errorMessage.includes('not found')) {
|
|
457
|
+
logger.debug('Collection not found - no chunks to delete', { requestId, uri });
|
|
458
|
+
return 0;
|
|
459
|
+
}
|
|
460
|
+
throw new Error(`Failed to query chunks for deletion: ${errorMessage}`);
|
|
461
|
+
}
|
|
462
|
+
const chunksToDelete = queryResult.data || [];
|
|
463
|
+
// If no chunks found, return 0
|
|
464
|
+
if (chunksToDelete.length === 0) {
|
|
465
|
+
logger.debug('No existing chunks found for URI', { requestId, uri });
|
|
466
|
+
return 0;
|
|
467
|
+
}
|
|
468
|
+
// Delete each chunk by ID
|
|
469
|
+
let deletedCount = 0;
|
|
470
|
+
for (const chunk of chunksToDelete) {
|
|
471
|
+
logger.debug('Deleting chunk', { requestId, chunkId: chunk.id });
|
|
472
|
+
const deleteResponse = await (0, plugin_registry_1.invokePluginTool)(PLUGIN_NAME, 'vector_delete', {
|
|
473
|
+
collection: KNOWLEDGE_COLLECTION,
|
|
474
|
+
id: chunk.id,
|
|
475
|
+
});
|
|
476
|
+
if (!deleteResponse.success) {
|
|
477
|
+
const error = deleteResponse.error;
|
|
478
|
+
const errorMessage = error?.message || 'Delete failed';
|
|
479
|
+
throw new Error(`Failed to delete chunk ${chunk.id}: ${errorMessage}`);
|
|
480
|
+
}
|
|
481
|
+
deletedCount++;
|
|
482
|
+
}
|
|
483
|
+
return deletedCount;
|
|
484
|
+
}
|
|
485
|
+
/**
|
|
486
|
+
* Handle the deleteByUri operation
|
|
487
|
+
*/
|
|
488
|
+
async function handleDeleteByUriOperation(args, logger, requestId) {
|
|
489
|
+
const { uri } = args;
|
|
490
|
+
// Validate required parameters
|
|
491
|
+
if (!uri) {
|
|
492
|
+
return createErrorResponse('Missing required parameter: uri', {
|
|
493
|
+
operation: 'deleteByUri',
|
|
494
|
+
hint: 'Provide the URI of the document to delete all chunks for',
|
|
495
|
+
});
|
|
496
|
+
}
|
|
497
|
+
// Check plugin availability
|
|
498
|
+
if (!(0, plugin_registry_1.isPluginInitialized)()) {
|
|
499
|
+
return createErrorResponse('Plugin system not available', {
|
|
500
|
+
operation: 'deleteByUri',
|
|
501
|
+
hint: 'The agentic-tools plugin must be running for knowledge base operations',
|
|
502
|
+
});
|
|
503
|
+
}
|
|
504
|
+
logger.info('Starting deleteByUri operation', { requestId, uri });
|
|
505
|
+
try {
|
|
506
|
+
const deletedCount = await deleteChunksByUri(uri, logger, requestId);
|
|
507
|
+
logger.info('DeleteByUri operation completed', {
|
|
508
|
+
requestId,
|
|
509
|
+
uri,
|
|
510
|
+
chunksDeleted: deletedCount,
|
|
511
|
+
});
|
|
512
|
+
const response = {
|
|
513
|
+
success: true,
|
|
514
|
+
operation: 'deleteByUri',
|
|
515
|
+
uri,
|
|
516
|
+
chunksDeleted: deletedCount,
|
|
517
|
+
message: deletedCount > 0
|
|
518
|
+
? `Successfully deleted ${deletedCount} chunks for URI`
|
|
519
|
+
: 'No chunks found for URI',
|
|
520
|
+
};
|
|
521
|
+
return response;
|
|
522
|
+
}
|
|
523
|
+
catch (error) {
|
|
524
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
525
|
+
logger.error('DeleteByUri operation failed', error, { requestId, uri });
|
|
526
|
+
return createErrorResponse('Delete operation failed', {
|
|
527
|
+
operation: 'deleteByUri',
|
|
528
|
+
error: errorMessage,
|
|
529
|
+
});
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
/**
|
|
533
|
+
* Wrap response in MCP content format
|
|
534
|
+
*/
|
|
535
|
+
function wrapMcpResponse(response) {
|
|
536
|
+
return {
|
|
537
|
+
content: [
|
|
538
|
+
{
|
|
539
|
+
type: 'text',
|
|
540
|
+
text: JSON.stringify(response, null, 2),
|
|
541
|
+
},
|
|
542
|
+
],
|
|
543
|
+
};
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
546
|
+
* Main tool handler - routes to appropriate operation handler
|
|
547
|
+
*/
|
|
548
|
+
async function handleManageKnowledgeTool(args, _dotAI, logger, requestId) {
|
|
549
|
+
logger.info('Processing manageKnowledge tool request', {
|
|
550
|
+
requestId,
|
|
551
|
+
operation: args.operation,
|
|
552
|
+
});
|
|
553
|
+
// Route to appropriate handler based on operation
|
|
554
|
+
let response;
|
|
555
|
+
switch (args.operation) {
|
|
556
|
+
case 'ingest':
|
|
557
|
+
response = await handleIngestOperation(args, logger, requestId);
|
|
558
|
+
break;
|
|
559
|
+
case 'search':
|
|
560
|
+
response = await handleSearchOperation(args, logger, requestId);
|
|
561
|
+
break;
|
|
562
|
+
case 'deleteByUri':
|
|
563
|
+
response = await handleDeleteByUriOperation(args, logger, requestId);
|
|
564
|
+
break;
|
|
565
|
+
default:
|
|
566
|
+
response = createErrorResponse(`Unsupported operation: ${args.operation}`, {
|
|
567
|
+
supportedOperations: ['ingest', 'search', 'deleteByUri'],
|
|
568
|
+
hint: 'Use "ingest" to add documents, "search" for semantic search, or "deleteByUri" to remove all chunks for a document',
|
|
569
|
+
});
|
|
570
|
+
}
|
|
571
|
+
// Wrap response in MCP content format
|
|
572
|
+
return wrapMcpResponse(response);
|
|
573
|
+
}
|
|
@@ -1,7 +1,35 @@
|
|
|
1
1
|
import { GenericSessionManager } from '../core/generic-session-manager';
|
|
2
2
|
import { PluginManager } from '../core/plugin-manager';
|
|
3
3
|
import { Logger } from '../core/error-handling';
|
|
4
|
-
import { OperateSessionData } from './operate';
|
|
4
|
+
import { OperateSessionData, ProposedChanges } from './operate';
|
|
5
|
+
/**
|
|
6
|
+
* Result type for operate analysis
|
|
7
|
+
*/
|
|
8
|
+
interface OperateAnalysisResult {
|
|
9
|
+
status: 'awaiting_user_approval';
|
|
10
|
+
sessionId: string;
|
|
11
|
+
visualizationUrl?: string;
|
|
12
|
+
analysis: {
|
|
13
|
+
summary: string;
|
|
14
|
+
currentState: unknown;
|
|
15
|
+
proposedChanges: ProposedChanges;
|
|
16
|
+
commands: string[];
|
|
17
|
+
dryRunValidation: {
|
|
18
|
+
status: 'success' | 'failed';
|
|
19
|
+
details: string;
|
|
20
|
+
};
|
|
21
|
+
patternsApplied: string[];
|
|
22
|
+
capabilitiesUsed: string[];
|
|
23
|
+
policiesChecked: string[];
|
|
24
|
+
risks: {
|
|
25
|
+
level: 'low' | 'medium' | 'high';
|
|
26
|
+
description: string;
|
|
27
|
+
};
|
|
28
|
+
validationIntent: string;
|
|
29
|
+
};
|
|
30
|
+
message: string;
|
|
31
|
+
nextAction: string;
|
|
32
|
+
}
|
|
5
33
|
/**
|
|
6
34
|
* Analyzes user intent and generates operational proposal using AI tool loop
|
|
7
35
|
*
|
|
@@ -15,5 +43,6 @@ import { OperateSessionData } from './operate';
|
|
|
15
43
|
* @param interaction_id - Optional interaction ID for eval datasets
|
|
16
44
|
* @returns Operation output with proposed changes
|
|
17
45
|
*/
|
|
18
|
-
export declare function analyzeIntent(intent: string, logger: Logger, sessionManager: GenericSessionManager<OperateSessionData>, pluginManager: PluginManager, sessionId?: string, interaction_id?: string): Promise<
|
|
46
|
+
export declare function analyzeIntent(intent: string, logger: Logger, sessionManager: GenericSessionManager<OperateSessionData>, pluginManager: PluginManager, sessionId?: string, interaction_id?: string): Promise<OperateAnalysisResult>;
|
|
47
|
+
export {};
|
|
19
48
|
//# sourceMappingURL=operate-analysis.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operate-analysis.d.ts","sourceRoot":"","sources":["../../src/tools/operate-analysis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAGhD,OAAO,EAEL,kBAAkB,
|
|
1
|
+
{"version":3,"file":"operate-analysis.d.ts","sourceRoot":"","sources":["../../src/tools/operate-analysis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAGhD,OAAO,EAEL,kBAAkB,EAElB,eAAe,EAKhB,MAAM,WAAW,CAAC;AAwBnB;;GAEG;AACH,UAAU,qBAAqB;IAC7B,MAAM,EAAE,wBAAwB,CAAC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE;QACR,OAAO,EAAE,MAAM,CAAC;QAChB,YAAY,EAAE,OAAO,CAAC;QACtB,eAAe,EAAE,eAAe,CAAC;QACjC,QAAQ,EAAE,MAAM,EAAE,CAAC;QACnB,gBAAgB,EAAE;YAChB,MAAM,EAAE,SAAS,GAAG,QAAQ,CAAC;YAC7B,OAAO,EAAE,MAAM,CAAC;SACjB,CAAC;QACF,eAAe,EAAE,MAAM,EAAE,CAAC;QAC1B,gBAAgB,EAAE,MAAM,EAAE,CAAC;QAC3B,eAAe,EAAE,MAAM,EAAE,CAAC;QAC1B,KAAK,EAAE;YACL,KAAK,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;YACjC,WAAW,EAAE,MAAM,CAAC;SACrB,CAAC;QACF,gBAAgB,EAAE,MAAM,CAAC;KAC1B,CAAC;IACF,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,qBAAqB,CAAC,kBAAkB,CAAC,EACzD,aAAa,EAAE,aAAa,EAC5B,SAAS,CAAC,EAAE,MAAM,EAClB,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,qBAAqB,CAAC,CAoDhC"}
|
|
@@ -6,15 +6,14 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { Logger } from '../core/error-handling';
|
|
8
8
|
import { GenericSessionManager } from '../core/generic-session-manager';
|
|
9
|
-
import { PluginManager } from '../core/plugin-manager';
|
|
10
9
|
import { OperateSessionData, OperateOutput } from './operate';
|
|
11
10
|
/**
|
|
12
11
|
* Executes approved operational changes
|
|
12
|
+
* PRD #359: Uses unified plugin registry for tool invocations
|
|
13
13
|
* @param sessionId - Session ID with approved changes
|
|
14
14
|
* @param logger - Logger instance
|
|
15
15
|
* @param sessionManager - Session manager instance
|
|
16
|
-
* @param pluginManager - Plugin manager for kubectl operations (PRD #343)
|
|
17
16
|
* @returns Operation output with execution results
|
|
18
17
|
*/
|
|
19
|
-
export declare function executeOperations(sessionId: string, logger: Logger, sessionManager: GenericSessionManager<OperateSessionData
|
|
18
|
+
export declare function executeOperations(sessionId: string, logger: Logger, sessionManager: GenericSessionManager<OperateSessionData>): Promise<OperateOutput>;
|
|
20
19
|
//# sourceMappingURL=operate-execution.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operate-execution.d.ts","sourceRoot":"","sources":["../../src/tools/operate-execution.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAA8C,MAAM,wBAAwB,CAAC;AAC5F,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAExE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"operate-execution.d.ts","sourceRoot":"","sources":["../../src/tools/operate-execution.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAA8C,MAAM,wBAAwB,CAAC;AAC5F,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAExE,OAAO,EAAE,kBAAkB,EAAmB,aAAa,EAAE,MAAM,WAAW,CAAC;AAG/E;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CACrC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,qBAAqB,CAAC,kBAAkB,CAAC,GACxD,OAAO,CAAC,aAAa,CAAC,CAyIxB"}
|