@vfarcic/dot-ai 0.162.0 → 0.164.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/dist/core/providers/tool-utils.d.ts.map +1 -1
- package/dist/core/providers/tool-utils.js +62 -11
- package/dist/core/unified-creation-session.js +1 -1
- package/dist/interfaces/mcp.d.ts.map +1 -1
- package/dist/interfaces/mcp.js +2 -0
- package/package.json +1 -1
- package/prompts/capabilities-generation.md +5 -5
- package/prompts/capability-inference.md +1 -1
- package/prompts/helm-chart-selection.md +2 -2
- package/prompts/helm-generation.md +4 -4
- package/prompts/kyverno-generation.md +4 -4
- package/prompts/operate-user.md +4 -4
- package/prompts/packaging-generation.md +6 -6
- package/prompts/policy-complete-apply.md +1 -1
- package/prompts/policy-complete-save.md +1 -1
- package/prompts/question-generation.md +4 -4
- package/prompts/resource-analysis.md +3 -3
- package/prompts/resource-selection.md +2 -2
- package/prompts/solution-enhancement.md +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-utils.d.ts","sourceRoot":"","sources":["../../../src/core/providers/tool-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAO7D;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,MAAM,CAEtE;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,QAAgC,CAAC;AAE7D;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,EAAE,
|
|
1
|
+
{"version":3,"file":"tool-utils.d.ts","sourceRoot":"","sources":["../../../src/core/providers/tool-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAElD;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAO7D;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,GAAG,MAAM,CAEtE;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,QAAgC,CAAC;AAE7D;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,EAAE,CA8EvD"}
|
|
@@ -34,23 +34,74 @@ exports.TOOL_CALL_REGEX = /```json\s*([\s\S]*?)\s*```/g;
|
|
|
34
34
|
function extractToolCalls(content) {
|
|
35
35
|
const toolCalls = [];
|
|
36
36
|
const matches = [...content.matchAll(exports.TOOL_CALL_REGEX)];
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
37
|
+
if (matches.length > 0) {
|
|
38
|
+
for (const match of matches) {
|
|
39
|
+
try {
|
|
40
|
+
const jsonContent = match[1];
|
|
41
|
+
const parsed = JSON.parse(jsonContent);
|
|
42
|
+
if (Array.isArray(parsed)) {
|
|
43
|
+
for (const item of parsed) {
|
|
44
|
+
if (item && typeof item === 'object' && item.tool) {
|
|
45
|
+
toolCalls.push(item);
|
|
46
|
+
}
|
|
45
47
|
}
|
|
46
48
|
}
|
|
49
|
+
else if (parsed && typeof parsed === 'object' && parsed.tool) {
|
|
50
|
+
toolCalls.push(parsed);
|
|
51
|
+
}
|
|
47
52
|
}
|
|
48
|
-
|
|
49
|
-
|
|
53
|
+
catch (e) {
|
|
54
|
+
// Ignore parse errors
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
// Fallback: Try to find a JSON object in the content if no code blocks found
|
|
60
|
+
try {
|
|
61
|
+
const firstBrace = content.indexOf('{');
|
|
62
|
+
if (firstBrace !== -1) {
|
|
63
|
+
// Simple brace counting to find the end of the JSON object
|
|
64
|
+
let braceCount = 0;
|
|
65
|
+
let inString = false;
|
|
66
|
+
let escapeNext = false;
|
|
67
|
+
let jsonEndIndex = -1;
|
|
68
|
+
for (let i = firstBrace; i < content.length; i++) {
|
|
69
|
+
const char = content[i];
|
|
70
|
+
if (escapeNext) {
|
|
71
|
+
escapeNext = false;
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
if (char === '\\') {
|
|
75
|
+
escapeNext = true;
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
if (char === '"') {
|
|
79
|
+
inString = !inString;
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
if (inString)
|
|
83
|
+
continue;
|
|
84
|
+
if (char === '{')
|
|
85
|
+
braceCount++;
|
|
86
|
+
if (char === '}') {
|
|
87
|
+
braceCount--;
|
|
88
|
+
if (braceCount === 0) {
|
|
89
|
+
jsonEndIndex = i + 1;
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (jsonEndIndex !== -1) {
|
|
95
|
+
const jsonString = content.substring(firstBrace, jsonEndIndex);
|
|
96
|
+
const parsed = JSON.parse(jsonString);
|
|
97
|
+
if (parsed && typeof parsed === 'object' && parsed.tool) {
|
|
98
|
+
toolCalls.push(parsed);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
50
101
|
}
|
|
51
102
|
}
|
|
52
103
|
catch (e) {
|
|
53
|
-
// Ignore
|
|
104
|
+
// Ignore fallback errors
|
|
54
105
|
}
|
|
55
106
|
}
|
|
56
107
|
return toolCalls;
|
|
@@ -833,7 +833,7 @@ Please try again or modify your policy description.`,
|
|
|
833
833
|
const capabilityService = new capability_vector_service_1.CapabilityVectorService(collection);
|
|
834
834
|
// Use existing searchCapabilities function - no fallback, let it throw if it fails
|
|
835
835
|
const searchResults = await capabilityService.searchCapabilities(searchQuery, {
|
|
836
|
-
limit:
|
|
836
|
+
limit: 40 // Haiku max: 180K tokens (HTML escaping fix reduced prompt size by ~38%)
|
|
837
837
|
});
|
|
838
838
|
if (searchResults.length === 0) {
|
|
839
839
|
throw new Error(`No relevant capabilities found for policy description: "${policyDescription}"`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/interfaces/mcp.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAWH,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAkDtC,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,UAAU,GAAG,WAAW,CAAC;CACxC;AAED,qBAAa,SAAS;IACpB,OAAO,CAAC,MAAM,CAAY;IAC1B,OAAO,CAAC,KAAK,CAAQ;IACrB,OAAO,CAAC,WAAW,CAAkB;IACrC,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,gBAAgB,CAAa;IACrC,OAAO,CAAC,MAAM,CAAkB;IAChC,OAAO,CAAC,UAAU,CAAC,CAAkC;IACrD,OAAO,CAAC,aAAa,CAAC,CAAgC;IACtD,OAAO,CAAC,YAAY,CAAmB;IACvC,OAAO,CAAC,aAAa,CAAgB;gBAEzB,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,eAAe;IAyCjD;;OAEG;IACH,OAAO,CAAC,YAAY;IA8BpB;;OAEG;IACH,OAAO,CAAC,aAAa;IA6HrB;;OAEG;IACH,OAAO,CAAC,eAAe;IAqCvB,OAAO,CAAC,qBAAqB;YAgBf,qBAAqB;
|
|
1
|
+
{"version":3,"file":"mcp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json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vfarcic/dot-ai",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.164.0",
|
|
4
4
|
"description": "AI-powered development productivity platform that enhances software development workflows through intelligent automation and AI-driven assistance",
|
|
5
5
|
"mcpName": "io.github.vfarcic/dot-ai",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
# Kubernetes Manifest Generation
|
|
2
2
|
|
|
3
3
|
## Solution Configuration
|
|
4
|
-
{{solution}}
|
|
4
|
+
{{{solution}}}
|
|
5
5
|
|
|
6
6
|
## Resource Schemas
|
|
7
7
|
The following schemas are available for the resources selected in the solution:
|
|
8
|
-
{{schemas}}
|
|
8
|
+
{{{schemas}}}
|
|
9
9
|
|
|
10
10
|
## Required Labels
|
|
11
11
|
Add these labels to the metadata.labels section of EVERY resource you generate:
|
|
12
|
-
{{labels}}
|
|
12
|
+
{{{labels}}}
|
|
13
13
|
|
|
14
14
|
## Previous Attempt (if retry)
|
|
15
|
-
{{previous_attempt}}
|
|
15
|
+
{{{previous_attempt}}}
|
|
16
16
|
|
|
17
17
|
## Validation Error Details (if retry)
|
|
18
|
-
{{error_details}}
|
|
18
|
+
{{{error_details}}}
|
|
19
19
|
|
|
20
20
|
## Instructions
|
|
21
21
|
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
# Helm Values Generation
|
|
2
2
|
|
|
3
3
|
## Solution Configuration
|
|
4
|
-
{{solution}}
|
|
4
|
+
{{{solution}}}
|
|
5
5
|
|
|
6
6
|
## Chart Values Structure
|
|
7
7
|
The following is the chart's default values.yaml that defines available configuration options:
|
|
8
|
-
{{chart_values}}
|
|
8
|
+
{{{chart_values}}}
|
|
9
9
|
|
|
10
10
|
## Previous Attempt (if retry)
|
|
11
|
-
{{previous_attempt}}
|
|
11
|
+
{{{previous_attempt}}}
|
|
12
12
|
|
|
13
13
|
## Validation Error Details (if retry)
|
|
14
|
-
{{error_details}}
|
|
14
|
+
{{{error_details}}}
|
|
15
15
|
|
|
16
16
|
## Instructions
|
|
17
17
|
|
|
@@ -9,16 +9,16 @@
|
|
|
9
9
|
- **Intent ID**: {{policy_id}}
|
|
10
10
|
|
|
11
11
|
## Available Resource Schemas
|
|
12
|
-
{{resource_schemas}}
|
|
12
|
+
{{{resource_schemas}}}
|
|
13
13
|
|
|
14
14
|
## Namespace Scope Configuration
|
|
15
|
-
{{namespace_scope}}
|
|
15
|
+
{{{namespace_scope}}}
|
|
16
16
|
|
|
17
17
|
## Previous Attempt Analysis
|
|
18
|
-
{{previous_attempt}}
|
|
18
|
+
{{{previous_attempt}}}
|
|
19
19
|
|
|
20
20
|
## Error Details from Previous Attempt
|
|
21
|
-
{{error_details}}
|
|
21
|
+
{{{error_details}}}
|
|
22
22
|
|
|
23
23
|
## Instructions
|
|
24
24
|
|
package/prompts/operate-user.md
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
# Operational Intent
|
|
2
2
|
|
|
3
|
-
{{intent}}
|
|
3
|
+
{{{intent}}}
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Organizational Patterns
|
|
8
8
|
|
|
9
|
-
{{patterns}}
|
|
9
|
+
{{{patterns}}}
|
|
10
10
|
|
|
11
11
|
---
|
|
12
12
|
|
|
13
13
|
# Organizational Policies
|
|
14
14
|
|
|
15
|
-
{{policies}}
|
|
15
|
+
{{{policies}}}
|
|
16
16
|
|
|
17
17
|
---
|
|
18
18
|
|
|
19
19
|
# Cluster Capabilities
|
|
20
20
|
|
|
21
|
-
{{capabilities}}
|
|
21
|
+
{{{capabilities}}}
|
|
22
22
|
|
|
23
23
|
---
|
|
24
24
|
|
|
@@ -10,11 +10,11 @@ Convert validated Kubernetes manifests into {{output_format_description}}.
|
|
|
10
10
|
|
|
11
11
|
## Raw Kubernetes Manifests (Validated)
|
|
12
12
|
```yaml
|
|
13
|
-
{{raw_manifests}}
|
|
13
|
+
{{{raw_manifests}}}
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
## User Configuration (Questions and Answers)
|
|
17
|
-
{{questions_and_answers}}
|
|
17
|
+
{{{questions_and_answers}}}
|
|
18
18
|
|
|
19
19
|
## Output Path
|
|
20
20
|
{{output_path}}
|
|
@@ -31,7 +31,7 @@ Transform the raw Kubernetes manifests into {{output_format_description}}.
|
|
|
31
31
|
|
|
32
32
|
4. **Generate Metadata**: Create required metadata files for the package.
|
|
33
33
|
|
|
34
|
-
{{format_specific_instructions}}
|
|
34
|
+
{{{format_specific_instructions}}}
|
|
35
35
|
|
|
36
36
|
## Response Format
|
|
37
37
|
|
|
@@ -53,13 +53,13 @@ Return a JSON object with exactly this structure:
|
|
|
53
53
|
- `relativePath`: string (required) - File path relative to output directory (e.g., "Chart.yaml", "templates/deployment.yaml")
|
|
54
54
|
- `content`: string (required) - Complete file content
|
|
55
55
|
|
|
56
|
-
{{format_example}}
|
|
56
|
+
{{{format_example}}}
|
|
57
57
|
|
|
58
58
|
## Previous Attempt (if retry)
|
|
59
|
-
{{previous_attempt}}
|
|
59
|
+
{{{previous_attempt}}}
|
|
60
60
|
|
|
61
61
|
## Validation Error Details (if retry)
|
|
62
|
-
{{error_details}}
|
|
62
|
+
{{{error_details}}}
|
|
63
63
|
|
|
64
64
|
If this is a retry, analyze the validation error and fix the specific issue while preserving working parts.
|
|
65
65
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
**Applied Kyverno Policy:**
|
|
8
8
|
```yaml
|
|
9
|
-
{{kyvernoPolicy}}
|
|
9
|
+
{{{kyvernoPolicy}}}
|
|
10
10
|
```
|
|
11
11
|
|
|
12
12
|
The policy intent has been saved and the Kyverno policy has been applied to your cluster. The policy is now active and will enforce the defined rules on new and updated resources.
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
# Question Generation for Kubernetes Configuration
|
|
2
2
|
|
|
3
3
|
## User Intent
|
|
4
|
-
{{intent}}
|
|
4
|
+
{{{intent}}}
|
|
5
5
|
|
|
6
6
|
## Recommended Solution
|
|
7
|
-
{{solution_description}}
|
|
7
|
+
{{{solution_description}}}
|
|
8
8
|
|
|
9
9
|
{{{source_material}}}
|
|
10
10
|
|
|
11
11
|
## Cluster Context
|
|
12
|
-
{{cluster_options}}
|
|
12
|
+
{{{cluster_options}}}
|
|
13
13
|
|
|
14
14
|
## Organizational Policies
|
|
15
|
-
{{policy_context}}
|
|
15
|
+
{{{policy_context}}}
|
|
16
16
|
|
|
17
17
|
## Instructions
|
|
18
18
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# Resource Analysis for Enhancement
|
|
2
2
|
|
|
3
3
|
## Current Solution
|
|
4
|
-
{{current_solution}}
|
|
4
|
+
{{{current_solution}}}
|
|
5
5
|
|
|
6
6
|
## User Request
|
|
7
|
-
{{user_request}}
|
|
7
|
+
{{{user_request}}}
|
|
8
8
|
|
|
9
9
|
## Available Resource Types
|
|
10
|
-
{{available_resource_types}}
|
|
10
|
+
{{{available_resource_types}}}
|
|
11
11
|
|
|
12
12
|
## Instructions
|
|
13
13
|
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
You are a Kubernetes expert. Given this user intent, available resources, and organizational patterns, create and rank complete solutions that address the user's needs.
|
|
4
4
|
|
|
5
5
|
## User Intent
|
|
6
|
-
{{intent}}
|
|
6
|
+
{{{intent}}}
|
|
7
7
|
|
|
8
8
|
## Available Resources
|
|
9
9
|
{{{resources}}}
|
|
10
10
|
|
|
11
11
|
## Organizational Patterns
|
|
12
|
-
{{patterns}}
|
|
12
|
+
{{{patterns}}}
|
|
13
13
|
|
|
14
14
|
## Instructions
|
|
15
15
|
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
# Single-Pass Solution Enhancement
|
|
2
2
|
|
|
3
3
|
## Current Solution
|
|
4
|
-
{{current_solution}}
|
|
4
|
+
{{{current_solution}}}
|
|
5
5
|
|
|
6
6
|
## Detailed Resource Schemas
|
|
7
|
-
{{detailed_schemas}}
|
|
7
|
+
{{{detailed_schemas}}}
|
|
8
8
|
|
|
9
9
|
## Analysis Result
|
|
10
|
-
{{analysis_result}}
|
|
10
|
+
{{{analysis_result}}}
|
|
11
11
|
|
|
12
12
|
## User Response
|
|
13
|
-
{{open_response}}
|
|
13
|
+
{{{open_response}}}
|
|
14
14
|
|
|
15
15
|
## Instructions
|
|
16
16
|
|