@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
package/dist/core/index.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Shared intelligence for both CLI and MCP interfaces
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.PluginClientError = exports.PluginClient = exports.PluginDiscoveryError = exports.PluginManager = exports.CircuitOpenError = exports.CircuitState = exports.CircuitBreakerFactory = exports.CircuitBreaker = exports.buildAgentDisplayBlock = exports.VercelEmbeddingProvider = exports.EmbeddingService = exports.CapabilityVectorService = exports.PolicyVectorService = exports.PatternVectorService = exports.BaseVectorService = exports.
|
|
8
|
+
exports.invokePluginTool = exports.isPluginInitialized = exports.getPluginManager = exports.initializePluginRegistry = exports.PluginClientError = exports.PluginClient = exports.PluginDiscoveryError = exports.PluginManager = exports.CircuitOpenError = exports.CircuitState = exports.CircuitBreakerFactory = exports.CircuitBreaker = exports.buildAgentDisplayBlock = exports.VercelEmbeddingProvider = exports.EmbeddingService = exports.CapabilityVectorService = exports.PolicyVectorService = exports.PatternVectorService = exports.BaseVectorService = exports.deserializePattern = exports.serializePattern = exports.createPattern = exports.validatePattern = exports.ResourceRecommender = exports.ManifestValidator = exports.SchemaParser = exports.AIProviderFactory = exports.createAIProvider = exports.WorkflowEngine = exports.MemorySystem = exports.KubernetesDiscovery = exports.DotAI = void 0;
|
|
9
9
|
const discovery_1 = require("./discovery");
|
|
10
10
|
const memory_1 = require("./memory");
|
|
11
11
|
const workflow_1 = require("./workflow");
|
|
@@ -110,16 +110,6 @@ class DotAI {
|
|
|
110
110
|
isInitialized() {
|
|
111
111
|
return this.initialized;
|
|
112
112
|
}
|
|
113
|
-
getVersion() {
|
|
114
|
-
return '0.1.0';
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* PRD #343: Set plugin manager for routing kubectl operations through plugin
|
|
118
|
-
* Must be called before any Kubernetes operations are performed
|
|
119
|
-
*/
|
|
120
|
-
setPluginManager(pluginManager) {
|
|
121
|
-
this.discovery.setPluginManager(pluginManager);
|
|
122
|
-
}
|
|
123
113
|
}
|
|
124
114
|
exports.DotAI = DotAI;
|
|
125
115
|
// Re-export all modules for convenience
|
|
@@ -142,8 +132,6 @@ Object.defineProperty(exports, "createPattern", { enumerable: true, get: functio
|
|
|
142
132
|
Object.defineProperty(exports, "serializePattern", { enumerable: true, get: function () { return pattern_operations_1.serializePattern; } });
|
|
143
133
|
Object.defineProperty(exports, "deserializePattern", { enumerable: true, get: function () { return pattern_operations_1.deserializePattern; } });
|
|
144
134
|
// Removed obsolete pattern creation types - now using unified creation system
|
|
145
|
-
var vector_db_service_1 = require("./vector-db-service");
|
|
146
|
-
Object.defineProperty(exports, "VectorDBService", { enumerable: true, get: function () { return vector_db_service_1.VectorDBService; } });
|
|
147
135
|
var base_vector_service_1 = require("./base-vector-service");
|
|
148
136
|
Object.defineProperty(exports, "BaseVectorService", { enumerable: true, get: function () { return base_vector_service_1.BaseVectorService; } });
|
|
149
137
|
var pattern_vector_service_1 = require("./pattern-vector-service");
|
|
@@ -162,12 +150,18 @@ Object.defineProperty(exports, "CircuitBreaker", { enumerable: true, get: functi
|
|
|
162
150
|
Object.defineProperty(exports, "CircuitBreakerFactory", { enumerable: true, get: function () { return circuit_breaker_1.CircuitBreakerFactory; } });
|
|
163
151
|
Object.defineProperty(exports, "CircuitState", { enumerable: true, get: function () { return circuit_breaker_1.CircuitState; } });
|
|
164
152
|
Object.defineProperty(exports, "CircuitOpenError", { enumerable: true, get: function () { return circuit_breaker_1.CircuitOpenError; } });
|
|
165
|
-
// Plugin system (PRD #343)
|
|
153
|
+
// Plugin system (PRD #343, #359)
|
|
166
154
|
var plugin_manager_1 = require("./plugin-manager");
|
|
167
155
|
Object.defineProperty(exports, "PluginManager", { enumerable: true, get: function () { return plugin_manager_1.PluginManager; } });
|
|
168
156
|
Object.defineProperty(exports, "PluginDiscoveryError", { enumerable: true, get: function () { return plugin_manager_1.PluginDiscoveryError; } });
|
|
169
157
|
var plugin_client_1 = require("./plugin-client");
|
|
170
158
|
Object.defineProperty(exports, "PluginClient", { enumerable: true, get: function () { return plugin_client_1.PluginClient; } });
|
|
171
159
|
Object.defineProperty(exports, "PluginClientError", { enumerable: true, get: function () { return plugin_client_1.PluginClientError; } });
|
|
160
|
+
// Unified plugin registry (PRD #359)
|
|
161
|
+
var plugin_registry_1 = require("./plugin-registry");
|
|
162
|
+
Object.defineProperty(exports, "initializePluginRegistry", { enumerable: true, get: function () { return plugin_registry_1.initializePluginRegistry; } });
|
|
163
|
+
Object.defineProperty(exports, "getPluginManager", { enumerable: true, get: function () { return plugin_registry_1.getPluginManager; } });
|
|
164
|
+
Object.defineProperty(exports, "isPluginInitialized", { enumerable: true, get: function () { return plugin_registry_1.isPluginInitialized; } });
|
|
165
|
+
Object.defineProperty(exports, "invokePluginTool", { enumerable: true, get: function () { return plugin_registry_1.invokePluginTool; } });
|
|
172
166
|
// Default export
|
|
173
167
|
exports.default = DotAI;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Knowledge Base Type Definitions
|
|
3
|
+
*
|
|
4
|
+
* Types for the knowledge base system including chunks, ingestion requests/responses,
|
|
5
|
+
* and search results.
|
|
6
|
+
*
|
|
7
|
+
* PRD #356: Knowledge Base System
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Knowledge Chunk - stored in Qdrant "knowledge-base" collection
|
|
11
|
+
*
|
|
12
|
+
* Each chunk represents a portion of a source document with its embedding.
|
|
13
|
+
* Chunks are identified by a deterministic UUID v5 based on URI + chunk index.
|
|
14
|
+
*/
|
|
15
|
+
export interface KnowledgeChunk {
|
|
16
|
+
/** Deterministic UUID v5 from uri#chunkIndex */
|
|
17
|
+
id: string;
|
|
18
|
+
/** Chunk text content */
|
|
19
|
+
content: string;
|
|
20
|
+
/** Full URL identifying the source document (e.g., 'https://github.com/org/repo/blob/main/docs/guide.md') */
|
|
21
|
+
uri: string;
|
|
22
|
+
/** Optional source-specific metadata */
|
|
23
|
+
metadata: Record<string, unknown>;
|
|
24
|
+
/** SHA-256 hash of content for change detection */
|
|
25
|
+
checksum: string;
|
|
26
|
+
/** ISO 8601 timestamp when chunk was ingested */
|
|
27
|
+
ingestedAt: string;
|
|
28
|
+
/** Zero-based index of this chunk within the source document */
|
|
29
|
+
chunkIndex: number;
|
|
30
|
+
/** Total number of chunks from the source document */
|
|
31
|
+
totalChunks: number;
|
|
32
|
+
/** IDs of policies extracted from this chunk (populated by PRD #357) */
|
|
33
|
+
extractedPolicyIds?: string[];
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Result from the plugin's knowledge_chunk tool
|
|
37
|
+
*/
|
|
38
|
+
export interface PluginChunkResult {
|
|
39
|
+
id: string;
|
|
40
|
+
content: string;
|
|
41
|
+
checksum: string;
|
|
42
|
+
chunkIndex: number;
|
|
43
|
+
totalChunks: number;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Response from the plugin's knowledge_chunk tool
|
|
47
|
+
*/
|
|
48
|
+
export interface PluginChunkResponse {
|
|
49
|
+
success: boolean;
|
|
50
|
+
data?: {
|
|
51
|
+
chunks: PluginChunkResult[];
|
|
52
|
+
totalChunks: number;
|
|
53
|
+
uri: string;
|
|
54
|
+
};
|
|
55
|
+
error?: string;
|
|
56
|
+
message: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Ingest operation response
|
|
60
|
+
*/
|
|
61
|
+
export interface IngestResponse {
|
|
62
|
+
success: boolean;
|
|
63
|
+
operation: 'ingest';
|
|
64
|
+
chunksCreated: number;
|
|
65
|
+
chunkIds: string[];
|
|
66
|
+
uri: string;
|
|
67
|
+
message: string;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Search result for a single chunk
|
|
71
|
+
*/
|
|
72
|
+
export interface KnowledgeSearchResultItem {
|
|
73
|
+
id: string;
|
|
74
|
+
content: string;
|
|
75
|
+
score: number;
|
|
76
|
+
matchType: 'semantic' | 'keyword' | 'hybrid';
|
|
77
|
+
uri: string;
|
|
78
|
+
metadata: Record<string, unknown>;
|
|
79
|
+
chunkIndex: number;
|
|
80
|
+
totalChunks: number;
|
|
81
|
+
/** Policies extracted from this chunk (populated by PRD #357) */
|
|
82
|
+
extractedPolicies?: Array<{
|
|
83
|
+
id: string;
|
|
84
|
+
description: string;
|
|
85
|
+
}>;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Search operation response
|
|
89
|
+
*/
|
|
90
|
+
export interface KnowledgeSearchResponse {
|
|
91
|
+
success: boolean;
|
|
92
|
+
operation: 'search';
|
|
93
|
+
chunks: KnowledgeSearchResultItem[];
|
|
94
|
+
totalMatches: number;
|
|
95
|
+
query: string;
|
|
96
|
+
message: string;
|
|
97
|
+
/** Instructions for how the AI agent should present results to the user */
|
|
98
|
+
agentInstructions?: string;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* DeleteByUri operation response
|
|
102
|
+
*/
|
|
103
|
+
export interface DeleteByUriResponse {
|
|
104
|
+
success: boolean;
|
|
105
|
+
operation: 'deleteByUri';
|
|
106
|
+
uri: string;
|
|
107
|
+
chunksDeleted: number;
|
|
108
|
+
message: string;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Union type for all manageKnowledge operation responses
|
|
112
|
+
*/
|
|
113
|
+
export type ManageKnowledgeResponse = IngestResponse | KnowledgeSearchResponse | DeleteByUriResponse;
|
|
114
|
+
//# sourceMappingURL=knowledge-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledge-types.d.ts","sourceRoot":"","sources":["../../src/core/knowledge-types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,gDAAgD;IAChD,EAAE,EAAE,MAAM,CAAC;IAEX,yBAAyB;IACzB,OAAO,EAAE,MAAM,CAAC;IAEhB,6GAA6G;IAC7G,GAAG,EAAE,MAAM,CAAC;IAEZ,wCAAwC;IACxC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAElC,mDAAmD;IACnD,QAAQ,EAAE,MAAM,CAAC;IAEjB,iDAAiD;IACjD,UAAU,EAAE,MAAM,CAAC;IAEnB,gEAAgE;IAChE,UAAU,EAAE,MAAM,CAAC;IAEnB,sDAAsD;IACtD,WAAW,EAAE,MAAM,CAAC;IAEpB,wEAAwE;IACxE,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC/B;AAED;;GAEG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,EAAE,QAAQ,CAAC;IACpB,MAAM,EAAE,yBAAyB,EAAE,CAAC;IACpC,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,2EAA2E;IAC3E,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,aAAa,CAAC;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAC/B,cAAc,GACd,uBAAuB,GACvB,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Knowledge Base Type Definitions
|
|
4
|
+
*
|
|
5
|
+
* Types for the knowledge base system including chunks, ingestion requests/responses,
|
|
6
|
+
* and search results.
|
|
7
|
+
*
|
|
8
|
+
* PRD #356: Knowledge Base System
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
package/dist/core/memory.d.ts
CHANGED
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export interface SuccessPattern {
|
|
7
7
|
type: string;
|
|
8
|
-
config:
|
|
8
|
+
config: unknown;
|
|
9
9
|
timestamp: Date;
|
|
10
10
|
}
|
|
11
11
|
export interface FailurePattern {
|
|
12
12
|
type: string;
|
|
13
|
-
config:
|
|
13
|
+
config: unknown;
|
|
14
14
|
error: string;
|
|
15
15
|
timestamp: Date;
|
|
16
16
|
}
|
|
@@ -26,19 +26,19 @@ export declare class MemorySystem {
|
|
|
26
26
|
private context;
|
|
27
27
|
private initialized;
|
|
28
28
|
initialize(): Promise<void>;
|
|
29
|
-
store(key: string, data:
|
|
30
|
-
retrieve(key: string): Promise<
|
|
31
|
-
learnSuccess(type: string, config:
|
|
32
|
-
learnFailure(type: string, config:
|
|
29
|
+
store(key: string, data: unknown): Promise<void>;
|
|
30
|
+
retrieve(key: string): Promise<unknown>;
|
|
31
|
+
learnSuccess(type: string, config: unknown): Promise<void>;
|
|
32
|
+
learnFailure(type: string, config: unknown, error: string): Promise<void>;
|
|
33
33
|
getSuccessPatterns(type: string): Promise<SuccessPattern[]>;
|
|
34
34
|
getFailurePatterns(type: string): Promise<FailurePattern[]>;
|
|
35
|
-
getRecommendations(type: string, partialConfig:
|
|
36
|
-
storePattern(type: string, pattern:
|
|
37
|
-
retrievePattern(type: string): Promise<
|
|
38
|
-
storeLessons(type: string, lessons:
|
|
35
|
+
getRecommendations(type: string, partialConfig: Record<string, unknown>): Promise<Recommendation[]>;
|
|
36
|
+
storePattern(type: string, pattern: unknown): Promise<void>;
|
|
37
|
+
retrievePattern(type: string): Promise<unknown[]>;
|
|
38
|
+
storeLessons(type: string, lessons: unknown): Promise<void>;
|
|
39
39
|
private calculateSimilarity;
|
|
40
|
-
setContext(key: string, value:
|
|
41
|
-
getContext(): Promise<Record<string,
|
|
40
|
+
setContext(key: string, value: unknown): Promise<void>;
|
|
41
|
+
getContext(): Promise<Record<string, unknown>>;
|
|
42
42
|
clearContext(key?: string): Promise<void>;
|
|
43
43
|
isInitialized(): boolean;
|
|
44
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../src/core/memory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../src/core/memory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,SA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AAG,OAAO,CAAC,IAAI,CAAC;IAK3D,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAKjD,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAKjE,OAAO,CAAC,mBAAmB;IAYrB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAItD,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAQ9C,YAAY,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ/C,aAAa,IAAI,OAAO;CAGzB"}
|
|
@@ -7,6 +7,28 @@
|
|
|
7
7
|
* PRD #320: Milestone 2.6 - Mermaid Diagram Validation
|
|
8
8
|
*/
|
|
9
9
|
import { AITool } from './ai-provider.interface';
|
|
10
|
+
/**
|
|
11
|
+
* Input for mermaid validation tools
|
|
12
|
+
*/
|
|
13
|
+
export interface MermaidToolInput {
|
|
14
|
+
diagram?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Result of mermaid validation
|
|
18
|
+
*/
|
|
19
|
+
interface MermaidValidationResult {
|
|
20
|
+
success: boolean;
|
|
21
|
+
valid?: boolean;
|
|
22
|
+
error?: string | null;
|
|
23
|
+
parseError?: {
|
|
24
|
+
text?: string;
|
|
25
|
+
token?: string;
|
|
26
|
+
line?: number;
|
|
27
|
+
loc?: unknown;
|
|
28
|
+
expected?: string[];
|
|
29
|
+
} | null;
|
|
30
|
+
message: string;
|
|
31
|
+
}
|
|
10
32
|
/**
|
|
11
33
|
* Tool: validate_mermaid
|
|
12
34
|
* Validates Mermaid diagram syntax and returns errors if any
|
|
@@ -23,5 +45,6 @@ export declare const MERMAID_TOOLS: AITool[];
|
|
|
23
45
|
* @param input - Tool input parameters
|
|
24
46
|
* @returns Tool execution result
|
|
25
47
|
*/
|
|
26
|
-
export declare function executeMermaidTools(toolName: string, input:
|
|
48
|
+
export declare function executeMermaidTools(toolName: string, input: MermaidToolInput): Promise<MermaidValidationResult>;
|
|
49
|
+
export {};
|
|
27
50
|
//# sourceMappingURL=mermaid-tools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mermaid-tools.d.ts","sourceRoot":"","sources":["../../src/core/mermaid-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"mermaid-tools.d.ts","sourceRoot":"","sources":["../../src/core/mermaid-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAGjD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,UAAU,uBAAuB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,UAAU,CAAC,EAAE;QACX,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,GAAG,CAAC,EAAE,OAAO,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;KACrB,GAAG,IAAI,CAAC;IACT,OAAO,EAAE,MAAM,CAAC;CACjB;AAqBD;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,MA0BnC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,EAEjC,CAAC;AAEF;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,gBAAgB,GACtB,OAAO,CAAC,uBAAuB,CAAC,CAsDlC"}
|
|
@@ -76,7 +76,8 @@ async function executeMermaidTools(toolName, input) {
|
|
|
76
76
|
return {
|
|
77
77
|
success: false,
|
|
78
78
|
valid: false,
|
|
79
|
-
error: 'Missing or invalid diagram parameter. Provide the Mermaid diagram code as a string.'
|
|
79
|
+
error: 'Missing or invalid diagram parameter. Provide the Mermaid diagram code as a string.',
|
|
80
|
+
message: 'Invalid input'
|
|
80
81
|
};
|
|
81
82
|
}
|
|
82
83
|
try {
|
|
@@ -93,14 +94,15 @@ async function executeMermaidTools(toolName, input) {
|
|
|
93
94
|
}
|
|
94
95
|
catch (error) {
|
|
95
96
|
// Extract useful error information
|
|
96
|
-
const
|
|
97
|
+
const mermaidError = error;
|
|
98
|
+
const errorMessage = mermaidError.message || String(error);
|
|
97
99
|
// Check if it's a parser error with detailed info
|
|
98
|
-
const parseError =
|
|
99
|
-
text:
|
|
100
|
-
token:
|
|
101
|
-
line:
|
|
102
|
-
loc:
|
|
103
|
-
expected:
|
|
100
|
+
const parseError = mermaidError.hash ? {
|
|
101
|
+
text: mermaidError.hash.text,
|
|
102
|
+
token: mermaidError.hash.token,
|
|
103
|
+
line: mermaidError.hash.line,
|
|
104
|
+
loc: mermaidError.hash.loc,
|
|
105
|
+
expected: mermaidError.hash.expected
|
|
104
106
|
} : null;
|
|
105
107
|
return {
|
|
106
108
|
success: true, // Tool executed successfully, but diagram is invalid
|
package/dist/core/packaging.d.ts
CHANGED
|
@@ -32,6 +32,28 @@ interface PackagingErrorContext {
|
|
|
32
32
|
previousOutput: string;
|
|
33
33
|
validationError: string;
|
|
34
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Question with answer structure
|
|
37
|
+
*/
|
|
38
|
+
interface QuestionWithAnswer {
|
|
39
|
+
question: string;
|
|
40
|
+
answer?: unknown;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Solution data structure for packaging
|
|
44
|
+
*/
|
|
45
|
+
interface SolutionData {
|
|
46
|
+
questions?: {
|
|
47
|
+
required?: QuestionWithAnswer[];
|
|
48
|
+
basic?: QuestionWithAnswer[];
|
|
49
|
+
advanced?: QuestionWithAnswer[];
|
|
50
|
+
open?: {
|
|
51
|
+
answer?: string;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
intent?: string;
|
|
55
|
+
[key: string]: unknown;
|
|
56
|
+
}
|
|
35
57
|
/**
|
|
36
58
|
* Package raw Kubernetes manifests into Helm chart or Kustomize overlay
|
|
37
59
|
*
|
|
@@ -45,6 +67,6 @@ interface PackagingErrorContext {
|
|
|
45
67
|
* @param interaction_id - Optional interaction ID for evaluation
|
|
46
68
|
* @returns PackagingResult with files array
|
|
47
69
|
*/
|
|
48
|
-
export declare function packageManifests(rawManifests: string, solution:
|
|
70
|
+
export declare function packageManifests(rawManifests: string, solution: SolutionData, outputFormat: OutputFormat, outputPath: string, dotAI: DotAI, logger: Logger, errorContext?: PackagingErrorContext, interaction_id?: string): Promise<PackagingResult>;
|
|
49
71
|
export {};
|
|
50
72
|
//# sourceMappingURL=packaging.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packaging.d.ts","sourceRoot":"","sources":["../../src/core/packaging.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,MAAM,GAAG,WAAW,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,MAAM,EAAE,YAAY,CAAC;CACtB;AAED;;GAEG;A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M,CAAC;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAyOD;;;;;;;;;;;;GAYG;AACH,wBAAsB,gBAAgB,CACpC,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,YAAY,EACtB,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,YAAY,CAAC,EAAE,qBAAqB,EACpC,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,eAAe,CAAC,CA+D1B"}
|
|
@@ -7,7 +7,35 @@
|
|
|
7
7
|
import { OrganizationalPattern, CreatePatternRequest } from './pattern-types';
|
|
8
8
|
import { Logger } from './error-handling';
|
|
9
9
|
import { PatternVectorService } from './index';
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Arguments for pattern operations
|
|
12
|
+
*/
|
|
13
|
+
interface PatternOperationArgs {
|
|
14
|
+
sessionId?: string;
|
|
15
|
+
response?: string;
|
|
16
|
+
id?: string;
|
|
17
|
+
limit?: number;
|
|
18
|
+
step?: string;
|
|
19
|
+
[key: string]: unknown;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Validation result structure
|
|
23
|
+
*/
|
|
24
|
+
interface ValidationResult {
|
|
25
|
+
success: boolean;
|
|
26
|
+
error?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Pattern operation response
|
|
30
|
+
*/
|
|
31
|
+
interface PatternOperationResponse {
|
|
32
|
+
success: boolean;
|
|
33
|
+
operation?: string;
|
|
34
|
+
dataType?: string;
|
|
35
|
+
error?: string;
|
|
36
|
+
message?: string;
|
|
37
|
+
[key: string]: unknown;
|
|
38
|
+
}
|
|
11
39
|
export declare function validatePattern(request: CreatePatternRequest): string[];
|
|
12
40
|
export declare function createPattern(request: CreatePatternRequest): OrganizationalPattern;
|
|
13
41
|
export declare function serializePattern(pattern: OrganizationalPattern): string;
|
|
@@ -15,13 +43,8 @@ export declare function deserializePattern(json: string): OrganizationalPattern;
|
|
|
15
43
|
/**
|
|
16
44
|
* Handle pattern operations with workflow support
|
|
17
45
|
* Shared validation functions are passed as parameters to avoid circular dependencies
|
|
18
|
-
* PRD #
|
|
46
|
+
* PRD #359: Uses unified plugin registry for kubectl operations
|
|
19
47
|
*/
|
|
20
|
-
export declare function handlePatternOperation(operation: string, args:
|
|
21
|
-
|
|
22
|
-
error?: any;
|
|
23
|
-
}>, validateEmbeddingService: (logger: Logger, requestId: string) => Promise<{
|
|
24
|
-
success: boolean;
|
|
25
|
-
error?: any;
|
|
26
|
-
}>, pluginManager?: PluginManager): Promise<any>;
|
|
48
|
+
export declare function handlePatternOperation(operation: string, args: PatternOperationArgs, logger: Logger, requestId: string, validateVectorDBConnection: (vectorService: PatternVectorService, logger: Logger, requestId: string) => Promise<ValidationResult>, validateEmbeddingService: (logger: Logger, requestId: string) => Promise<ValidationResult>): Promise<PatternOperationResponse>;
|
|
49
|
+
export {};
|
|
27
50
|
//# sourceMappingURL=pattern-operations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pattern-operations.d.ts","sourceRoot":"","sources":["../../src/core/pattern-operations.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAE9E,OAAO,EAA8C,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAGtF,OAAO,
|
|
1
|
+
{"version":3,"file":"pattern-operations.d.ts","sourceRoot":"","sources":["../../src/core/pattern-operations.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAE9E,OAAO,EAA8C,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAGtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAQ/C;;GAEG;AACH,UAAU,o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CAAC,gBAAgB,CAAC,GACzF,OAAO,CAAC,wBAAwB,CAAC,CAoYnC"}
|
|
@@ -52,8 +52,6 @@ const index_1 = require("./index");
|
|
|
52
52
|
const session_utils_1 = require("./session-utils");
|
|
53
53
|
const fs = __importStar(require("fs"));
|
|
54
54
|
const path = __importStar(require("path"));
|
|
55
|
-
// Note: validateVectorDBConnection and validateEmbeddingService are shared utilities
|
|
56
|
-
// that remain in the main organizational-data.ts file as they're used by multiple domains
|
|
57
55
|
// Simple validation function
|
|
58
56
|
function validatePattern(request) {
|
|
59
57
|
const errors = [];
|
|
@@ -126,7 +124,7 @@ async function getPatternService() {
|
|
|
126
124
|
await patternService.initialize();
|
|
127
125
|
return patternService;
|
|
128
126
|
}
|
|
129
|
-
catch
|
|
127
|
+
catch {
|
|
130
128
|
// If initialization fails, return service anyway - health check will catch connection issues
|
|
131
129
|
return patternService;
|
|
132
130
|
}
|
|
@@ -134,9 +132,9 @@ async function getPatternService() {
|
|
|
134
132
|
/**
|
|
135
133
|
* Handle pattern operations with workflow support
|
|
136
134
|
* Shared validation functions are passed as parameters to avoid circular dependencies
|
|
137
|
-
* PRD #
|
|
135
|
+
* PRD #359: Uses unified plugin registry for kubectl operations
|
|
138
136
|
*/
|
|
139
|
-
async function handlePatternOperation(operation, args, logger, requestId, validateVectorDBConnection, validateEmbeddingService
|
|
137
|
+
async function handlePatternOperation(operation, args, logger, requestId, validateVectorDBConnection, validateEmbeddingService) {
|
|
140
138
|
// Get pattern service and validate Vector DB connection
|
|
141
139
|
const patternService = await getPatternService();
|
|
142
140
|
const connectionCheck = await validateVectorDBConnection(patternService, logger, requestId);
|
|
@@ -163,7 +161,8 @@ async function handlePatternOperation(operation, args, logger, requestId, valida
|
|
|
163
161
|
};
|
|
164
162
|
}
|
|
165
163
|
}
|
|
166
|
-
|
|
164
|
+
// PRD #359: Uses unified plugin registry for kubectl operations
|
|
165
|
+
const sessionManager = new unified_creation_session_1.UnifiedCreationSessionManager('pattern');
|
|
167
166
|
switch (operation) {
|
|
168
167
|
case 'create': {
|
|
169
168
|
let workflowStep;
|
|
@@ -175,12 +174,12 @@ async function handlePatternOperation(operation, args, logger, requestId, valida
|
|
|
175
174
|
});
|
|
176
175
|
if (args.response) {
|
|
177
176
|
// Process user response and move to next step
|
|
178
|
-
const updatedSession = sessionManager.processResponse(args.sessionId, args.response
|
|
177
|
+
const updatedSession = sessionManager.processResponse(args.sessionId, args.response);
|
|
179
178
|
workflowStep = await sessionManager.getNextWorkflowStep(updatedSession, args);
|
|
180
179
|
}
|
|
181
180
|
else {
|
|
182
181
|
// Just get current step without processing response
|
|
183
|
-
const session = sessionManager.loadSession(args.sessionId
|
|
182
|
+
const session = sessionManager.loadSession(args.sessionId);
|
|
184
183
|
if (!session) {
|
|
185
184
|
throw error_handling_1.ErrorHandler.createError(error_handling_1.ErrorCategory.VALIDATION, error_handling_1.ErrorSeverity.HIGH, `Session not found: ${args.sessionId}`, {
|
|
186
185
|
operation: 'pattern_workflow_continue',
|
|
@@ -216,27 +215,25 @@ async function handlePatternOperation(operation, args, logger, requestId, valida
|
|
|
216
215
|
// Always check if workflow is complete and store pattern in Vector DB
|
|
217
216
|
let storageInfo = {};
|
|
218
217
|
const isComplete = !('nextStep' in workflowStep) || !workflowStep.nextStep; // Complete when no next step
|
|
219
|
-
const
|
|
218
|
+
const workflowData = workflowStep.data;
|
|
219
|
+
const hasPattern = !!workflowData?.pattern;
|
|
220
220
|
logger.info('Checking workflow completion', {
|
|
221
221
|
requestId,
|
|
222
222
|
nextStep: ('nextStep' in workflowStep) ? workflowStep.nextStep : 'complete',
|
|
223
223
|
hasPattern,
|
|
224
|
-
patternId:
|
|
224
|
+
patternId: workflowData?.pattern?.id
|
|
225
225
|
});
|
|
226
226
|
if (isComplete && hasPattern) {
|
|
227
227
|
try {
|
|
228
|
-
await patternService.storePattern(
|
|
229
|
-
const vectorDBConfig = new index_1.VectorDBService({ collectionName: 'patterns' }).getConfig();
|
|
228
|
+
await patternService.storePattern(workflowData.pattern);
|
|
230
229
|
storageInfo = {
|
|
231
230
|
stored: true,
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
patternId: workflowStep.data.pattern.id
|
|
231
|
+
collectionName: 'patterns',
|
|
232
|
+
patternId: workflowData.pattern.id
|
|
235
233
|
};
|
|
236
234
|
logger.info('Pattern stored in Vector DB successfully', {
|
|
237
235
|
requestId,
|
|
238
|
-
patternId:
|
|
239
|
-
vectorDbUrl: vectorDBConfig.url
|
|
236
|
+
patternId: workflowData.pattern.id
|
|
240
237
|
});
|
|
241
238
|
// Clean up session file after successful Vector DB storage
|
|
242
239
|
try {
|
|
@@ -262,17 +259,15 @@ async function handlePatternOperation(operation, args, logger, requestId, valida
|
|
|
262
259
|
}
|
|
263
260
|
catch (error) {
|
|
264
261
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
265
|
-
const vectorDBConfig = new index_1.VectorDBService({ collectionName: 'patterns' }).getConfig();
|
|
266
262
|
storageInfo = {
|
|
267
263
|
stored: false,
|
|
268
264
|
error: errorMessage,
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
patternId: workflowStep.data.pattern.id
|
|
265
|
+
collectionName: 'patterns',
|
|
266
|
+
patternId: workflowData.pattern.id
|
|
272
267
|
};
|
|
273
268
|
logger.error('Failed to store pattern in Vector DB', error, {
|
|
274
269
|
requestId,
|
|
275
|
-
patternId:
|
|
270
|
+
patternId: workflowData.pattern.id,
|
|
276
271
|
error: errorMessage
|
|
277
272
|
});
|
|
278
273
|
}
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* Handles pattern-specific Vector DB operations
|
|
5
5
|
* Extends BaseVectorService for organizational patterns
|
|
6
6
|
*/
|
|
7
|
-
import { VectorDBService } from './vector-db-service';
|
|
8
7
|
import { OrganizationalPattern } from './pattern-types';
|
|
9
8
|
import { EmbeddingService } from './embedding-service';
|
|
10
9
|
import { BaseVectorService, BaseSearchOptions, BaseSearchResult } from './base-vector-service';
|
|
@@ -13,11 +12,11 @@ export interface PatternSearchOptions extends BaseSearchOptions {
|
|
|
13
12
|
export interface PatternSearchResult extends BaseSearchResult<OrganizationalPattern> {
|
|
14
13
|
}
|
|
15
14
|
export declare class PatternVectorService extends BaseVectorService<OrganizationalPattern> {
|
|
16
|
-
constructor(collectionName?: string,
|
|
15
|
+
constructor(collectionName?: string, embeddingService?: EmbeddingService);
|
|
17
16
|
protected createSearchText(pattern: OrganizationalPattern): string;
|
|
18
17
|
protected extractId(pattern: OrganizationalPattern): string;
|
|
19
|
-
protected createPayload(pattern: OrganizationalPattern): Record<string,
|
|
20
|
-
protected payloadToData(payload: Record<string,
|
|
18
|
+
protected createPayload(pattern: OrganizationalPattern): Record<string, unknown>;
|
|
19
|
+
protected payloadToData(payload: Record<string, unknown>): OrganizationalPattern;
|
|
21
20
|
storePattern(pattern: OrganizationalPattern): Promise<void>;
|
|
22
21
|
searchPatterns(query: string, options?: PatternSearchOptions): Promise<PatternSearchResult[]>;
|
|
23
22
|
getPattern(id: string): Promise<OrganizationalPattern | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pattern-vector-service.d.ts","sourceRoot":"","sources":["../../src/core/pattern-vector-service.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"pattern-vector-service.d.ts","sourceRoot":"","sources":["../../src/core/pattern-vector-service.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAG/F,MAAM,WAAW,oBAAqB,SAAQ,iBAAiB;CAAG;AAElE,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB,CAAC,qBAAqB,CAAC;CAAG;AAEvF,qBAAa,oBAAqB,SAAQ,iBAAiB,CAAC,qBAAqB,CAAC;gBACpE,cAAc,GAAE,MAAmB,EAAE,gBAAgB,CAAC,EAAE,gBAAgB;IAKpF,SAAS,CAAC,gBAAgB,CAAC,OAAO,EAAE,qBAAqB,GAAG,MAAM;IAOlE,SAAS,CAAC,SAAS,CAAC,OAAO,EAAE,qBAAqB,GAAG,MAAM;IAI3D,SAAS,CAAC,aAAa,CAAC,OAAO,EAAE,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAWhF,SAAS,CAAC,aAAa,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,qBAAqB;IAa1E,YAAY,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3D,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,oBAAyB,GAAG,OAAO,CAAC,mBAAmB,EAAE,CAAC;IAIjG,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC;IAI7D,cAAc,IAAI,OAAO,CAAC,qBAAqB,EAAE,CAAC;IAIlD,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIxC,gBAAgB,IAAI,OAAO,CAAC,MAAM,CAAC;CAG1C"}
|
|
@@ -9,8 +9,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.PatternVectorService = void 0;
|
|
10
10
|
const base_vector_service_1 = require("./base-vector-service");
|
|
11
11
|
class PatternVectorService extends base_vector_service_1.BaseVectorService {
|
|
12
|
-
constructor(collectionName = 'patterns',
|
|
13
|
-
super(collectionName,
|
|
12
|
+
constructor(collectionName = 'patterns', embeddingService) {
|
|
13
|
+
super(collectionName, embeddingService);
|
|
14
14
|
}
|
|
15
15
|
// Implement abstract methods from BaseVectorService
|
|
16
16
|
createSearchText(pattern) {
|
|
@@ -13,7 +13,7 @@ export declare function getScriptsDir(): string;
|
|
|
13
13
|
* Extract JSON object from AI response with robust parsing
|
|
14
14
|
* Handles markdown code blocks and finds proper JSON boundaries
|
|
15
15
|
*/
|
|
16
|
-
export declare function extractJsonFromAIResponse(aiResponse: string):
|
|
16
|
+
export declare function extractJsonFromAIResponse(aiResponse: string): unknown;
|
|
17
17
|
/**
|
|
18
18
|
* Extract content from markdown code blocks in AI responses
|
|
19
19
|
* Handles various code block formats: ```yaml, ```yml, ```json, or plain ```
|
|
@@ -23,5 +23,5 @@ export declare function extractContentFromMarkdownCodeBlocks(content: string, la
|
|
|
23
23
|
* Extract JSON array from AI response with robust parsing
|
|
24
24
|
* Handles markdown code blocks and finds proper array boundaries
|
|
25
25
|
*/
|
|
26
|
-
export declare function extractJsonArrayFromAIResponse(aiResponse: string):
|
|
26
|
+
export declare function extractJsonArrayFromAIResponse(aiResponse: string): unknown[];
|
|
27
27
|
//# sourceMappingURL=platform-utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-utils.d.ts","sourceRoot":"","sources":["../../src/core/platform-utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAIrC,eAAO,MAAM,SAAS,2BAAkB,CAAC;AAEzC;;GAEG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAItC;AAGD;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"platform-utils.d.ts","sourceRoot":"","sources":["../../src/core/platform-utils.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAIrC,eAAO,MAAM,SAAS,2BAAkB,CAAC;AAEzC;;GAEG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAItC;AAGD;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAkCrE;AAED;;;GAGG;AACH,wBAAgB,oCAAoC,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAY/F;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,EAAE,CAkC5E"}
|
|
@@ -126,9 +126,13 @@ export declare class PluginManager {
|
|
|
126
126
|
*/
|
|
127
127
|
getToolPlugin(toolName: string): string | undefined;
|
|
128
128
|
/**
|
|
129
|
-
* Invoke a tool on
|
|
129
|
+
* Invoke a tool on a specific plugin (explicit routing)
|
|
130
|
+
*
|
|
131
|
+
* PRD #359: Unified plugin invocation with explicit plugin specification.
|
|
132
|
+
* Use this when you know which plugin provides the tool, avoiding
|
|
133
|
+
* ambiguity when multiple plugins might have tools with the same name.
|
|
130
134
|
*/
|
|
131
|
-
|
|
135
|
+
invokeToolOnPlugin(pluginName: string, toolName: string, args: Record<string, unknown>, state?: Record<string, unknown>, sessionId?: string): Promise<InvokeResponse>;
|
|
132
136
|
/**
|
|
133
137
|
* Create a ToolExecutor that routes plugin tools to plugins
|
|
134
138
|
*
|