@vfarcic/dot-ai 0.192.0 → 0.194.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 +6 -6
- package/dist/core/agent-display.d.ts +2 -4
- package/dist/core/agent-display.d.ts.map +1 -1
- package/dist/core/agent-display.js +4 -12
- package/dist/core/base-vector-service.d.ts +6 -0
- package/dist/core/base-vector-service.d.ts.map +1 -1
- package/dist/core/base-vector-service.js +18 -8
- package/dist/core/capabilities.d.ts +12 -0
- package/dist/core/capabilities.d.ts.map +1 -1
- package/dist/core/capability-operations.d.ts +3 -0
- package/dist/core/capability-operations.d.ts.map +1 -1
- package/dist/core/capability-operations.js +88 -5
- package/dist/core/capability-scan-workflow.d.ts +35 -5
- package/dist/core/capability-scan-workflow.d.ts.map +1 -1
- package/dist/core/capability-scan-workflow.js +169 -145
- package/dist/core/capability-vector-service.d.ts +11 -2
- package/dist/core/capability-vector-service.d.ts.map +1 -1
- package/dist/core/capability-vector-service.js +50 -0
- package/dist/core/discovery.d.ts +34 -0
- package/dist/core/discovery.d.ts.map +1 -1
- package/dist/core/discovery.js +105 -19
- package/dist/core/index.d.ts +0 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -6
- package/dist/core/kubectl-tools.d.ts +5 -0
- package/dist/core/kubectl-tools.d.ts.map +1 -1
- package/dist/core/kubectl-tools.js +74 -2
- package/dist/core/kubernetes-utils.d.ts +1 -0
- package/dist/core/kubernetes-utils.d.ts.map +1 -1
- package/dist/core/kubernetes-utils.js +92 -49
- package/dist/core/packaging.d.ts.map +1 -1
- package/dist/core/packaging.js +1 -0
- package/dist/core/resource-tools.d.ts +163 -1
- package/dist/core/resource-tools.d.ts.map +1 -1
- package/dist/core/resource-tools.js +343 -23
- package/dist/core/resource-vector-service.d.ts +17 -0
- package/dist/core/resource-vector-service.d.ts.map +1 -1
- package/dist/core/resource-vector-service.js +67 -3
- package/dist/core/telemetry/client.d.ts +16 -0
- package/dist/core/telemetry/client.d.ts.map +1 -0
- package/dist/core/telemetry/client.js +293 -0
- package/dist/core/telemetry/config.d.ts +12 -0
- package/dist/core/telemetry/config.d.ts.map +1 -0
- package/dist/core/telemetry/config.js +130 -0
- package/dist/core/telemetry/index.d.ts +30 -0
- package/dist/core/telemetry/index.d.ts.map +1 -0
- package/dist/core/telemetry/index.js +49 -0
- package/dist/core/telemetry/types.d.ts +125 -0
- package/dist/core/telemetry/types.d.ts.map +1 -0
- package/dist/core/telemetry/types.js +7 -0
- package/dist/core/tracing/index.d.ts +1 -1
- package/dist/core/tracing/index.d.ts.map +1 -1
- package/dist/core/tracing/tool-tracing.d.ts +11 -2
- package/dist/core/tracing/tool-tracing.d.ts.map +1 -1
- package/dist/core/tracing/tool-tracing.js +17 -3
- package/dist/core/vector-db-service.d.ts +7 -0
- package/dist/core/vector-db-service.d.ts.map +1 -1
- package/dist/core/vector-db-service.js +165 -61
- package/dist/core/visualization.d.ts +16 -1
- package/dist/core/visualization.d.ts.map +1 -1
- package/dist/core/visualization.js +64 -1
- package/dist/interfaces/mcp.d.ts +6 -0
- package/dist/interfaces/mcp.d.ts.map +1 -1
- package/dist/interfaces/mcp.js +36 -7
- package/dist/interfaces/rest-api.d.ts +63 -2
- package/dist/interfaces/rest-api.d.ts.map +1 -1
- package/dist/interfaces/rest-api.js +611 -51
- package/dist/mcp/server.js +55 -9
- package/dist/tools/answer-question.d.ts.map +1 -1
- package/dist/tools/answer-question.js +18 -0
- package/dist/tools/choose-solution.d.ts.map +1 -1
- package/dist/tools/choose-solution.js +22 -1
- package/dist/tools/deploy-manifests.d.ts.map +1 -1
- package/dist/tools/deploy-manifests.js +16 -2
- package/dist/tools/generate-manifests.d.ts.map +1 -1
- package/dist/tools/generate-manifests.js +12 -18
- package/dist/tools/operate.d.ts.map +1 -1
- package/dist/tools/operate.js +3 -11
- package/dist/tools/organizational-data.d.ts +1 -1
- package/dist/tools/organizational-data.d.ts.map +1 -1
- package/dist/tools/organizational-data.js +8 -17
- package/dist/tools/project-setup.d.ts.map +1 -1
- package/dist/tools/project-setup.js +5 -18
- package/dist/tools/query.d.ts +2 -11
- package/dist/tools/query.d.ts.map +1 -1
- package/dist/tools/query.js +63 -44
- package/dist/tools/recommend.d.ts +18 -1
- package/dist/tools/recommend.d.ts.map +1 -1
- package/dist/tools/recommend.js +44 -10
- package/dist/tools/remediate.d.ts.map +1 -1
- package/dist/tools/remediate.js +2 -24
- package/dist/tools/version.d.ts.map +1 -1
- package/dist/tools/version.js +4 -7
- package/package.json +2 -1
- package/prompts/partials/query-simple-output.md +11 -0
- package/prompts/partials/visualization-output.md +93 -0
- package/prompts/query-system.md +8 -12
- package/prompts/resource-selection.md +4 -0
- package/prompts/visualize.md +1 -68
- package/scripts/dot-ai.nu +1 -0
- package/scripts/reset-sync-and-scan-test-cluster.sh +120 -0
- package/shared-prompts/prd-create.md +1 -1
- package/dist/core/feedback.d.ts +0 -43
- package/dist/core/feedback.d.ts.map +0 -1
- package/dist/core/feedback.js +0 -98
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PostHog Telemetry Type Definitions
|
|
3
|
+
*
|
|
4
|
+
* Defines types for anonymous usage telemetry.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Telemetry configuration loaded from environment
|
|
8
|
+
*/
|
|
9
|
+
export interface TelemetryConfig {
|
|
10
|
+
/** Whether telemetry is enabled (default: true, can be disabled via DOT_AI_TELEMETRY=false) */
|
|
11
|
+
enabled: boolean;
|
|
12
|
+
/** PostHog API key (public, safe to expose) */
|
|
13
|
+
posthogKey: string;
|
|
14
|
+
/** PostHog host URL */
|
|
15
|
+
posthogHost: string;
|
|
16
|
+
/** dot-ai version from package.json */
|
|
17
|
+
dotAiVersion: string;
|
|
18
|
+
/** AI provider being used */
|
|
19
|
+
aiProvider: string;
|
|
20
|
+
/** Enable debug logging */
|
|
21
|
+
debug: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Base properties included in all telemetry events
|
|
25
|
+
*/
|
|
26
|
+
export interface BaseEventProperties {
|
|
27
|
+
/** dot-ai version */
|
|
28
|
+
dot_ai_version: string;
|
|
29
|
+
/** AI provider (anthropic, openai, etc.) */
|
|
30
|
+
ai_provider: string;
|
|
31
|
+
/** Whether this is an internal/test instance (for PostHog filtering) */
|
|
32
|
+
is_internal: boolean;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Properties for tool_executed event
|
|
36
|
+
*/
|
|
37
|
+
export interface ToolExecutedEventProperties extends BaseEventProperties {
|
|
38
|
+
/** Name of the tool that was executed */
|
|
39
|
+
tool: string;
|
|
40
|
+
/** Whether the execution was successful */
|
|
41
|
+
success: boolean;
|
|
42
|
+
/** Execution duration in milliseconds */
|
|
43
|
+
duration_ms: number;
|
|
44
|
+
/** MCP client name (e.g., "claude-code", "cursor") */
|
|
45
|
+
mcp_client?: string;
|
|
46
|
+
/** MCP client version */
|
|
47
|
+
mcp_client_version?: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Properties for tool_error event
|
|
51
|
+
*/
|
|
52
|
+
export interface ToolErrorEventProperties extends BaseEventProperties {
|
|
53
|
+
/** Name of the tool that errored */
|
|
54
|
+
tool: string;
|
|
55
|
+
/** Error type/class name (not the message, for privacy) */
|
|
56
|
+
error_type: string;
|
|
57
|
+
/** MCP client name (e.g., "claude-code", "cursor") */
|
|
58
|
+
mcp_client?: string;
|
|
59
|
+
/** MCP client version */
|
|
60
|
+
mcp_client_version?: string;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Properties for client_connected event
|
|
64
|
+
*/
|
|
65
|
+
export interface ClientConnectedEventProperties extends BaseEventProperties {
|
|
66
|
+
/** MCP client name (e.g., "claude-code", "cursor", "windsurf") */
|
|
67
|
+
mcp_client: string;
|
|
68
|
+
/** MCP client version */
|
|
69
|
+
mcp_client_version: string;
|
|
70
|
+
/** Transport type (stdio, http) */
|
|
71
|
+
transport: string;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Properties for server_started event
|
|
75
|
+
*/
|
|
76
|
+
export interface ServerStartedEventProperties extends BaseEventProperties {
|
|
77
|
+
/** Kubernetes version if available */
|
|
78
|
+
k8s_version?: string;
|
|
79
|
+
/** Deployment method (helm, docker, local) */
|
|
80
|
+
deployment_method?: string;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Properties for server_stopped event
|
|
84
|
+
*/
|
|
85
|
+
export interface ServerStoppedEventProperties extends BaseEventProperties {
|
|
86
|
+
/** Server uptime in seconds */
|
|
87
|
+
uptime_seconds: number;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Union of all event property types
|
|
91
|
+
*/
|
|
92
|
+
export type TelemetryEventProperties = ToolExecutedEventProperties | ToolErrorEventProperties | ServerStartedEventProperties | ServerStoppedEventProperties | ClientConnectedEventProperties;
|
|
93
|
+
/**
|
|
94
|
+
* Telemetry event names
|
|
95
|
+
*/
|
|
96
|
+
export type TelemetryEventName = 'tool_executed' | 'tool_error' | 'server_started' | 'server_stopped' | 'client_connected';
|
|
97
|
+
/**
|
|
98
|
+
* MCP client info for telemetry
|
|
99
|
+
*/
|
|
100
|
+
export interface McpClientInfo {
|
|
101
|
+
name: string;
|
|
102
|
+
version: string;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Telemetry service interface
|
|
106
|
+
*/
|
|
107
|
+
export interface TelemetryService {
|
|
108
|
+
/** Check if telemetry is enabled */
|
|
109
|
+
isEnabled(): boolean;
|
|
110
|
+
/** Track a telemetry event */
|
|
111
|
+
trackEvent(event: TelemetryEventName, properties: TelemetryEventProperties): void;
|
|
112
|
+
/** Track tool execution */
|
|
113
|
+
trackToolExecution(tool: string, success: boolean, durationMs: number, mcpClient?: McpClientInfo): void;
|
|
114
|
+
/** Track tool error */
|
|
115
|
+
trackToolError(tool: string, errorType: string, mcpClient?: McpClientInfo): void;
|
|
116
|
+
/** Track server start */
|
|
117
|
+
trackServerStart(k8sVersion?: string, deploymentMethod?: string): void;
|
|
118
|
+
/** Track server stop */
|
|
119
|
+
trackServerStop(uptimeSeconds: number): void;
|
|
120
|
+
/** Track MCP client connection */
|
|
121
|
+
trackClientConnected(mcpClient: McpClientInfo, transport: string): void;
|
|
122
|
+
/** Flush pending events and shutdown */
|
|
123
|
+
shutdown(): Promise<void>;
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/core/telemetry/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,+FAA+F;IAC/F,OAAO,EAAE,OAAO,CAAC;IACjB,+CAA+C;IAC/C,UAAU,EAAE,MAAM,CAAC;IACnB,uBAAuB;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,uCAAuC;IACvC,YAAY,EAAE,MAAM,CAAC;IACrB,6BAA6B;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,2BAA2B;IAC3B,KAAK,EAAE,OAAO,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,qBAAqB;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,4CAA4C;IAC5C,WAAW,EAAE,MAAM,CAAC;IACpB,wEAAwE;IACxE,WAAW,EAAE,OAAO,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,2BAA4B,SAAQ,mBAAmB;IACtE,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,2CAA2C;IAC3C,OAAO,EAAE,OAAO,CAAC;IACjB,yCAAyC;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,sDAAsD;IACtD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yBAAyB;IACzB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;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ElF,2BAA2B;IAC3B,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IAExG,uBAAuB;IACvB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IAEjF,yBAAyB;IACzB,gBAAgB,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvE,wBAAwB;IACxB,eAAe,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAE7C,kCAAkC;IAClC,oBAAoB,CAAC,SAAS,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAExE,wCAAwC;IACxC,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B"}
|
|
@@ -7,7 +7,7 @@ export * from './types';
|
|
|
7
7
|
export * from './config';
|
|
8
8
|
export { getTracer, shutdownTracer, withSpan } from './tracer';
|
|
9
9
|
export { createHttpServerSpan, withHttpServerTracing } from './http-tracing';
|
|
10
|
-
export { withToolTracing } from './tool-tracing';
|
|
10
|
+
export { withToolTracing, ToolTracingOptions } from './tool-tracing';
|
|
11
11
|
export { withAITracing } from './ai-tracing';
|
|
12
12
|
export { createTracedK8sClient, withKubectlTracing } from './k8s-tracing';
|
|
13
13
|
export { withQdrantTracing } from './qdrant-tracing';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/tracing/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/tracing/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -6,6 +6,14 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Supports both STDIO (MCP) and HTTP (REST) transports transparently.
|
|
8
8
|
*/
|
|
9
|
+
import { McpClientInfo } from '../telemetry';
|
|
10
|
+
/**
|
|
11
|
+
* Options for tool tracing
|
|
12
|
+
*/
|
|
13
|
+
export interface ToolTracingOptions {
|
|
14
|
+
/** MCP client info for telemetry attribution */
|
|
15
|
+
mcpClient?: McpClientInfo;
|
|
16
|
+
}
|
|
9
17
|
/**
|
|
10
18
|
* Wraps a tool handler with OpenTelemetry tracing
|
|
11
19
|
*
|
|
@@ -18,14 +26,15 @@
|
|
|
18
26
|
* @param toolName - Name of the MCP tool being executed
|
|
19
27
|
* @param args - Tool input arguments (will be serialized to JSON)
|
|
20
28
|
* @param handler - Async function that implements the tool logic
|
|
29
|
+
* @param options - Optional tracing options (e.g., MCP client info)
|
|
21
30
|
* @returns Promise resolving to the tool handler result
|
|
22
31
|
*
|
|
23
32
|
* @example
|
|
24
33
|
* ```typescript
|
|
25
34
|
* const result = await withToolTracing('recommend', { intent: 'deploy postgres' }, async (args) => {
|
|
26
35
|
* return await handleRecommendTool(args);
|
|
27
|
-
* });
|
|
36
|
+
* }, { mcpClient: { name: 'claude-code', version: '1.0.0' } });
|
|
28
37
|
* ```
|
|
29
38
|
*/
|
|
30
|
-
export declare function withToolTracing<T>(toolName: string, args: any, handler: (args: any) => Promise<T
|
|
39
|
+
export declare function withToolTracing<T>(toolName: string, args: any, handler: (args: any) => Promise<T>, options?: ToolTracingOptions): Promise<T>;
|
|
31
40
|
//# sourceMappingURL=tool-tracing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-tracing.d.ts","sourceRoot":"","sources":["../../../src/core/tracing/tool-tracing.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"tool-tracing.d.ts","sourceRoot":"","sources":["../../../src/core/tracing/tool-tracing.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAgB,aAAa,EAAE,MAAM,cAAc,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,gDAAgD;IAChD,SAAS,CAAC,EAAE,aAAa,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,eAAe,CAAC,CAAC,EACrC,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,GAAG,EACT,OAAO,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,CAAC,CAAC,EAClC,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CAAC,CAAC,CAAC,CA+DZ"}
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
11
|
exports.withToolTracing = withToolTracing;
|
|
12
12
|
const api_1 = require("@opentelemetry/api");
|
|
13
|
+
const telemetry_1 = require("../telemetry");
|
|
13
14
|
/**
|
|
14
15
|
* Wraps a tool handler with OpenTelemetry tracing
|
|
15
16
|
*
|
|
@@ -22,16 +23,17 @@ const api_1 = require("@opentelemetry/api");
|
|
|
22
23
|
* @param toolName - Name of the MCP tool being executed
|
|
23
24
|
* @param args - Tool input arguments (will be serialized to JSON)
|
|
24
25
|
* @param handler - Async function that implements the tool logic
|
|
26
|
+
* @param options - Optional tracing options (e.g., MCP client info)
|
|
25
27
|
* @returns Promise resolving to the tool handler result
|
|
26
28
|
*
|
|
27
29
|
* @example
|
|
28
30
|
* ```typescript
|
|
29
31
|
* const result = await withToolTracing('recommend', { intent: 'deploy postgres' }, async (args) => {
|
|
30
32
|
* return await handleRecommendTool(args);
|
|
31
|
-
* });
|
|
33
|
+
* }, { mcpClient: { name: 'claude-code', version: '1.0.0' } });
|
|
32
34
|
* ```
|
|
33
35
|
*/
|
|
34
|
-
async function withToolTracing(toolName, args, handler) {
|
|
36
|
+
async function withToolTracing(toolName, args, handler, options) {
|
|
35
37
|
const tracer = api_1.trace.getTracer('dot-ai-mcp');
|
|
36
38
|
// Create INTERNAL span for tool execution
|
|
37
39
|
// Using INTERNAL kind since this is business logic within the server process
|
|
@@ -41,13 +43,18 @@ async function withToolTracing(toolName, args, handler) {
|
|
|
41
43
|
// GenAI semantic conventions for tool execution
|
|
42
44
|
'gen_ai.tool.name': toolName,
|
|
43
45
|
'gen_ai.tool.input': JSON.stringify(args, null, 2),
|
|
46
|
+
// MCP client info (if available)
|
|
47
|
+
...(options?.mcpClient && {
|
|
48
|
+
'mcp.client.name': options.mcpClient.name,
|
|
49
|
+
'mcp.client.version': options.mcpClient.version,
|
|
50
|
+
}),
|
|
44
51
|
},
|
|
45
52
|
});
|
|
46
53
|
// Execute handler within active span context
|
|
47
54
|
// This ensures any child spans (AI calls, K8s operations) become children of this span
|
|
48
55
|
return await api_1.context.with(api_1.trace.setSpan(api_1.context.active(), span), async () => {
|
|
56
|
+
const startTime = Date.now();
|
|
49
57
|
try {
|
|
50
|
-
const startTime = Date.now();
|
|
51
58
|
const result = await handler(args);
|
|
52
59
|
const duration = Date.now() - startTime;
|
|
53
60
|
// Record success metrics
|
|
@@ -56,15 +63,22 @@ async function withToolTracing(toolName, args, handler) {
|
|
|
56
63
|
'gen_ai.tool.success': true,
|
|
57
64
|
});
|
|
58
65
|
span.setStatus({ code: api_1.SpanStatusCode.OK });
|
|
66
|
+
// Track telemetry (fire-and-forget, async)
|
|
67
|
+
(0, telemetry_1.getTelemetry)().trackToolExecution(toolName, true, duration, options?.mcpClient);
|
|
59
68
|
return result;
|
|
60
69
|
}
|
|
61
70
|
catch (error) {
|
|
71
|
+
const duration = Date.now() - startTime;
|
|
72
|
+
const errorType = error.constructor?.name || 'Error';
|
|
62
73
|
// Record error details without disrupting original error flow
|
|
63
74
|
span.recordException(error);
|
|
64
75
|
span.setStatus({
|
|
65
76
|
code: api_1.SpanStatusCode.ERROR,
|
|
66
77
|
message: error.message,
|
|
67
78
|
});
|
|
79
|
+
// Track telemetry for failed execution (fire-and-forget, async)
|
|
80
|
+
(0, telemetry_1.getTelemetry)().trackToolExecution(toolName, false, duration, options?.mcpClient);
|
|
81
|
+
(0, telemetry_1.getTelemetry)().trackToolError(toolName, errorType, options?.mcpClient);
|
|
68
82
|
// Re-throw to preserve original error handling behavior
|
|
69
83
|
throw error;
|
|
70
84
|
}
|
|
@@ -21,6 +21,7 @@ export interface SearchResult {
|
|
|
21
21
|
export interface SearchOptions {
|
|
22
22
|
limit?: number;
|
|
23
23
|
scoreThreshold?: number;
|
|
24
|
+
filter?: Record<string, any>;
|
|
24
25
|
}
|
|
25
26
|
export declare class VectorDBService {
|
|
26
27
|
private client;
|
|
@@ -29,6 +30,10 @@ export declare class VectorDBService {
|
|
|
29
30
|
constructor(config?: VectorDBConfig);
|
|
30
31
|
private validateConfig;
|
|
31
32
|
private shouldInitializeClient;
|
|
33
|
+
/**
|
|
34
|
+
* Check if collection exists without creating it
|
|
35
|
+
*/
|
|
36
|
+
collectionExists(): Promise<boolean>;
|
|
32
37
|
/**
|
|
33
38
|
* Initialize the collection if it doesn't exist
|
|
34
39
|
*/
|
|
@@ -68,11 +73,13 @@ export declare class VectorDBService {
|
|
|
68
73
|
* Scroll documents with Qdrant filter
|
|
69
74
|
* @param filter - Qdrant filter object (must/should/must_not conditions)
|
|
70
75
|
* @param limit - Maximum documents to retrieve
|
|
76
|
+
* Uses semaphore to limit concurrent Qdrant operations
|
|
71
77
|
*/
|
|
72
78
|
scrollWithFilter(filter: any, limit?: number): Promise<VectorDocument[]>;
|
|
73
79
|
/**
|
|
74
80
|
* Get all documents (for listing)
|
|
75
81
|
* @param limit - Maximum number of documents to retrieve. Defaults to unlimited (10000).
|
|
82
|
+
* Uses semaphore to limit concurrent Qdrant operations
|
|
76
83
|
*/
|
|
77
84
|
getAllDocuments(limit?: number): Promise<VectorDocument[]>;
|
|
78
85
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vector-db-service.d.ts","sourceRoot":"","sources":["../../src/core/vector-db-service.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"vector-db-service.d.ts","sourceRoot":"","sources":["../../src/core/vector-db-service.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAgDH,MAAM,WAAW,cAAc;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;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G;IACG,eAAe,CAAC,KAAK,GAAE,MAAc,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAgDvE;;OAEG;IACG,iBAAiB,IAAI,OAAO,CAAC,GAAG,CAAC;IAqBvC;;OAEG;IACG,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAsBrC;;OAEG;IACH,aAAa,IAAI,OAAO;IAIxB;;OAEG;IACH,SAAS,IAAI,cAAc;CAG5B"}
|
|
@@ -8,6 +8,44 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
8
8
|
exports.VectorDBService = void 0;
|
|
9
9
|
const js_client_rest_1 = require("@qdrant/js-client-rest");
|
|
10
10
|
const qdrant_tracing_1 = require("./tracing/qdrant-tracing");
|
|
11
|
+
/**
|
|
12
|
+
* Escape special regex characters to prevent ReDoS attacks
|
|
13
|
+
*/
|
|
14
|
+
function escapeRegExp(str) {
|
|
15
|
+
return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Simple semaphore to limit concurrent Qdrant operations
|
|
19
|
+
* Prevents overwhelming Qdrant with too many parallel requests
|
|
20
|
+
*/
|
|
21
|
+
class QdrantSemaphore {
|
|
22
|
+
maxConcurrent;
|
|
23
|
+
currentCount = 0;
|
|
24
|
+
waitQueue = [];
|
|
25
|
+
constructor(maxConcurrent = 20) {
|
|
26
|
+
this.maxConcurrent = maxConcurrent;
|
|
27
|
+
}
|
|
28
|
+
async acquire() {
|
|
29
|
+
if (this.currentCount < this.maxConcurrent) {
|
|
30
|
+
this.currentCount++;
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
return new Promise((resolve) => {
|
|
34
|
+
this.waitQueue.push(resolve);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
release() {
|
|
38
|
+
if (this.waitQueue.length > 0) {
|
|
39
|
+
const next = this.waitQueue.shift();
|
|
40
|
+
next();
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
this.currentCount--;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
// Limit to 20 concurrent Qdrant operations
|
|
48
|
+
const qdrantSemaphore = new QdrantSemaphore(20);
|
|
11
49
|
class VectorDBService {
|
|
12
50
|
client = null;
|
|
13
51
|
config;
|
|
@@ -44,6 +82,21 @@ class VectorDBService {
|
|
|
44
82
|
const testUrls = ['test-url', 'mock-url'];
|
|
45
83
|
return !testUrls.includes(this.config.url || '');
|
|
46
84
|
}
|
|
85
|
+
/**
|
|
86
|
+
* Check if collection exists without creating it
|
|
87
|
+
*/
|
|
88
|
+
async collectionExists() {
|
|
89
|
+
if (!this.client) {
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
92
|
+
try {
|
|
93
|
+
const collections = await this.client.getCollections();
|
|
94
|
+
return collections.collections.some(col => col.name === this.collectionName);
|
|
95
|
+
}
|
|
96
|
+
catch {
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
47
100
|
/**
|
|
48
101
|
* Initialize the collection if it doesn't exist
|
|
49
102
|
*/
|
|
@@ -181,7 +234,8 @@ class VectorDBService {
|
|
|
181
234
|
vector,
|
|
182
235
|
limit,
|
|
183
236
|
score_threshold: scoreThreshold,
|
|
184
|
-
with_payload: true
|
|
237
|
+
with_payload: true,
|
|
238
|
+
...(options.filter && { filter: options.filter })
|
|
185
239
|
});
|
|
186
240
|
return searchResult.map(result => ({
|
|
187
241
|
id: result.id.toString(),
|
|
@@ -215,22 +269,56 @@ class VectorDBService {
|
|
|
215
269
|
const scrollResult = await this.client.scroll(this.collectionName, {
|
|
216
270
|
limit: 1000, // Get all documents for filtering
|
|
217
271
|
with_payload: true,
|
|
218
|
-
with_vector: false
|
|
272
|
+
with_vector: false,
|
|
273
|
+
...(options.filter && { filter: options.filter })
|
|
219
274
|
});
|
|
220
|
-
// Filter documents by checking if any keyword matches
|
|
221
|
-
const
|
|
222
|
-
|
|
223
|
-
|
|
275
|
+
// Filter documents by checking if any keyword matches searchText or triggers
|
|
276
|
+
const scoredPoints = scrollResult.points
|
|
277
|
+
.map(point => {
|
|
278
|
+
if (!point.payload)
|
|
279
|
+
return null;
|
|
280
|
+
const searchText = (point.payload.searchText || '').toLowerCase();
|
|
281
|
+
const triggers = Array.isArray(point.payload.triggers)
|
|
282
|
+
? point.payload.triggers.map(t => t.toLowerCase())
|
|
283
|
+
: [];
|
|
284
|
+
// Count keyword matches for scoring
|
|
285
|
+
let matchCount = 0;
|
|
286
|
+
let exactMatch = false;
|
|
287
|
+
for (const keyword of keywords) {
|
|
288
|
+
const kw = keyword.toLowerCase();
|
|
289
|
+
// Check searchText (name, kind, namespace, labels, etc.)
|
|
290
|
+
if (searchText.includes(kw)) {
|
|
291
|
+
matchCount++;
|
|
292
|
+
// Bonus for exact word match (surrounded by spaces/punctuation)
|
|
293
|
+
const wordPattern = new RegExp(`\\b${escapeRegExp(kw)}\\b`, 'i');
|
|
294
|
+
if (wordPattern.test(searchText)) {
|
|
295
|
+
exactMatch = true;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
// Check triggers (for patterns/policies)
|
|
299
|
+
if (triggers.some(t => t.includes(kw) || kw.includes(t))) {
|
|
300
|
+
matchCount++;
|
|
301
|
+
}
|
|
224
302
|
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
303
|
+
if (matchCount === 0)
|
|
304
|
+
return null;
|
|
305
|
+
// Score based on match quality
|
|
306
|
+
// - Base score from match ratio
|
|
307
|
+
// - Bonus for exact word matches
|
|
308
|
+
const baseScore = matchCount / keywords.length;
|
|
309
|
+
const score = exactMatch ? Math.min(1.0, baseScore + 0.3) : baseScore;
|
|
310
|
+
return {
|
|
311
|
+
point,
|
|
312
|
+
score
|
|
313
|
+
};
|
|
314
|
+
})
|
|
315
|
+
.filter((item) => item !== null)
|
|
316
|
+
.sort((a, b) => b.score - a.score);
|
|
229
317
|
// Apply limit after filtering
|
|
230
|
-
const limitedResults =
|
|
231
|
-
return limitedResults.map(point => ({
|
|
318
|
+
const limitedResults = scoredPoints.slice(0, limit);
|
|
319
|
+
return limitedResults.map(({ point, score }) => ({
|
|
232
320
|
id: point.id.toString(),
|
|
233
|
-
score
|
|
321
|
+
score,
|
|
234
322
|
payload: point.payload || {}
|
|
235
323
|
}));
|
|
236
324
|
}
|
|
@@ -343,69 +431,85 @@ class VectorDBService {
|
|
|
343
431
|
* Scroll documents with Qdrant filter
|
|
344
432
|
* @param filter - Qdrant filter object (must/should/must_not conditions)
|
|
345
433
|
* @param limit - Maximum documents to retrieve
|
|
434
|
+
* Uses semaphore to limit concurrent Qdrant operations
|
|
346
435
|
*/
|
|
347
436
|
async scrollWithFilter(filter, limit = 100) {
|
|
348
437
|
if (!this.client) {
|
|
349
438
|
throw new Error('Vector DB client not initialized');
|
|
350
439
|
}
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
440
|
+
// Acquire semaphore slot before executing
|
|
441
|
+
await qdrantSemaphore.acquire();
|
|
442
|
+
try {
|
|
443
|
+
return await (0, qdrant_tracing_1.withQdrantTracing)({
|
|
444
|
+
operation: 'vector.scroll_filtered',
|
|
445
|
+
collectionName: this.collectionName,
|
|
446
|
+
limit,
|
|
447
|
+
serverUrl: this.config.url
|
|
448
|
+
}, async () => {
|
|
449
|
+
try {
|
|
450
|
+
const scrollResult = await this.client.scroll(this.collectionName, {
|
|
451
|
+
filter,
|
|
452
|
+
limit,
|
|
453
|
+
with_payload: true,
|
|
454
|
+
with_vector: false
|
|
455
|
+
});
|
|
456
|
+
return scrollResult.points.map(point => ({
|
|
457
|
+
id: point.id.toString(),
|
|
458
|
+
payload: point.payload || {}
|
|
459
|
+
}));
|
|
460
|
+
}
|
|
461
|
+
catch (error) {
|
|
462
|
+
throw new Error(`Failed to scroll with filter: ${error}`);
|
|
463
|
+
}
|
|
464
|
+
});
|
|
465
|
+
}
|
|
466
|
+
finally {
|
|
467
|
+
qdrantSemaphore.release();
|
|
468
|
+
}
|
|
373
469
|
}
|
|
374
470
|
/**
|
|
375
471
|
* Get all documents (for listing)
|
|
376
472
|
* @param limit - Maximum number of documents to retrieve. Defaults to unlimited (10000).
|
|
473
|
+
* Uses semaphore to limit concurrent Qdrant operations
|
|
377
474
|
*/
|
|
378
475
|
async getAllDocuments(limit = 10000) {
|
|
379
476
|
if (!this.client) {
|
|
380
477
|
throw new Error('Vector DB client not initialized');
|
|
381
478
|
}
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
479
|
+
// Acquire semaphore slot before executing
|
|
480
|
+
await qdrantSemaphore.acquire();
|
|
481
|
+
try {
|
|
482
|
+
return await (0, qdrant_tracing_1.withQdrantTracing)({
|
|
483
|
+
operation: 'vector.list',
|
|
484
|
+
collectionName: this.collectionName,
|
|
485
|
+
limit,
|
|
486
|
+
serverUrl: this.config.url
|
|
487
|
+
}, async () => {
|
|
488
|
+
try {
|
|
489
|
+
// Check if collection exists first
|
|
490
|
+
const collections = await this.client.getCollections();
|
|
491
|
+
const collectionExists = collections.collections.some(col => col.name === this.collectionName);
|
|
492
|
+
if (!collectionExists) {
|
|
493
|
+
throw new Error(`Collection '${this.collectionName}' does not exist. No data has been stored yet.`);
|
|
494
|
+
}
|
|
495
|
+
const scrollResult = await this.client.scroll(this.collectionName, {
|
|
496
|
+
limit,
|
|
497
|
+
with_payload: true,
|
|
498
|
+
with_vector: false
|
|
499
|
+
});
|
|
500
|
+
return scrollResult.points.map(point => ({
|
|
501
|
+
id: point.id.toString(),
|
|
502
|
+
payload: point.payload || {}
|
|
503
|
+
}));
|
|
394
504
|
}
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
}));
|
|
404
|
-
}
|
|
405
|
-
catch (error) {
|
|
406
|
-
throw new Error(`Failed to get all documents: ${error}`);
|
|
407
|
-
}
|
|
408
|
-
});
|
|
505
|
+
catch (error) {
|
|
506
|
+
throw new Error(`Failed to get all documents: ${error}`);
|
|
507
|
+
}
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
finally {
|
|
511
|
+
qdrantSemaphore.release();
|
|
512
|
+
}
|
|
409
513
|
}
|
|
410
514
|
/**
|
|
411
515
|
* Get collection info and statistics
|
|
@@ -4,7 +4,12 @@
|
|
|
4
4
|
* Common utilities for visualization support across all MCP tools.
|
|
5
5
|
* Provides session metadata interfaces, URL generation, and prompt selection.
|
|
6
6
|
*/
|
|
7
|
-
import { VisualizationType } from '../interfaces/rest-api';
|
|
7
|
+
import { VisualizationType, VisualizationResponse } from '../interfaces/rest-api';
|
|
8
|
+
/**
|
|
9
|
+
* Visualization mode prefix - when present in intent, return visualization data directly
|
|
10
|
+
* Used by tools to detect when caller wants visualization output instead of summary
|
|
11
|
+
*/
|
|
12
|
+
export declare const VISUALIZATION_PREFIX = "[visualization]";
|
|
8
13
|
/**
|
|
9
14
|
* Cached visualization structure stored in sessions
|
|
10
15
|
* PRD #320: Added toolsUsed for test validation of mermaid validation
|
|
@@ -74,4 +79,14 @@ export declare const TOOL_SESSION_PREFIXES: Record<string, string>;
|
|
|
74
79
|
* @returns Tool name or undefined if not recognized
|
|
75
80
|
*/
|
|
76
81
|
export declare function getToolNameFromPrefix(prefix: string): string | undefined;
|
|
82
|
+
/**
|
|
83
|
+
* Parse AI response into VisualizationResponse
|
|
84
|
+
* Extracts JSON from AI response, validates structure, normalizes insights
|
|
85
|
+
*
|
|
86
|
+
* @param aiResponse - Raw AI response string
|
|
87
|
+
* @param toolsUsed - Optional array of tools used during generation
|
|
88
|
+
* @returns Parsed VisualizationResponse
|
|
89
|
+
* @throws Error if parsing or validation fails
|
|
90
|
+
*/
|
|
91
|
+
export declare function parseVisualizationResponse(aiResponse: string, toolsUsed?: string[]): VisualizationResponse;
|
|
77
92
|
//# sourceMappingURL=visualization.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visualization.d.ts","sourceRoot":"","sources":["../../src/core/visualization.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"visualization.d.ts","sourceRoot":"","sources":["../../src/core/visualization.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAElF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,oBAAoB,CAAC;AAEtD;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,KAAK,CAAC;QACpB,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,iBAAiB,CAAC;QACxB,OAAO,EAAE,GAAG,CAAC;KACd,CAAC,CAAC;IACH,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,iFAAiF;IACjF,QAAQ,EAAE,MAAM,CAAC;IACjB,oFAAoF;IACpF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kDAAkD;IAClD,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;CAC3C;AAED;;GAEG;AAC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