@vfarcic/dot-ai 0.185.0 → 0.187.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/dist/core/ai-provider-factory.d.ts.map +1 -1
  2. package/dist/core/ai-provider-factory.js +2 -1
  3. package/dist/core/capability-operations.d.ts.map +1 -1
  4. package/dist/core/capability-operations.js +3 -2
  5. package/dist/core/capability-tools.d.ts.map +1 -1
  6. package/dist/core/capability-tools.js +3 -2
  7. package/dist/core/constants/errors.d.ts +202 -0
  8. package/dist/core/constants/errors.d.ts.map +1 -0
  9. package/dist/core/constants/errors.js +206 -0
  10. package/dist/core/constants/index.d.ts +11 -0
  11. package/dist/core/constants/index.d.ts.map +1 -0
  12. package/dist/core/constants/index.js +26 -0
  13. package/dist/core/constants/investigation.d.ts +45 -0
  14. package/dist/core/constants/investigation.d.ts.map +1 -0
  15. package/dist/core/constants/investigation.js +47 -0
  16. package/dist/core/constants/stages.d.ts +38 -0
  17. package/dist/core/constants/stages.d.ts.map +1 -0
  18. package/dist/core/constants/stages.js +40 -0
  19. package/dist/core/constants/validation.d.ts +43 -0
  20. package/dist/core/constants/validation.d.ts.map +1 -0
  21. package/dist/core/constants/validation.js +45 -0
  22. package/dist/core/index.d.ts.map +1 -1
  23. package/dist/core/index.js +4 -3
  24. package/dist/core/kubectl-tools.d.ts.map +1 -1
  25. package/dist/core/kubectl-tools.js +10 -9
  26. package/dist/core/kubernetes-utils.d.ts.map +1 -1
  27. package/dist/core/kubernetes-utils.js +14 -13
  28. package/dist/core/pattern-operations.d.ts.map +1 -1
  29. package/dist/core/pattern-operations.js +2 -1
  30. package/dist/core/policy-operations.d.ts.map +1 -1
  31. package/dist/core/policy-operations.js +6 -4
  32. package/dist/core/providers/host-provider.d.ts.map +1 -1
  33. package/dist/core/providers/host-provider.js +2 -1
  34. package/dist/core/providers/noop-provider.d.ts.map +1 -1
  35. package/dist/core/providers/noop-provider.js +2 -2
  36. package/dist/core/providers/vercel-provider.d.ts.map +1 -1
  37. package/dist/core/providers/vercel-provider.js +5 -3
  38. package/dist/core/resource-tools.d.ts.map +1 -1
  39. package/dist/core/resource-tools.js +3 -2
  40. package/dist/core/schema.d.ts.map +1 -1
  41. package/dist/core/schema.js +2 -1
  42. package/dist/tools/answer-question.d.ts.map +1 -1
  43. package/dist/tools/answer-question.js +18 -17
  44. package/dist/tools/organizational-data.d.ts.map +1 -1
  45. package/dist/tools/organizational-data.js +3 -2
  46. package/dist/tools/prompts.d.ts.map +1 -1
  47. package/dist/tools/prompts.js +2 -1
  48. package/dist/tools/version.d.ts +6 -0
  49. package/dist/tools/version.d.ts.map +1 -1
  50. package/dist/tools/version.js +45 -4
  51. package/package.json +1 -1
  52. package/scripts/dot-ai.nu +24 -76
  53. package/scripts/jaeger.nu +11 -7
@@ -1 +1 @@
1
- {"version":3,"file":"ai-provider-factory.d.ts","sourceRoot":"","sources":["../../src/core/ai-provider-factory.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,UAAU,EACV,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AA6BjC;;;;;;;;;;;;;;GAcG;AACH,qBAAa,iBAAiB;IAC5B;;;;;;OAMG;IACH,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,gBAAgB,GAAG,UAAU;IA2BnD;;;;;;;;;;OAUG;IACH,MAAM,CAAC,aAAa,IAAI,UAAU;IAoFlC;;;;;OAKG;IACH,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAWrD;;;;OAIG;IACH,MAAM,CAAC,qBAAqB,IAAI,MAAM,EAAE;IAMxC;;;;;OAKG;IACH,MAAM,CAAC,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;CAGxD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,UAAU,CAE7C"}
1
+ {"version":3,"file":"ai-provider-factory.d.ts","sourceRoot":"","sources":["../../src/core/ai-provider-factory.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EACL,UAAU,EACV,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AA8BjC;;;;;;;;;;;;;;GAcG;AACH,qBAAa,iBAAiB;IAC5B;;;;;;OAMG;IACH,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,gBAAgB,GAAG,UAAU;IA2BnD;;;;;;;;;;OAUG;IACH,MAAM,CAAC,aAAa,IAAI,UAAU;IAoFlC;;;;;OAKG;IACH,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAWrD;;;;OAIG;IACH,MAAM,CAAC,qBAAqB,IAAI,MAAM,EAAE;IAMxC;;;;;OAKG;IACH,MAAM,CAAC,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;CAGxD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,UAAU,CAE7C"}
@@ -14,6 +14,7 @@ exports.createAIProvider = createAIProvider;
14
14
  const vercel_provider_1 = require("./providers/vercel-provider");
15
15
  const host_provider_1 = require("./providers/host-provider");
16
16
  const noop_provider_1 = require("./providers/noop-provider");
17
+ const constants_1 = require("./constants");
17
18
  const model_config_1 = require("./model-config");
18
19
  /**
19
20
  * Provider environment variable mappings
@@ -60,7 +61,7 @@ class AIProviderFactory {
60
61
  }
61
62
  // Validate configuration
62
63
  if (!config.apiKey) {
63
- throw new Error(`API key is required for ${config.provider} provider`);
64
+ throw new Error(constants_1.AI_SERVICE_ERROR_TEMPLATES.API_KEY_REQUIRED(config.provider));
64
65
  }
65
66
  if (!config.provider) {
66
67
  throw new Error('Provider type must be specified');
@@ -1 +1 @@
1
- {"version":3,"file":"capability-operations.d.ts","sourceRoot":"","sources":["../../src/core/capability-operations.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAStE;;;GAGG;AACH,wBAAsB,oBAAoB,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAahG;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,GAAG,EACT,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,iBAAiB,EAAE,uBAAuB,GACzC,OAAO,CAAC,GAAG,CAAC,CA8Dd;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,GAAG,EACT,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,iBAAiB,EAAE,uBAAuB,GACzC,OAAO,CAAC,GAAG,CAAC,CA+Ed;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,GAAG,EACT,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,iBAAiB,EAAE,uBAAuB,GACzC,OAAO,CAAC,GAAG,CAAC,CAuEd;AAED;;GAEG;AACH,wBAAsB,yBAAyB,CAC7C,IAAI,EAAE,GAAG,EACT,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,iBAAiB,EAAE,uBAAuB,GACzC,OAAO,CAAC,GAAG,CAAC,CA2Dd;AAoCD;;GAEG;AACH,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,GAAG,EACT,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,GAAG,CAAC,CA4Nd;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,GAAG,EACT,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,iBAAiB,EAAE,uBAAuB,GACzC,OAAO,CAAC,GAAG,CAAC,CAwFd;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CACxC,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,GAAG,EACT,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,GAAG,CAAC,CAmDd"}
1
+ {"version":3,"file":"capability-operations.d.ts","sourceRoot":"","sources":["../../src/core/capability-operations.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAUtE;;;GAGG;AACH,wBAAsB,oBAAoB,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAahG;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,GAAG,EACT,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,iBAAiB,EAAE,uBAAuB,GACzC,OAAO,CAAC,GAAG,CAAC,CA8Dd;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,GAAG,EACT,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,iBAAiB,EAAE,uBAAuB,GACzC,OAAO,CAAC,GAAG,CAAC,CA+Ed;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,GAAG,EACT,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,iBAAiB,EAAE,uBAAuB,GACzC,OAAO,CAAC,GAAG,CAAC,CAuEd;AAED;;GAEG;AACH,wBAAsB,yBAAyB,CAC7C,IAAI,EAAE,GAAG,EACT,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,iBAAiB,EAAE,uBAAuB,GACzC,OAAO,CAAC,GAAG,CAAC,CA2Dd;AAoCD;;GAEG;AACH,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,GAAG,EACT,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,GAAG,CAAC,CA4Nd;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,GAAG,EACT,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,iBAAiB,EAAE,uBAAuB,GACzC,OAAO,CAAC,GAAG,CAAC,CAwFd;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CACxC,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,GAAG,EACT,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,GAAG,CAAC,CAmDd"}
@@ -50,6 +50,7 @@ exports.handleCapabilityCRUD = handleCapabilityCRUD;
50
50
  const capability_vector_service_1 = require("./capability-vector-service");
51
51
  const capabilities_1 = require("./capabilities");
52
52
  const session_utils_1 = require("./session-utils");
53
+ const validation_1 = require("./constants/validation");
53
54
  const fs = __importStar(require("fs"));
54
55
  const path = __importStar(require("path"));
55
56
  // Note: validateVectorDBConnection and validateEmbeddingService are shared utilities
@@ -147,7 +148,7 @@ async function handleCapabilityGet(args, logger, requestId, capabilityService) {
147
148
  operation: 'get',
148
149
  dataType: 'capabilities',
149
150
  error: {
150
- message: 'Missing required parameter: id',
151
+ message: validation_1.VALIDATION_MESSAGES.MISSING_PARAMETER('id'),
151
152
  details: 'Specify id to retrieve capability data',
152
153
  example: { id: 'capability-id-example' }
153
154
  }
@@ -225,7 +226,7 @@ async function handleCapabilityDelete(args, logger, requestId, capabilityService
225
226
  operation: 'delete',
226
227
  dataType: 'capabilities',
227
228
  error: {
228
- message: 'Missing required parameter: id',
229
+ message: validation_1.VALIDATION_MESSAGES.MISSING_PARAMETER('id'),
229
230
  details: 'Specify id to delete capability data',
230
231
  example: { id: 'capability-id-example' }
231
232
  }
@@ -1 +1 @@
1
- {"version":3,"file":"capability-tools.d.ts","sourceRoot":"","sources":["../../src/core/capability-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAGjD;;;GAGG;AACH,eAAO,MAAM,wBAAwB,EAAE,MAwBtC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,MAkCrC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,EAGpC,CAAC;AAsBF;;;;;;;GAOG;AACH,wBAAsB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAwFvF;AAED;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAE7C"}
1
+ {"version":3,"file":"capability-tools.d.ts","sourceRoot":"","sources":["../../src/core/capability-tools.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAIjD;;;GAGG;AACH,eAAO,MAAM,wBAAwB,EAAE,MAwBtC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,MAkCrC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,EAGpC,CAAC;AAsBF;;;;;;;GAOG;AACH,wBAAsB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAwFvF;AAED;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAE7C"}
@@ -12,6 +12,7 @@ exports.CAPABILITY_TOOLS = exports.QUERY_CAPABILITIES_TOOL = exports.SEARCH_CAPA
12
12
  exports.executeCapabilityTools = executeCapabilityTools;
13
13
  exports.resetCapabilityService = resetCapabilityService;
14
14
  const capability_vector_service_1 = require("./capability-vector-service");
15
+ const validation_1 = require("./constants/validation");
15
16
  /**
16
17
  * Tool: search_capabilities
17
18
  * Semantic search for cluster capabilities by intent/concept
@@ -122,7 +123,7 @@ async function executeCapabilityTools(toolName, input) {
122
123
  if (!query) {
123
124
  return {
124
125
  success: false,
125
- error: 'Missing required parameter: query',
126
+ error: validation_1.VALIDATION_MESSAGES.MISSING_PARAMETER('query'),
126
127
  message: 'search_capabilities requires a query parameter'
127
128
  };
128
129
  }
@@ -153,7 +154,7 @@ async function executeCapabilityTools(toolName, input) {
153
154
  if (!filter) {
154
155
  return {
155
156
  success: false,
156
- error: 'Missing required parameter: filter',
157
+ error: validation_1.VALIDATION_MESSAGES.MISSING_PARAMETER('filter'),
157
158
  message: 'query_capabilities requires a filter parameter with Qdrant filter syntax'
158
159
  };
159
160
  }
@@ -0,0 +1,202 @@
1
+ /**
2
+ * Error messages and templates
3
+ *
4
+ * Centralized error messages, categories, and templates for
5
+ * comprehensive error handling across the application.
6
+ */
7
+ /**
8
+ * Network and connectivity error messages
9
+ */
10
+ export declare const NETWORK_ERRORS: {
11
+ readonly CONNECTION_FAILED: "Failed to establish connection";
12
+ readonly TIMEOUT: "Request timeout";
13
+ readonly UNREACHABLE: "Service unreachable";
14
+ readonly DNS_RESOLUTION_FAILED: "DNS resolution failed";
15
+ readonly NETWORK_UNAVAILABLE: "Network unavailable";
16
+ };
17
+ /**
18
+ * Authentication and authorization error messages
19
+ */
20
+ export declare const AUTH_ERRORS: {
21
+ readonly AUTHENTICATION_FAILED: "Authentication failed. Please verify your credentials.";
22
+ readonly UNAUTHORIZED: "Unauthorized access";
23
+ readonly INVALID_TOKEN: "Invalid or expired token";
24
+ readonly MISSING_CREDENTIALS: "Authentication credentials missing";
25
+ readonly INVALID_API_KEY: "Invalid API key provided";
26
+ };
27
+ /**
28
+ * Kubernetes-specific error messages
29
+ */
30
+ export declare const KUBERNETES_ERRORS: {
31
+ readonly CLUSTER_UNREACHABLE: "Unable to connect to Kubernetes cluster. Please check your kubeconfig and cluster connectivity.";
32
+ readonly KUBECONFIG_NOT_FOUND: "Kubeconfig file not found";
33
+ readonly INVALID_CONTEXT: "Invalid Kubernetes context";
34
+ readonly RESOURCE_NOT_FOUND: "Kubernetes resource not found";
35
+ readonly INSUFFICIENT_PERMISSIONS: "Insufficient permissions to access Kubernetes resources";
36
+ };
37
+ /**
38
+ * Kubernetes error templates with detailed troubleshooting
39
+ */
40
+ export declare const KUBERNETES_ERROR_TEMPLATES: {
41
+ /**
42
+ * Authentication error templates
43
+ */
44
+ readonly AUTHENTICATION: {
45
+ /**
46
+ * Bearer token authentication failed
47
+ * @param originalError - The original error message
48
+ */
49
+ readonly INVALID_TOKEN: (originalError: string) => string;
50
+ /**
51
+ * Certificate authentication failed
52
+ * @param originalError - The original error message
53
+ */
54
+ readonly CERTIFICATE_FAILED: (originalError: string) => string;
55
+ /**
56
+ * Authentication provider not available
57
+ * @param originalError - The original error message
58
+ */
59
+ readonly PROVIDER_MISSING: (originalError: string) => string;
60
+ /**
61
+ * Generic authentication failure
62
+ * @param originalError - The original error message
63
+ */
64
+ readonly GENERIC_FAILED: (originalError: string) => string;
65
+ };
66
+ /**
67
+ * Authorization/RBAC error templates
68
+ */
69
+ readonly AUTHORIZATION: {
70
+ /**
71
+ * CRD discovery permission error
72
+ * @param originalError - The original error message
73
+ */
74
+ readonly CRD_PERMISSIONS: (originalError: string) => string;
75
+ /**
76
+ * Forbidden access error
77
+ * @param originalError - The original error message
78
+ */
79
+ readonly FORBIDDEN: (originalError: string) => string;
80
+ /**
81
+ * Generic permission denied error
82
+ * @param originalError - The original error message
83
+ */
84
+ readonly PERMISSION_DENIED: (originalError: string) => string;
85
+ };
86
+ /**
87
+ * API availability error templates
88
+ */
89
+ readonly API: {
90
+ /**
91
+ * API version not supported
92
+ * @param originalError - The original error message
93
+ */
94
+ readonly VERSION_UNSUPPORTED: (originalError: string) => string;
95
+ /**
96
+ * API resource not available
97
+ * @param originalError - The original error message
98
+ */
99
+ readonly RESOURCE_UNAVAILABLE: (originalError: string) => string;
100
+ };
101
+ /**
102
+ * Kubeconfig error templates
103
+ */
104
+ readonly KUBECONFIG: {
105
+ /**
106
+ * Context not found error
107
+ * @param originalError - The original error message
108
+ */
109
+ readonly CONTEXT_NOT_FOUND: (originalError: string) => string;
110
+ /**
111
+ * Kubeconfig file not found
112
+ * @param originalError - The original error message
113
+ */
114
+ readonly FILE_NOT_FOUND: (originalError: string) => string;
115
+ /**
116
+ * Invalid kubeconfig format
117
+ * @param originalError - The original error message
118
+ */
119
+ readonly INVALID_FORMAT: (originalError: string) => string;
120
+ };
121
+ /**
122
+ * Version compatibility error template
123
+ * @param originalError - The original error message
124
+ */
125
+ readonly VERSION_COMPATIBILITY: (originalError: string) => string;
126
+ };
127
+ /**
128
+ * AI service error messages
129
+ */
130
+ export declare const AI_SERVICE_ERRORS: {
131
+ readonly SERVICE_UNAVAILABLE: "AI service is temporarily unavailable. Please try again later.";
132
+ readonly RATE_LIMIT_EXCEEDED: "Rate limit exceeded. Please wait before retrying.";
133
+ readonly INVALID_MODEL: "Invalid AI model specified";
134
+ readonly API_KEY_INVALID: "AI provider API key is invalid";
135
+ readonly QUOTA_EXCEEDED: "AI service quota exceeded";
136
+ };
137
+ /**
138
+ * AI service error templates with dynamic content
139
+ */
140
+ export declare const AI_SERVICE_ERROR_TEMPLATES: {
141
+ /**
142
+ * API key required error template
143
+ * @param providerType - The AI provider type requiring the API key
144
+ */
145
+ readonly API_KEY_REQUIRED: (providerType: string) => string;
146
+ /**
147
+ * OpenAI API key required for specific service
148
+ * @param service - The service requiring OpenAI API key
149
+ */
150
+ readonly OPENAI_KEY_REQUIRED: (service: string) => string;
151
+ /**
152
+ * AI provider not available error
153
+ */
154
+ readonly PROVIDER_NOT_AVAILABLE: "AI provider is not available. No API keys configured. Please set ANTHROPIC_API_KEY, OPENAI_API_KEY, or another supported provider key.";
155
+ /**
156
+ * Embedding service unavailable error
157
+ */
158
+ readonly EMBEDDING_SERVICE_UNAVAILABLE: "embedding service unavailable";
159
+ /**
160
+ * AI provider not initialized for specific functionality
161
+ * @param functionality - The functionality requiring AI provider
162
+ */
163
+ readonly PROVIDER_NOT_INITIALIZED: (functionality: string) => string;
164
+ /**
165
+ * Unsupported provider error
166
+ * @param providerType - The unsupported provider type
167
+ * @param supportedProviders - List of supported providers
168
+ */
169
+ readonly UNSUPPORTED_PROVIDER: (providerType: string, supportedProviders: string[]) => string;
170
+ /**
171
+ * ResourceRanker not available error
172
+ * @param functionality - The specific functionality needing ResourceRanker
173
+ */
174
+ readonly RESOURCE_RANKER_UNAVAILABLE: (functionality: string) => string;
175
+ };
176
+ /**
177
+ * Generic error templates
178
+ */
179
+ export declare const ERROR_TEMPLATES: {
180
+ /**
181
+ * Generic error with context
182
+ * @param operation - The operation that failed
183
+ * @param reason - The reason for failure
184
+ */
185
+ readonly OPERATION_FAILED: (operation: string, reason?: string) => string;
186
+ /**
187
+ * Unexpected error template
188
+ * @param context - Context where the error occurred
189
+ */
190
+ readonly UNEXPECTED_ERROR: (context?: string) => string;
191
+ /**
192
+ * Feature not implemented template
193
+ * @param feature - The feature that is not implemented
194
+ */
195
+ readonly NOT_IMPLEMENTED: (feature: string) => string;
196
+ /**
197
+ * Dependency missing template
198
+ * @param dependency - The missing dependency
199
+ */
200
+ readonly DEPENDENCY_MISSING: (dependency: string) => string;
201
+ };
202
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/core/constants/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;CAMjB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,WAAW;;;;;;CAOd,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;CAQpB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,0BAA0B;IACrC;;OAEG;;QAED;;;WAGG;gDAC4B,MAAM;QAGrC;;;WAGG;qDACiC,MAAM;QAG1C;;;WAGG;mDAC+B,MAAM;QAGxC;;;WAGG;iDAC6B,MAAM;;IAIxC;;OAEG;;QAED;;;WAGG;kDAC8B,MAAM;QAGvC;;;WAGG;4CACwB,MAAM;QAGjC;;;WAGG;oDACgC,MAAM;;IAI3C;;OAEG;;QAED;;;WAGG;sDACkC,MAAM;QAG3C;;;WAGG;uDACmC,MAAM;;IAI9C;;OAEG;;QAED;;;WAGG;oDACgC,MAAM;QAGzC;;;WAGG;iDAC6B,MAAM;QAGtC;;;WAGG;iDAC6B,MAAM;;IAIxC;;;OAGG;oDACoC,MAAM;CAErC,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;CAOpB,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,0BAA0B;IACrC;;;OAGG;8CAC8B,MAAM;IAGvC;;;OAGG;4CAC4B,MAAM;IAGrC;;OAEG;;IAIH;;OAEG;;IAGH;;;OAGG;uDACuC,MAAM;IAGhD;;;;OAIG;kDACkC,MAAM,sBAAsB,MAAM,EAAE;IAGzE;;;OAGG;0DAC0C,MAAM;CAE3C,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,eAAe;IAC1B;;;;OAIG;2CAC2B,MAAM,WAAW,MAAM;IAGrD;;;OAGG;0CAC0B,MAAM;IAKnC;;;OAGG;wCACwB,MAAM;IAEjC;;;OAGG;8CAC8B,MAAM;CAE/B,CAAC"}
@@ -0,0 +1,206 @@
1
+ "use strict";
2
+ /**
3
+ * Error messages and templates
4
+ *
5
+ * Centralized error messages, categories, and templates for
6
+ * comprehensive error handling across the application.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.ERROR_TEMPLATES = exports.AI_SERVICE_ERROR_TEMPLATES = exports.AI_SERVICE_ERRORS = exports.KUBERNETES_ERROR_TEMPLATES = exports.KUBERNETES_ERRORS = exports.AUTH_ERRORS = exports.NETWORK_ERRORS = void 0;
10
+ /**
11
+ * Network and connectivity error messages
12
+ */
13
+ exports.NETWORK_ERRORS = {
14
+ CONNECTION_FAILED: 'Failed to establish connection',
15
+ TIMEOUT: 'Request timeout',
16
+ UNREACHABLE: 'Service unreachable',
17
+ DNS_RESOLUTION_FAILED: 'DNS resolution failed',
18
+ NETWORK_UNAVAILABLE: 'Network unavailable',
19
+ };
20
+ /**
21
+ * Authentication and authorization error messages
22
+ */
23
+ exports.AUTH_ERRORS = {
24
+ AUTHENTICATION_FAILED: 'Authentication failed. Please verify your credentials.',
25
+ UNAUTHORIZED: 'Unauthorized access',
26
+ INVALID_TOKEN: 'Invalid or expired token',
27
+ MISSING_CREDENTIALS: 'Authentication credentials missing',
28
+ INVALID_API_KEY: 'Invalid API key provided',
29
+ };
30
+ /**
31
+ * Kubernetes-specific error messages
32
+ */
33
+ exports.KUBERNETES_ERRORS = {
34
+ CLUSTER_UNREACHABLE: 'Unable to connect to Kubernetes cluster. Please check your kubeconfig and cluster connectivity.',
35
+ KUBECONFIG_NOT_FOUND: 'Kubeconfig file not found',
36
+ INVALID_CONTEXT: 'Invalid Kubernetes context',
37
+ RESOURCE_NOT_FOUND: 'Kubernetes resource not found',
38
+ INSUFFICIENT_PERMISSIONS: 'Insufficient permissions to access Kubernetes resources',
39
+ };
40
+ /**
41
+ * Kubernetes error templates with detailed troubleshooting
42
+ */
43
+ exports.KUBERNETES_ERROR_TEMPLATES = {
44
+ /**
45
+ * Authentication error templates
46
+ */
47
+ AUTHENTICATION: {
48
+ /**
49
+ * Bearer token authentication failed
50
+ * @param originalError - The original error message
51
+ */
52
+ INVALID_TOKEN: (originalError) => `Token may be expired: Bearer token authentication failed.\n\nTroubleshooting steps:\n- Token may be expired - refresh credentials\n- Check token format in kubeconfig\n- Re-authenticate with cluster: kubectl auth login\n- Verify service account token if applicable\n\nOriginal error: ${originalError}`,
53
+ /**
54
+ * Certificate authentication failed
55
+ * @param originalError - The original error message
56
+ */
57
+ CERTIFICATE_FAILED: (originalError) => `Certificate authentication failed: Client certificate validation error.\n\nTroubleshooting steps:\n- Verify certificate path in kubeconfig\n- Check certificate expiration date\n- Ensure certificate authority (CA) bundle is correct\n- Re-generate client certificates if needed\n\nOriginal error: ${originalError}`,
58
+ /**
59
+ * Authentication provider not available
60
+ * @param originalError - The original error message
61
+ */
62
+ PROVIDER_MISSING: (originalError) => `Authentication provider not available: Required auth plugin missing.\n\nTroubleshooting steps:\n- Install required authentication plugin (e.g., OIDC)\n- Check kubectl config for auth provider configuration\n- Verify authentication method compatibility\n- Consult cluster administrator for auth setup\n\nOriginal error: ${originalError}`,
63
+ /**
64
+ * Generic authentication failure
65
+ * @param originalError - The original error message
66
+ */
67
+ GENERIC_FAILED: (originalError) => `Authentication failed: Invalid or missing credentials.\n\nTroubleshooting steps:\n- Verify credentials in kubeconfig\n- Re-authenticate with cluster\n- Check authentication method configuration\n- Contact cluster administrator if needed\n\nOriginal error: ${originalError}`,
68
+ },
69
+ /**
70
+ * Authorization/RBAC error templates
71
+ */
72
+ AUTHORIZATION: {
73
+ /**
74
+ * CRD discovery permission error
75
+ * @param originalError - The original error message
76
+ */
77
+ CRD_PERMISSIONS: (originalError) => `CRD discovery requires cluster-level permissions: Insufficient RBAC permissions.\n\nTroubleshooting steps:\n- CRD discovery requires admin privileges\n- Request cluster-admin role or CRD read permissions\n- Contact cluster administrator for permission escalation\n- Use 'kubectl auth can-i list customresourcedefinitions' to check permissions\n\nOriginal error: ${originalError}`,
78
+ /**
79
+ * Forbidden access error
80
+ * @param originalError - The original error message
81
+ */
82
+ FORBIDDEN: (originalError) => `Insufficient permissions: RBAC restrictions prevent this operation.\n\nTroubleshooting steps:\n- RBAC role required for resource access\n- Request appropriate permissions from cluster administrator\n- Check current permissions: kubectl auth can-i list <resource>\n- Consider using cluster-admin role for discovery operations\n\nOriginal error: ${originalError}`,
83
+ /**
84
+ * Generic permission denied error
85
+ * @param originalError - The original error message
86
+ */
87
+ PERMISSION_DENIED: (originalError) => `Permission denied: Insufficient RBAC permissions for cluster access.\n\nTroubleshooting steps:\n- Request appropriate RBAC permissions\n- Check current access: kubectl auth can-i list <resource>\n- Contact cluster administrator for role assignment\n- Verify service account permissions if applicable\n\nOriginal error: ${originalError}`,
88
+ },
89
+ /**
90
+ * API availability error templates
91
+ */
92
+ API: {
93
+ /**
94
+ * API version not supported
95
+ * @param originalError - The original error message
96
+ */
97
+ VERSION_UNSUPPORTED: (originalError) => `API version not supported: Cluster doesn't support requested API version.\n\nTroubleshooting steps:\n- Try different API version (e.g., apps/v1 instead of apps/v1beta1)\n- Check available API versions: kubectl api-versions\n- Verify Kubernetes cluster version compatibility\n- Consult API migration guides for version changes\n\nOriginal error: ${originalError}`,
98
+ /**
99
+ * API resource not available
100
+ * @param originalError - The original error message
101
+ */
102
+ RESOURCE_UNAVAILABLE: (originalError) => `API resource not available: Requested resource type not found in cluster.\n\nTroubleshooting steps:\n- Check available resources: kubectl api-resources\n- Verify cluster supports required resource types\n- Check Kubernetes version compatibility\n- Confirm cluster configuration and enabled APIs\n\nOriginal error: ${originalError}`,
103
+ },
104
+ /**
105
+ * Kubeconfig error templates
106
+ */
107
+ KUBECONFIG: {
108
+ /**
109
+ * Context not found error
110
+ * @param originalError - The original error message
111
+ */
112
+ CONTEXT_NOT_FOUND: (originalError) => `Context not found: Specified context doesn't exist in kubeconfig.\n\nTroubleshooting steps:\n- List available contexts: kubectl config get-contexts\n- Set correct context: kubectl config use-context <context-name>\n- Verify kubeconfig file contains required context\n- Check context name spelling and case sensitivity\n\nOriginal error: ${originalError}`,
113
+ /**
114
+ * Kubeconfig file not found
115
+ * @param originalError - The original error message
116
+ */
117
+ FILE_NOT_FOUND: (originalError) => `Kubeconfig file not found: Cannot locate configuration file.\n\nTroubleshooting steps:\n- Check file path exists and is accessible\n- Verify kubeconfig file permissions\n- Set KUBECONFIG environment variable if needed\n- Create kubeconfig file or copy from cluster administrator\n\nOriginal error: ${originalError}`,
118
+ /**
119
+ * Invalid kubeconfig format
120
+ * @param originalError - The original error message
121
+ */
122
+ INVALID_FORMAT: (originalError) => `Invalid kubeconfig format: Configuration file has syntax or format errors.\n\nTroubleshooting steps:\n- Validate YAML syntax in kubeconfig file\n- Check file structure: kubectl config view\n- Restore from backup or re-download from cluster\n- Verify all required sections (clusters, contexts, users)\n\nOriginal error: ${originalError}`,
123
+ },
124
+ /**
125
+ * Version compatibility error template
126
+ * @param originalError - The original error message
127
+ */
128
+ VERSION_COMPATIBILITY: (originalError) => `Kubernetes version compatibility issue: Version mismatch detected.\n\nTroubleshooting steps:\n- Check cluster and client versions: kubectl version\n- Verify supported Kubernetes versions for this tool\n- Update kubectl client if needed\n- Consult compatibility matrix for version support\n\nOriginal error: ${originalError}`,
129
+ };
130
+ /**
131
+ * AI service error messages
132
+ */
133
+ exports.AI_SERVICE_ERRORS = {
134
+ SERVICE_UNAVAILABLE: 'AI service is temporarily unavailable. Please try again later.',
135
+ RATE_LIMIT_EXCEEDED: 'Rate limit exceeded. Please wait before retrying.',
136
+ INVALID_MODEL: 'Invalid AI model specified',
137
+ API_KEY_INVALID: 'AI provider API key is invalid',
138
+ QUOTA_EXCEEDED: 'AI service quota exceeded',
139
+ };
140
+ /**
141
+ * AI service error templates with dynamic content
142
+ */
143
+ exports.AI_SERVICE_ERROR_TEMPLATES = {
144
+ /**
145
+ * API key required error template
146
+ * @param providerType - The AI provider type requiring the API key
147
+ */
148
+ API_KEY_REQUIRED: (providerType) => `API key is required for ${providerType} provider`,
149
+ /**
150
+ * OpenAI API key required for specific service
151
+ * @param service - The service requiring OpenAI API key
152
+ */
153
+ OPENAI_KEY_REQUIRED: (service) => `OpenAI API key required for ${service}`,
154
+ /**
155
+ * AI provider not available error
156
+ */
157
+ PROVIDER_NOT_AVAILABLE: 'AI provider is not available. No API keys configured. Please set ANTHROPIC_API_KEY, OPENAI_API_KEY, or another supported provider key.',
158
+ /**
159
+ * Embedding service unavailable error
160
+ */
161
+ EMBEDDING_SERVICE_UNAVAILABLE: 'embedding service unavailable',
162
+ /**
163
+ * AI provider not initialized for specific functionality
164
+ * @param functionality - The functionality requiring AI provider
165
+ */
166
+ PROVIDER_NOT_INITIALIZED: (functionality) => `AI provider not initialized. API key required for ${functionality}.`,
167
+ /**
168
+ * Unsupported provider error
169
+ * @param providerType - The unsupported provider type
170
+ * @param supportedProviders - List of supported providers
171
+ */
172
+ UNSUPPORTED_PROVIDER: (providerType, supportedProviders) => `Unsupported provider: ${providerType}. Must be one of: ${supportedProviders.join(', ')}`,
173
+ /**
174
+ * ResourceRanker not available error
175
+ * @param functionality - The specific functionality needing ResourceRanker
176
+ */
177
+ RESOURCE_RANKER_UNAVAILABLE: (functionality) => `ResourceRanker not available. AI provider API key is required for ${functionality}.`,
178
+ };
179
+ /**
180
+ * Generic error templates
181
+ */
182
+ exports.ERROR_TEMPLATES = {
183
+ /**
184
+ * Generic error with context
185
+ * @param operation - The operation that failed
186
+ * @param reason - The reason for failure
187
+ */
188
+ OPERATION_FAILED: (operation, reason) => reason ? `${operation} failed: ${reason}` : `${operation} failed`,
189
+ /**
190
+ * Unexpected error template
191
+ * @param context - Context where the error occurred
192
+ */
193
+ UNEXPECTED_ERROR: (context) => context
194
+ ? `An unexpected error occurred in ${context}`
195
+ : 'An unexpected error occurred. Please try again or contact support.',
196
+ /**
197
+ * Feature not implemented template
198
+ * @param feature - The feature that is not implemented
199
+ */
200
+ NOT_IMPLEMENTED: (feature) => `Feature not implemented: ${feature}`,
201
+ /**
202
+ * Dependency missing template
203
+ * @param dependency - The missing dependency
204
+ */
205
+ DEPENDENCY_MISSING: (dependency) => `Required dependency missing: ${dependency}`,
206
+ };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Centralized constants and messages
3
+ *
4
+ * Single entry point for all constants, messages, and templates
5
+ * used throughout the dot-ai application.
6
+ */
7
+ export * from './investigation.js';
8
+ export * from './validation.js';
9
+ export * from './errors.js';
10
+ export * from './stages.js';
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/constants/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ /**
3
+ * Centralized constants and messages
4
+ *
5
+ * Single entry point for all constants, messages, and templates
6
+ * used throughout the dot-ai application.
7
+ */
8
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
9
+ if (k2 === undefined) k2 = k;
10
+ var desc = Object.getOwnPropertyDescriptor(m, k);
11
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
12
+ desc = { enumerable: true, get: function() { return m[k]; } };
13
+ }
14
+ Object.defineProperty(o, k2, desc);
15
+ }) : (function(o, m, k, k2) {
16
+ if (k2 === undefined) k2 = k;
17
+ o[k2] = m[k];
18
+ }));
19
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
20
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
21
+ };
22
+ Object.defineProperty(exports, "__esModule", { value: true });
23
+ __exportStar(require("./investigation.js"), exports);
24
+ __exportStar(require("./validation.js"), exports);
25
+ __exportStar(require("./errors.js"), exports);
26
+ __exportStar(require("./stages.js"), exports);
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Investigation and AI provider constants
3
+ *
4
+ * Centralized messages for AI investigation workflows, tool loops,
5
+ * and provider-specific interactions.
6
+ */
7
+ /**
8
+ * Investigation workflow messages
9
+ */
10
+ export declare const INVESTIGATION_MESSAGES: {
11
+ /**
12
+ * Message sent to AI when maximum investigation steps are reached
13
+ * Used by both host-provider and vercel-provider to force final summary
14
+ */
15
+ readonly WRAP_UP: "You have reached the maximum number of investigation steps. Please provide your final summary NOW in the required JSON format based on all findings gathered so far. Do not request any more tool calls.";
16
+ /**
17
+ * Messages for investigation lifecycle
18
+ */
19
+ readonly INVESTIGATION_START: "Starting AI investigation with toolLoop";
20
+ readonly INVESTIGATION_COMPLETED: "Investigation completed by toolLoop";
21
+ readonly INVESTIGATION_FAILED: "Investigation failed";
22
+ /**
23
+ * Tool loop status messages
24
+ */
25
+ readonly MAX_ITERATIONS_REACHED: "Maximum investigation iterations reached";
26
+ readonly STARTING_TOOL_LOOP: "Starting toolLoop with kubectl investigation tools";
27
+ readonly INVESTIGATION_AND_ANALYSIS_COMPLETED: "Investigation and analysis completed";
28
+ };
29
+ /**
30
+ * Provider-specific messages
31
+ */
32
+ export declare const PROVIDER_MESSAGES: {
33
+ /**
34
+ * Session management
35
+ */
36
+ readonly SESSION_LOADED: "Loaded session for choice execution";
37
+ readonly SESSION_NOT_FOUND: "Session not found or expired";
38
+ /**
39
+ * Processing status
40
+ */
41
+ readonly PROCESSING_REQUEST: "Processing version tool request with system diagnostics";
42
+ readonly RUNNING_DIAGNOSTICS: "Running system diagnostics...";
43
+ readonly DIAGNOSTICS_COMPLETED: "System diagnostics completed";
44
+ };
45
+ //# sourceMappingURL=investigation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"investigation.d.ts","sourceRoot":"","sources":["../../../src/core/constants/investigation.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,eAAO,MAAM,sBAAsB;IACjC;;;OAGG;;IAGH;;OAEG;;;;IAKH;;OAEG;;;;CAIK,CAAC;AAEX;;GAEG;AACH,eAAO,MAAM,iBAAiB;IAC5B;;OAEG;;;IAIH;;OAEG;;;;CAIK,CAAC"}
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ /**
3
+ * Investigation and AI provider constants
4
+ *
5
+ * Centralized messages for AI investigation workflows, tool loops,
6
+ * and provider-specific interactions.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.PROVIDER_MESSAGES = exports.INVESTIGATION_MESSAGES = void 0;
10
+ /**
11
+ * Investigation workflow messages
12
+ */
13
+ exports.INVESTIGATION_MESSAGES = {
14
+ /**
15
+ * Message sent to AI when maximum investigation steps are reached
16
+ * Used by both host-provider and vercel-provider to force final summary
17
+ */
18
+ WRAP_UP: 'You have reached the maximum number of investigation steps. Please provide your final summary NOW in the required JSON format based on all findings gathered so far. Do not request any more tool calls.',
19
+ /**
20
+ * Messages for investigation lifecycle
21
+ */
22
+ INVESTIGATION_START: 'Starting AI investigation with toolLoop',
23
+ INVESTIGATION_COMPLETED: 'Investigation completed by toolLoop',
24
+ INVESTIGATION_FAILED: 'Investigation failed',
25
+ /**
26
+ * Tool loop status messages
27
+ */
28
+ MAX_ITERATIONS_REACHED: 'Maximum investigation iterations reached',
29
+ STARTING_TOOL_LOOP: 'Starting toolLoop with kubectl investigation tools',
30
+ INVESTIGATION_AND_ANALYSIS_COMPLETED: 'Investigation and analysis completed'
31
+ };
32
+ /**
33
+ * Provider-specific messages
34
+ */
35
+ exports.PROVIDER_MESSAGES = {
36
+ /**
37
+ * Session management
38
+ */
39
+ SESSION_LOADED: 'Loaded session for choice execution',
40
+ SESSION_NOT_FOUND: 'Session not found or expired',
41
+ /**
42
+ * Processing status
43
+ */
44
+ PROCESSING_REQUEST: 'Processing version tool request with system diagnostics',
45
+ RUNNING_DIAGNOSTICS: 'Running system diagnostics...',
46
+ DIAGNOSTICS_COMPLETED: 'System diagnostics completed'
47
+ };